summaryrefslogtreecommitdiff
path: root/libs/tgl
diff options
context:
space:
mode:
Diffstat (limited to 'libs/tgl')
-rw-r--r--libs/tgl/docs/CHANGELOG23
-rw-r--r--libs/tgl/docs/LICENSE175
-rw-r--r--libs/tgl/docs/Makefile.in95
-rw-r--r--libs/tgl/docs/Makefile.tl-parser7
-rw-r--r--libs/tgl/docs/README.md27
-rw-r--r--libs/tgl/docs/config.bat524
-rw-r--r--libs/tgl/docs/config.h.in162
-rw-r--r--libs/tgl/docs/configure5669
-rw-r--r--libs/tgl/docs/configure.ac79
-rw-r--r--libs/tgl/docs/gen_constants_h.awk37
-rw-r--r--libs/tgl/docs/m4-ax_gcc_builtin.m4168
-rw-r--r--libs/tgl/docs/m4_ax_check_openssl.m4124
-rw-r--r--libs/tgl/docs/m4_ax_check_zlib.m4142
-rw-r--r--libs/tgl/docs/mime.types1588
-rw-r--r--libs/tgl/generate.vcxproj.filters39
-rw-r--r--libs/tgl/generate_12.vcxproj155
-rw-r--r--libs/tgl/libevent/.gitignore135
-rw-r--r--libs/tgl/libevent/.travis.yml21
-rw-r--r--libs/tgl/libevent/CMakeLists.txt1428
-rw-r--r--libs/tgl/libevent/ChangeLog1402
-rw-r--r--libs/tgl/libevent/ChangeLog-1.4231
-rw-r--r--libs/tgl/libevent/ChangeLog-2.01280
-rw-r--r--libs/tgl/libevent/Doxyfile257
-rw-r--r--libs/tgl/libevent/LICENSE99
-rw-r--r--libs/tgl/libevent/Makefile.am303
-rw-r--r--libs/tgl/libevent/Makefile.nmake82
-rw-r--r--libs/tgl/libevent/README.md397
-rw-r--r--libs/tgl/libevent/WIN32-Code/getopt.c149
-rw-r--r--libs/tgl/libevent/WIN32-Code/getopt.h33
-rw-r--r--libs/tgl/libevent/WIN32-Code/getopt_long.c233
-rw-r--r--libs/tgl/libevent/WIN32-Code/nmake/evconfig-private.h6
-rw-r--r--libs/tgl/libevent/WIN32-Code/nmake/event2/event-config.h360
-rw-r--r--libs/tgl/libevent/WIN32-Code/tree.h677
-rw-r--r--libs/tgl/libevent/appveyor.yml45
-rw-r--r--libs/tgl/libevent/arc4random.c556
-rw-r--r--libs/tgl/libevent/autogen.sh15
-rw-r--r--libs/tgl/libevent/buffer.c3439
-rw-r--r--libs/tgl/libevent/buffer.objbin0 -> 60982 bytes
-rw-r--r--libs/tgl/libevent/buffer_iocp.c326
-rw-r--r--libs/tgl/libevent/buffer_iocp.objbin0 -> 9403 bytes
-rw-r--r--libs/tgl/libevent/bufferevent-internal.h480
-rw-r--r--libs/tgl/libevent/bufferevent.c1016
-rw-r--r--libs/tgl/libevent/bufferevent.objbin0 -> 15234 bytes
-rw-r--r--libs/tgl/libevent/bufferevent_async.c686
-rw-r--r--libs/tgl/libevent/bufferevent_async.objbin0 -> 15266 bytes
-rw-r--r--libs/tgl/libevent/bufferevent_filter.c555
-rw-r--r--libs/tgl/libevent/bufferevent_filter.objbin0 -> 11273 bytes
-rw-r--r--libs/tgl/libevent/bufferevent_openssl.c1484
-rw-r--r--libs/tgl/libevent/bufferevent_pair.c360
-rw-r--r--libs/tgl/libevent/bufferevent_pair.objbin0 -> 6819 bytes
-rw-r--r--libs/tgl/libevent/bufferevent_ratelim.c1092
-rw-r--r--libs/tgl/libevent/bufferevent_ratelim.objbin0 -> 17746 bytes
-rw-r--r--libs/tgl/libevent/bufferevent_sock.c707
-rw-r--r--libs/tgl/libevent/bufferevent_sock.objbin0 -> 12301 bytes
-rw-r--r--libs/tgl/libevent/changelist-internal.h102
-rw-r--r--libs/tgl/libevent/cmake/AddCompilerFlags.cmake15
-rw-r--r--libs/tgl/libevent/cmake/COPYING-CMAKE-SCRIPTS22
-rw-r--r--libs/tgl/libevent/cmake/CheckFileOffsetBits.c14
-rw-r--r--libs/tgl/libevent/cmake/CheckFileOffsetBits.cmake43
-rw-r--r--libs/tgl/libevent/cmake/CheckFunctionExistsEx.c30
-rw-r--r--libs/tgl/libevent/cmake/CheckFunctionExistsEx.cmake69
-rw-r--r--libs/tgl/libevent/cmake/CheckFunctionKeywords.cmake14
-rw-r--r--libs/tgl/libevent/cmake/CheckPrototypeDefinition.c.in29
-rw-r--r--libs/tgl/libevent/cmake/CheckPrototypeDefinition.cmake84
-rw-r--r--libs/tgl/libevent/cmake/CheckWorkingKqueue.cmake52
-rw-r--r--libs/tgl/libevent/cmake/CodeCoverage.cmake162
-rw-r--r--libs/tgl/libevent/cmake/Copyright.txt57
-rw-r--r--libs/tgl/libevent/cmake/FindGit.cmake45
-rw-r--r--libs/tgl/libevent/cmake/LibeventConfig.cmake.in17
-rw-r--r--libs/tgl/libevent/cmake/LibeventConfigBuildTree.cmake.in17
-rw-r--r--libs/tgl/libevent/cmake/LibeventConfigVersion.cmake.in11
-rw-r--r--libs/tgl/libevent/cmake/VersionViaGit.cmake53
-rw-r--r--libs/tgl/libevent/compat/sys/queue.h488
-rw-r--r--libs/tgl/libevent/configure.ac919
-rw-r--r--libs/tgl/libevent/defer-internal.h70
-rw-r--r--libs/tgl/libevent/devpoll.c311
-rw-r--r--libs/tgl/libevent/epoll.c540
-rw-r--r--libs/tgl/libevent/epoll_sub.c66
-rw-r--r--libs/tgl/libevent/epolltable-internal.h1166
-rw-r--r--libs/tgl/libevent/evbuffer-internal.h351
-rw-r--r--libs/tgl/libevent/evconfig-private.h.cmake35
-rw-r--r--libs/tgl/libevent/evconfig-private.h.in48
-rw-r--r--libs/tgl/libevent/evdns.3322
-rw-r--r--libs/tgl/libevent/evdns.c4761
-rw-r--r--libs/tgl/libevent/evdns.objbin0 -> 114563 bytes
-rw-r--r--libs/tgl/libevent/event-config.h.cmake534
-rw-r--r--libs/tgl/libevent/event-internal.h479
-rw-r--r--libs/tgl/libevent/event.3624
-rw-r--r--libs/tgl/libevent/event.c3940
-rw-r--r--libs/tgl/libevent/event.objbin0 -> 99401 bytes
-rw-r--r--libs/tgl/libevent/event_iocp.c294
-rw-r--r--libs/tgl/libevent/event_iocp.objbin0 -> 4531 bytes
-rw-r--r--libs/tgl/libevent/event_rpcgen.py1728
-rw-r--r--libs/tgl/libevent/event_tagging.c605
-rw-r--r--libs/tgl/libevent/event_tagging.objbin0 -> 7415 bytes
-rw-r--r--libs/tgl/libevent/evmap-internal.h117
-rw-r--r--libs/tgl/libevent/evmap.c1055
-rw-r--r--libs/tgl/libevent/evmap.objbin0 -> 29315 bytes
-rw-r--r--libs/tgl/libevent/evport.c451
-rw-r--r--libs/tgl/libevent/evrpc-internal.h205
-rw-r--r--libs/tgl/libevent/evrpc.c1171
-rw-r--r--libs/tgl/libevent/evrpc.objbin0 -> 26303 bytes
-rw-r--r--libs/tgl/libevent/evsignal-internal.h65
-rw-r--r--libs/tgl/libevent/evthread-internal.h392
-rw-r--r--libs/tgl/libevent/evthread.c509
-rw-r--r--libs/tgl/libevent/evthread.objbin0 -> 18993 bytes
-rw-r--r--libs/tgl/libevent/evthread_pthread.c191
-rw-r--r--libs/tgl/libevent/evthread_win32.c341
-rw-r--r--libs/tgl/libevent/evthread_win32.objbin0 -> 3376 bytes
-rw-r--r--libs/tgl/libevent/evutil.c2667
-rw-r--r--libs/tgl/libevent/evutil.objbin0 -> 35911 bytes
-rw-r--r--libs/tgl/libevent/evutil_rand.c206
-rw-r--r--libs/tgl/libevent/evutil_rand.objbin0 -> 5206 bytes
-rw-r--r--libs/tgl/libevent/evutil_time.c538
-rw-r--r--libs/tgl/libevent/evutil_time.objbin0 -> 3882 bytes
-rw-r--r--libs/tgl/libevent/ht-internal.h487
-rw-r--r--libs/tgl/libevent/http-internal.h200
-rw-r--r--libs/tgl/libevent/http.c4892
-rw-r--r--libs/tgl/libevent/http.objbin0 -> 79042 bytes
-rw-r--r--libs/tgl/libevent/include/evdns.h45
-rw-r--r--libs/tgl/libevent/include/event.h83
-rw-r--r--libs/tgl/libevent/include/event2/buffer.h1076
-rw-r--r--libs/tgl/libevent/include/event2/buffer_compat.h115
-rw-r--r--libs/tgl/libevent/include/event2/bufferevent.h1021
-rw-r--r--libs/tgl/libevent/include/event2/bufferevent_compat.h100
-rw-r--r--libs/tgl/libevent/include/event2/bufferevent_ssl.h134
-rw-r--r--libs/tgl/libevent/include/event2/bufferevent_struct.h116
-rw-r--r--libs/tgl/libevent/include/event2/dns.h717
-rw-r--r--libs/tgl/libevent/include/event2/dns_compat.h336
-rw-r--r--libs/tgl/libevent/include/event2/dns_struct.h80
-rw-r--r--libs/tgl/libevent/include/event2/event.h1675
-rw-r--r--libs/tgl/libevent/include/event2/event_compat.h230
-rw-r--r--libs/tgl/libevent/include/event2/event_struct.h180
-rw-r--r--libs/tgl/libevent/include/event2/http.h1170
-rw-r--r--libs/tgl/libevent/include/event2/http_compat.h90
-rw-r--r--libs/tgl/libevent/include/event2/http_struct.h152
-rw-r--r--libs/tgl/libevent/include/event2/keyvalq_struct.h80
-rw-r--r--libs/tgl/libevent/include/event2/listener.h180
-rw-r--r--libs/tgl/libevent/include/event2/rpc.h596
-rw-r--r--libs/tgl/libevent/include/event2/rpc_compat.h61
-rw-r--r--libs/tgl/libevent/include/event2/rpc_struct.h100
-rw-r--r--libs/tgl/libevent/include/event2/tag.h146
-rw-r--r--libs/tgl/libevent/include/event2/tag_compat.h49
-rw-r--r--libs/tgl/libevent/include/event2/thread.h253
-rw-r--r--libs/tgl/libevent/include/event2/util.h852
-rw-r--r--libs/tgl/libevent/include/event2/visibility.h50
-rw-r--r--libs/tgl/libevent/include/evhttp.h45
-rw-r--r--libs/tgl/libevent/include/evrpc.h45
-rw-r--r--libs/tgl/libevent/include/evutil.h39
-rw-r--r--libs/tgl/libevent/include/include.am46
-rw-r--r--libs/tgl/libevent/iocp-internal.h201
-rw-r--r--libs/tgl/libevent/ipv6-internal.h83
-rw-r--r--libs/tgl/libevent/kqueue-internal.h39
-rw-r--r--libs/tgl/libevent/kqueue.c567
-rw-r--r--libs/tgl/libevent/libevent.libbin0 -> 652848 bytes
-rw-r--r--libs/tgl/libevent/libevent.pc.in16
-rw-r--r--libs/tgl/libevent/libevent_core.libbin0 -> 412906 bytes
-rw-r--r--libs/tgl/libevent/libevent_extras.libbin0 -> 240764 bytes
-rw-r--r--libs/tgl/libevent/libevent_openssl.pc.in16
-rw-r--r--libs/tgl/libevent/libevent_pthreads.pc.in16
-rw-r--r--libs/tgl/libevent/listener.c889
-rw-r--r--libs/tgl/libevent/listener.objbin0 -> 12967 bytes
-rw-r--r--libs/tgl/libevent/log-internal.h83
-rw-r--r--libs/tgl/libevent/log.c253
-rw-r--r--libs/tgl/libevent/log.objbin0 -> 6459 bytes
-rw-r--r--libs/tgl/libevent/m4/ac_backport_259_ssizet.m43
-rw-r--r--libs/tgl/libevent/m4/acx_pthread.m4279
-rw-r--r--libs/tgl/libevent/m4/libevent_openssl.m447
-rw-r--r--libs/tgl/libevent/m4/ntp_pkg_config.m427
-rw-r--r--libs/tgl/libevent/make-event-config.sed23
-rw-r--r--libs/tgl/libevent/make_epoll_table.py63
-rw-r--r--libs/tgl/libevent/minheap-internal.h188
-rw-r--r--libs/tgl/libevent/mm-internal.h87
-rw-r--r--libs/tgl/libevent/poll.c341
-rw-r--r--libs/tgl/libevent/ratelim-internal.h105
-rw-r--r--libs/tgl/libevent/sample/dns-example.c257
-rw-r--r--libs/tgl/libevent/sample/event-read-fifo.c162
-rw-r--r--libs/tgl/libevent/sample/hello-world.c141
-rw-r--r--libs/tgl/libevent/sample/hostcheck.c217
-rw-r--r--libs/tgl/libevent/sample/hostcheck.h30
-rw-r--r--libs/tgl/libevent/sample/http-connect.c119
-rw-r--r--libs/tgl/libevent/sample/http-server.c418
-rw-r--r--libs/tgl/libevent/sample/https-client.c494
-rw-r--r--libs/tgl/libevent/sample/include.am53
-rw-r--r--libs/tgl/libevent/sample/le-proxy.c288
-rw-r--r--libs/tgl/libevent/sample/openssl_hostname_validation.c173
-rw-r--r--libs/tgl/libevent/sample/openssl_hostname_validation.h56
-rw-r--r--libs/tgl/libevent/sample/signal-test.c75
-rw-r--r--libs/tgl/libevent/sample/time-test.c107
-rw-r--r--libs/tgl/libevent/select.c346
-rw-r--r--libs/tgl/libevent/signal.c479
-rw-r--r--libs/tgl/libevent/signal.objbin0 -> 9157 bytes
-rw-r--r--libs/tgl/libevent/strlcpy-internal.h22
-rw-r--r--libs/tgl/libevent/strlcpy.c75
-rw-r--r--libs/tgl/libevent/strlcpy.objbin0 -> 677 bytes
-rw-r--r--libs/tgl/libevent/test/Makefile.nmake79
-rw-r--r--libs/tgl/libevent/test/bench.c207
-rw-r--r--libs/tgl/libevent/test/bench_cascade.c188
-rw-r--r--libs/tgl/libevent/test/bench_http.c195
-rw-r--r--libs/tgl/libevent/test/bench_httpclient.c239
-rw-r--r--libs/tgl/libevent/test/check-dumpevents.py54
-rw-r--r--libs/tgl/libevent/test/include.am146
-rw-r--r--libs/tgl/libevent/test/print-winsock-errors.c84
-rw-r--r--libs/tgl/libevent/test/print-winsock-errors.exebin0 -> 250368 bytes
-rw-r--r--libs/tgl/libevent/test/print-winsock-errors.objbin0 -> 6289 bytes
-rw-r--r--libs/tgl/libevent/test/regress.c3401
-rw-r--r--libs/tgl/libevent/test/regress.exebin0 -> 1094144 bytes
-rw-r--r--libs/tgl/libevent/test/regress.gen.c1
-rw-r--r--libs/tgl/libevent/test/regress.gen.h1
-rw-r--r--libs/tgl/libevent/test/regress.gen.objbin0 -> 411 bytes
-rw-r--r--libs/tgl/libevent/test/regress.h144
-rw-r--r--libs/tgl/libevent/test/regress.objbin0 -> 163578 bytes
-rw-r--r--libs/tgl/libevent/test/regress.rpc25
-rw-r--r--libs/tgl/libevent/test/regress_buffer.c2281
-rw-r--r--libs/tgl/libevent/test/regress_buffer.objbin0 -> 321947 bytes
-rw-r--r--libs/tgl/libevent/test/regress_bufferevent.c1284
-rw-r--r--libs/tgl/libevent/test/regress_bufferevent.objbin0 -> 66403 bytes
-rw-r--r--libs/tgl/libevent/test/regress_dns.c2151
-rw-r--r--libs/tgl/libevent/test/regress_dns.objbin0 -> 154118 bytes
-rw-r--r--libs/tgl/libevent/test/regress_et.c208
-rw-r--r--libs/tgl/libevent/test/regress_et.objbin0 -> 11988 bytes
-rw-r--r--libs/tgl/libevent/test/regress_finalize.c347
-rw-r--r--libs/tgl/libevent/test/regress_finalize.objbin0 -> 12620 bytes
-rw-r--r--libs/tgl/libevent/test/regress_http.c4335
-rw-r--r--libs/tgl/libevent/test/regress_http.objbin0 -> 458516 bytes
-rw-r--r--libs/tgl/libevent/test/regress_iocp.c352
-rw-r--r--libs/tgl/libevent/test/regress_iocp.objbin0 -> 34456 bytes
-rw-r--r--libs/tgl/libevent/test/regress_listener.c214
-rw-r--r--libs/tgl/libevent/test/regress_listener.objbin0 -> 13673 bytes
-rw-r--r--libs/tgl/libevent/test/regress_main.c468
-rw-r--r--libs/tgl/libevent/test/regress_main.objbin0 -> 9935 bytes
-rw-r--r--libs/tgl/libevent/test/regress_minheap.c99
-rw-r--r--libs/tgl/libevent/test/regress_minheap.objbin0 -> 7823 bytes
-rw-r--r--libs/tgl/libevent/test/regress_rpc.c905
-rw-r--r--libs/tgl/libevent/test/regress_rpc.objbin0 -> 1031 bytes
-rw-r--r--libs/tgl/libevent/test/regress_ssl.c781
-rw-r--r--libs/tgl/libevent/test/regress_testutils.c229
-rw-r--r--libs/tgl/libevent/test/regress_testutils.h67
-rw-r--r--libs/tgl/libevent/test/regress_testutils.objbin0 -> 9621 bytes
-rw-r--r--libs/tgl/libevent/test/regress_thread.c590
-rw-r--r--libs/tgl/libevent/test/regress_thread.h48
-rw-r--r--libs/tgl/libevent/test/regress_thread.objbin0 -> 20527 bytes
-rw-r--r--libs/tgl/libevent/test/regress_util.c1413
-rw-r--r--libs/tgl/libevent/test/regress_util.objbin0 -> 126463 bytes
-rw-r--r--libs/tgl/libevent/test/regress_zlib.c348
-rw-r--r--libs/tgl/libevent/test/rpcgen_wrapper.sh52
-rw-r--r--libs/tgl/libevent/test/test-changelist.c224
-rw-r--r--libs/tgl/libevent/test/test-changelist.exebin0 -> 248320 bytes
-rw-r--r--libs/tgl/libevent/test/test-changelist.objbin0 -> 4723 bytes
-rw-r--r--libs/tgl/libevent/test/test-closed.c117
-rw-r--r--libs/tgl/libevent/test/test-closed.exebin0 -> 247808 bytes
-rw-r--r--libs/tgl/libevent/test/test-closed.objbin0 -> 3077 bytes
-rw-r--r--libs/tgl/libevent/test/test-dumpevents.c179
-rw-r--r--libs/tgl/libevent/test/test-eof.c124
-rw-r--r--libs/tgl/libevent/test/test-eof.exebin0 -> 247808 bytes
-rw-r--r--libs/tgl/libevent/test/test-eof.objbin0 -> 3282 bytes
-rw-r--r--libs/tgl/libevent/test/test-fdleak.c249
-rw-r--r--libs/tgl/libevent/test/test-init.c65
-rw-r--r--libs/tgl/libevent/test/test-init.exebin0 -> 247296 bytes
-rw-r--r--libs/tgl/libevent/test/test-init.objbin0 -> 906 bytes
-rw-r--r--libs/tgl/libevent/test/test-ratelim.c601
-rw-r--r--libs/tgl/libevent/test/test-ratelim.sh88
-rw-r--r--libs/tgl/libevent/test/test-time.c116
-rw-r--r--libs/tgl/libevent/test/test-time.exebin0 -> 247808 bytes
-rw-r--r--libs/tgl/libevent/test/test-time.objbin0 -> 3031 bytes
-rw-r--r--libs/tgl/libevent/test/test-weof.c117
-rw-r--r--libs/tgl/libevent/test/test-weof.exebin0 -> 247808 bytes
-rw-r--r--libs/tgl/libevent/test/test-weof.objbin0 -> 2971 bytes
-rw-r--r--libs/tgl/libevent/test/test.sh160
-rw-r--r--libs/tgl/libevent/test/tinytest.c493
-rw-r--r--libs/tgl/libevent/test/tinytest.h100
-rw-r--r--libs/tgl/libevent/test/tinytest.objbin0 -> 10330 bytes
-rw-r--r--libs/tgl/libevent/test/tinytest_demo.c262
-rw-r--r--libs/tgl/libevent/test/tinytest_local.h12
-rw-r--r--libs/tgl/libevent/test/tinytest_macros.h199
-rw-r--r--libs/tgl/libevent/time-internal.h98
-rw-r--r--libs/tgl/libevent/util-internal.h479
-rw-r--r--libs/tgl/libevent/whatsnew-2.0.txt609
-rw-r--r--libs/tgl/libevent/whatsnew-2.1.txt690
-rw-r--r--libs/tgl/libevent/win32select.c388
-rw-r--r--libs/tgl/libevent/win32select.objbin0 -> 6923 bytes
-rw-r--r--libs/tgl/openssl/include/openssl/aes.h149
-rw-r--r--libs/tgl/openssl/include/openssl/applink.c129
-rw-r--r--libs/tgl/openssl/include/openssl/asn1.h1419
-rw-r--r--libs/tgl/openssl/include/openssl/asn1_mac.h579
-rw-r--r--libs/tgl/openssl/include/openssl/asn1t.h973
-rw-r--r--libs/tgl/openssl/include/openssl/bio.h883
-rw-r--r--libs/tgl/openssl/include/openssl/blowfish.h130
-rw-r--r--libs/tgl/openssl/include/openssl/bn.h939
-rw-r--r--libs/tgl/openssl/include/openssl/buffer.h125
-rw-r--r--libs/tgl/openssl/include/openssl/camellia.h132
-rw-r--r--libs/tgl/openssl/include/openssl/cast.h107
-rw-r--r--libs/tgl/openssl/include/openssl/cmac.h82
-rw-r--r--libs/tgl/openssl/include/openssl/cms.h555
-rw-r--r--libs/tgl/openssl/include/openssl/comp.h79
-rw-r--r--libs/tgl/openssl/include/openssl/conf.h267
-rw-r--r--libs/tgl/openssl/include/openssl/conf_api.h89
-rw-r--r--libs/tgl/openssl/include/openssl/crypto.h661
-rw-r--r--libs/tgl/openssl/include/openssl/des.h257
-rw-r--r--libs/tgl/openssl/include/openssl/des_old.h497
-rw-r--r--libs/tgl/openssl/include/openssl/dh.h393
-rw-r--r--libs/tgl/openssl/include/openssl/dsa.h332
-rw-r--r--libs/tgl/openssl/include/openssl/dso.h451
-rw-r--r--libs/tgl/openssl/include/openssl/dtls1.h272
-rw-r--r--libs/tgl/openssl/include/openssl/e_os2.h328
-rw-r--r--libs/tgl/openssl/include/openssl/ebcdic.h26
-rw-r--r--libs/tgl/openssl/include/openssl/ec.h1282
-rw-r--r--libs/tgl/openssl/include/openssl/ecdh.h134
-rw-r--r--libs/tgl/openssl/include/openssl/ecdsa.h335
-rw-r--r--libs/tgl/openssl/include/openssl/engine.h960
-rw-r--r--libs/tgl/openssl/include/openssl/err.h389
-rw-r--r--libs/tgl/openssl/include/openssl/evp.h1534
-rw-r--r--libs/tgl/openssl/include/openssl/hmac.h109
-rw-r--r--libs/tgl/openssl/include/openssl/idea.h105
-rw-r--r--libs/tgl/openssl/include/openssl/krb5_asn.h240
-rw-r--r--libs/tgl/openssl/include/openssl/kssl.h197
-rw-r--r--libs/tgl/openssl/include/openssl/lhash.h240
-rw-r--r--libs/tgl/openssl/include/openssl/md4.h119
-rw-r--r--libs/tgl/openssl/include/openssl/md5.h119
-rw-r--r--libs/tgl/openssl/include/openssl/mdc2.h94
-rw-r--r--libs/tgl/openssl/include/openssl/modes.h163
-rw-r--r--libs/tgl/openssl/include/openssl/obj_mac.h4194
-rw-r--r--libs/tgl/openssl/include/openssl/objects.h1143
-rw-r--r--libs/tgl/openssl/include/openssl/ocsp.h637
-rw-r--r--libs/tgl/openssl/include/openssl/opensslconf.h260
-rw-r--r--libs/tgl/openssl/include/openssl/opensslv.h97
-rw-r--r--libs/tgl/openssl/include/openssl/ossl_typ.h211
-rw-r--r--libs/tgl/openssl/include/openssl/pem.h615
-rw-r--r--libs/tgl/openssl/include/openssl/pem2.h70
-rw-r--r--libs/tgl/openssl/include/openssl/pkcs12.h342
-rw-r--r--libs/tgl/openssl/include/openssl/pkcs7.h481
-rw-r--r--libs/tgl/openssl/include/openssl/pqueue.h99
-rw-r--r--libs/tgl/openssl/include/openssl/rand.h150
-rw-r--r--libs/tgl/openssl/include/openssl/rc2.h103
-rw-r--r--libs/tgl/openssl/include/openssl/rc4.h88
-rw-r--r--libs/tgl/openssl/include/openssl/ripemd.h105
-rw-r--r--libs/tgl/openssl/include/openssl/rsa.h664
-rw-r--r--libs/tgl/openssl/include/openssl/safestack.h2672
-rw-r--r--libs/tgl/openssl/include/openssl/seed.h149
-rw-r--r--libs/tgl/openssl/include/openssl/sha.h214
-rw-r--r--libs/tgl/openssl/include/openssl/srp.h169
-rw-r--r--libs/tgl/openssl/include/openssl/srtp.h147
-rw-r--r--libs/tgl/openssl/include/openssl/ssl.h3170
-rw-r--r--libs/tgl/openssl/include/openssl/ssl2.h265
-rw-r--r--libs/tgl/openssl/include/openssl/ssl23.h84
-rw-r--r--libs/tgl/openssl/include/openssl/ssl3.h774
-rw-r--r--libs/tgl/openssl/include/openssl/stack.h107
-rw-r--r--libs/tgl/openssl/include/openssl/symhacks.h516
-rw-r--r--libs/tgl/openssl/include/openssl/tls1.h810
-rw-r--r--libs/tgl/openssl/include/openssl/ts.h862
-rw-r--r--libs/tgl/openssl/include/openssl/txt_db.h112
-rw-r--r--libs/tgl/openssl/include/openssl/ui.h415
-rw-r--r--libs/tgl/openssl/include/openssl/ui_compat.h88
-rw-r--r--libs/tgl/openssl/include/openssl/whrlpool.h41
-rw-r--r--libs/tgl/openssl/include/openssl/x509.h1327
-rw-r--r--libs/tgl/openssl/include/openssl/x509_vfy.h647
-rw-r--r--libs/tgl/openssl/include/openssl/x509v3.h1055
-rw-r--r--libs/tgl/openssl/lib/x64/Debug/2010/libeay32MTd.libbin0 -> 14393044 bytes
-rw-r--r--libs/tgl/openssl/lib/x64/Debug/2010/ssleay32MTd.libbin0 -> 2315004 bytes
-rw-r--r--libs/tgl/openssl/lib/x64/Debug/2013/libeay32MTd.libbin0 -> 15009124 bytes
-rw-r--r--libs/tgl/openssl/lib/x64/Debug/2013/ssleay32MTd.libbin0 -> 2417148 bytes
-rw-r--r--libs/tgl/openssl/lib/x64/Debug/2015/libeay32MTd.libbin0 -> 11057466 bytes
-rw-r--r--libs/tgl/openssl/lib/x64/Debug/2015/ssleay32MTd.libbin0 -> 1920160 bytes
-rw-r--r--libs/tgl/openssl/lib/x64/Release/2010/libeay32MT.libbin0 -> 14243426 bytes
-rw-r--r--libs/tgl/openssl/lib/x64/Release/2010/ssleay32MT.libbin0 -> 2200852 bytes
-rw-r--r--libs/tgl/openssl/lib/x64/Release/2013/libeay32MT.libbin0 -> 14884682 bytes
-rw-r--r--libs/tgl/openssl/lib/x64/Release/2013/ssleay32MT.libbin0 -> 2300704 bytes
-rw-r--r--libs/tgl/openssl/lib/x64/Release/2015/libeay32MT.libbin0 -> 13023972 bytes
-rw-r--r--libs/tgl/openssl/lib/x64/Release/2015/ssleay32MT.libbin0 -> 2158154 bytes
-rw-r--r--libs/tgl/openssl/lib/x86/Debug/2010/libeay32MTd.libbin0 -> 13247236 bytes
-rw-r--r--libs/tgl/openssl/lib/x86/Debug/2010/ssleay32MTd.libbin0 -> 2277266 bytes
-rw-r--r--libs/tgl/openssl/lib/x86/Debug/2013/libeay32MTd.libbin0 -> 14001232 bytes
-rw-r--r--libs/tgl/openssl/lib/x86/Debug/2013/ssleay32MTd.libbin0 -> 2389910 bytes
-rw-r--r--libs/tgl/openssl/lib/x86/Debug/2015/libeay32MTd.libbin0 -> 10023312 bytes
-rw-r--r--libs/tgl/openssl/lib/x86/Debug/2015/ssleay32MTd.libbin0 -> 1890680 bytes
-rw-r--r--libs/tgl/openssl/lib/x86/Release/2010/libeay32MT.libbin0 -> 13332156 bytes
-rw-r--r--libs/tgl/openssl/lib/x86/Release/2010/ssleay32MT.libbin0 -> 2246932 bytes
-rw-r--r--libs/tgl/openssl/lib/x86/Release/2013/libeay32MT.libbin0 -> 13980614 bytes
-rw-r--r--libs/tgl/openssl/lib/x86/Release/2013/ssleay32MT.libbin0 -> 2330782 bytes
-rw-r--r--libs/tgl/openssl/lib/x86/Release/2015/libeay32MT.libbin0 -> 12203448 bytes
-rw-r--r--libs/tgl/openssl/lib/x86/Release/2015/ssleay32MT.libbin0 -> 2202748 bytes
-rw-r--r--libs/tgl/src/auto-static-autocomplete.c63
-rw-r--r--libs/tgl/src/auto-static-fetch-ds.c0
-rw-r--r--libs/tgl/src/auto-static-fetch.c106
-rw-r--r--libs/tgl/src/auto-static-free-ds.c0
-rw-r--r--libs/tgl/src/auto-static-print-ds.c106
-rw-r--r--libs/tgl/src/auto-static-print.c461
-rw-r--r--libs/tgl/src/auto-static-skip.c0
-rw-r--r--libs/tgl/src/auto-static-store-ds.c0
-rw-r--r--libs/tgl/src/auto-static-store.c262
-rw-r--r--libs/tgl/src/auto-static.c328
-rw-r--r--libs/tgl/src/auto.h62
-rw-r--r--libs/tgl/src/auto/auto-autocomplete.c29968
-rw-r--r--libs/tgl/src/auto/auto-autocomplete.h865
-rw-r--r--libs/tgl/src/auto/auto-fetch-ds.c11877
-rw-r--r--libs/tgl/src/auto/auto-fetch-ds.h716
-rw-r--r--libs/tgl/src/auto/auto-fetch.c16330
-rw-r--r--libs/tgl/src/auto/auto-fetch.h717
-rw-r--r--libs/tgl/src/auto/auto-free-ds.c9116
-rw-r--r--libs/tgl/src/auto/auto-free-ds.h569
-rw-r--r--libs/tgl/src/auto/auto-print-ds.c16382
-rw-r--r--libs/tgl/src/auto/auto-print-ds.h719
-rw-r--r--libs/tgl/src/auto/auto-skip.c11302
-rw-r--r--libs/tgl/src/auto/auto-skip.h714
-rw-r--r--libs/tgl/src/auto/auto-store-ds.c10208
-rw-r--r--libs/tgl/src/auto/auto-store-ds.h718
-rw-r--r--libs/tgl/src/auto/auto-store.c24400
-rw-r--r--libs/tgl/src/auto/auto-store.h848
-rw-r--r--libs/tgl/src/auto/auto-types.c1793
-rw-r--r--libs/tgl/src/auto/auto-types.h1589
-rw-r--r--libs/tgl/src/auto/constants.h561
-rw-r--r--libs/tgl/src/auto/scheme.tl829
-rw-r--r--libs/tgl/src/auto/scheme.tlobin0 -> 85572 bytes
-rw-r--r--libs/tgl/src/auto/scheme2.tl540
-rw-r--r--libs/tgl/src/binlog.c1830
-rw-r--r--libs/tgl/src/binlog.tl102
-rw-r--r--libs/tgl/src/config.h162
-rw-r--r--libs/tgl/src/encrypted_scheme.tl1
-rw-r--r--libs/tgl/src/encrypted_scheme16.tl22
-rw-r--r--libs/tgl/src/encrypted_scheme17.tl31
-rw-r--r--libs/tgl/src/encrypted_scheme18.tl38
-rw-r--r--libs/tgl/src/encrypted_scheme23.tl29
-rw-r--r--libs/tgl/src/errors11
-rw-r--r--libs/tgl/src/event-old.h48
-rw-r--r--libs/tgl/src/generate.c3219
-rw-r--r--libs/tgl/src/generate.h173
-rw-r--r--libs/tgl/src/mime-types.c4421
-rw-r--r--libs/tgl/src/mtproto-client.c1489
-rw-r--r--libs/tgl/src/mtproto-client.h61
-rw-r--r--libs/tgl/src/mtproto-common.c475
-rw-r--r--libs/tgl/src/mtproto-common.h385
-rw-r--r--libs/tgl/src/mtproto-utils.c178
-rw-r--r--libs/tgl/src/mtproto-utils.h7
-rw-r--r--libs/tgl/src/mtproto.tl19
-rw-r--r--libs/tgl/src/no-preview.h106
-rw-r--r--libs/tgl/src/queries-encrypted.c758
-rw-r--r--libs/tgl/src/queries.c4477
-rw-r--r--libs/tgl/src/queries.h84
-rw-r--r--libs/tgl/src/scheme.tl1
-rw-r--r--libs/tgl/src/scheme12.tl505
-rw-r--r--libs/tgl/src/scheme15.tl522
-rw-r--r--libs/tgl/src/scheme16.tl504
-rw-r--r--libs/tgl/src/scheme17.tl528
-rw-r--r--libs/tgl/src/scheme18.tl535
-rw-r--r--libs/tgl/src/scheme19.tl596
-rw-r--r--libs/tgl/src/scheme22.tl596
-rw-r--r--libs/tgl/src/scheme25.tl622
-rw-r--r--libs/tgl/src/scheme28.tl641
-rw-r--r--libs/tgl/src/scheme30.tl656
-rw-r--r--libs/tgl/src/scheme31.tl668
-rw-r--r--libs/tgl/src/structures.c2311
-rw-r--r--libs/tgl/src/tg-mime-types.c112
-rw-r--r--libs/tgl/src/tg-mime-types.h3
-rw-r--r--libs/tgl/src/tgl-binlog.h73
-rw-r--r--libs/tgl/src/tgl-fetch.h59
-rw-r--r--libs/tgl/src/tgl-inner.h33
-rw-r--r--libs/tgl/src/tgl-layout.h539
-rw-r--r--libs/tgl/src/tgl-methods-in.h50
-rw-r--r--libs/tgl/src/tgl-net-inner.h93
-rw-r--r--libs/tgl/src/tgl-net.c674
-rw-r--r--libs/tgl/src/tgl-net.h24
-rw-r--r--libs/tgl/src/tgl-structures.h69
-rw-r--r--libs/tgl/src/tgl-timers.c69
-rw-r--r--libs/tgl/src/tgl-timers.h27
-rw-r--r--libs/tgl/src/tgl.c149
-rw-r--r--libs/tgl/src/tgl.h659
-rw-r--r--libs/tgl/src/tools.c406
-rw-r--r--libs/tgl/src/tools.h142
-rw-r--r--libs/tgl/src/tree.h179
-rw-r--r--libs/tgl/src/updates.c668
-rw-r--r--libs/tgl/src/updates.h34
-rw-r--r--libs/tgl/src/wingetopt.c82
-rw-r--r--libs/tgl/src/wingetopt.h32
-rw-r--r--libs/tgl/tgl.vcxproj.filters153
-rw-r--r--libs/tgl/tgl_12.vcxproj192
-rw-r--r--libs/tgl/tl-parser/docs/LICENSE339
-rw-r--r--libs/tgl/tl-parser/docs/Makefile.in48
-rw-r--r--libs/tgl/tl-parser/docs/README.md1
-rw-r--r--libs/tgl/tl-parser/docs/config.bat107
-rw-r--r--libs/tgl/tl-parser/docs/config.h.in96
-rw-r--r--libs/tgl/tl-parser/docs/configure5018
-rw-r--r--libs/tgl/tl-parser/docs/configure.ac33
-rw-r--r--libs/tgl/tl-parser/docs/m4-ax_gcc_builtin.m4168
-rw-r--r--libs/tgl/tl-parser/src/config.h96
-rw-r--r--libs/tgl/tl-parser/src/portable_endian.h124
-rw-r--r--libs/tgl/tl-parser/src/tl-parser-tree.h178
-rw-r--r--libs/tgl/tl-parser/src/tl-parser.c3112
-rw-r--r--libs/tgl/tl-parser/src/tl-parser.h221
-rw-r--r--libs/tgl/tl-parser/src/tl-tl.h55
-rw-r--r--libs/tgl/tl-parser/src/tlc.c180
-rw-r--r--libs/tgl/tl-parser/src/wingetopt.c82
-rw-r--r--libs/tgl/tl-parser/src/wingetopt.h32
-rw-r--r--libs/tgl/tl-parser/tl-parser.vcxproj.filters48
-rw-r--r--libs/tgl/tl-parser/tl-parser_12.vcxproj150
494 files changed, 323804 insertions, 0 deletions
diff --git a/libs/tgl/docs/CHANGELOG b/libs/tgl/docs/CHANGELOG
new file mode 100644
index 0000000000..776a1f3037
--- /dev/null
+++ b/libs/tgl/docs/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/libs/tgl/docs/LICENSE b/libs/tgl/docs/LICENSE
new file mode 100644
index 0000000000..3c12ac3bef
--- /dev/null
+++ b/libs/tgl/docs/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/libs/tgl/docs/Makefile.in b/libs/tgl/docs/Makefile.in
new file mode 100644
index 0000000000..36c6d7ac83
--- /dev/null
+++ b/libs/tgl/docs/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/libs/tgl/docs/Makefile.tl-parser b/libs/tgl/docs/Makefile.tl-parser
new file mode 100644
index 0000000000..9600514661
--- /dev/null
+++ b/libs/tgl/docs/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/libs/tgl/docs/README.md b/libs/tgl/docs/README.md
new file mode 100644
index 0000000000..e9cb491af3
--- /dev/null
+++ b/libs/tgl/docs/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/libs/tgl/docs/config.bat b/libs/tgl/docs/config.bat
new file mode 100644
index 0000000000..7f18e916c5
--- /dev/null
+++ b/libs/tgl/docs/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
+::#################################################################################################################################################
+
+: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
+
+
+: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%
+
+: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/libs/tgl/docs/config.h.in b/libs/tgl/docs/config.h.in
new file mode 100644
index 0000000000..1fcf6c723f
--- /dev/null
+++ b/libs/tgl/docs/config.h.in
@@ -0,0 +1,162 @@
+/* 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 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/libs/tgl/docs/configure b/libs/tgl/docs/configure
new file mode 100644
index 0000000000..85b2f872e2
--- /dev/null
+++ b/libs/tgl/docs/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/libs/tgl/docs/configure.ac b/libs/tgl/docs/configure.ac
new file mode 100644
index 0000000000..ea935a58ac
--- /dev/null
+++ b/libs/tgl/docs/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/libs/tgl/docs/gen_constants_h.awk b/libs/tgl/docs/gen_constants_h.awk
new file mode 100644
index 0000000000..74d20a70e2
--- /dev/null
+++ b/libs/tgl/docs/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/libs/tgl/docs/m4-ax_gcc_builtin.m4 b/libs/tgl/docs/m4-ax_gcc_builtin.m4
new file mode 100644
index 0000000000..b28a91b14a
--- /dev/null
+++ b/libs/tgl/docs/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/libs/tgl/docs/m4_ax_check_openssl.m4 b/libs/tgl/docs/m4_ax_check_openssl.m4
new file mode 100644
index 0000000000..a87c5a6b6f
--- /dev/null
+++ b/libs/tgl/docs/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/libs/tgl/docs/m4_ax_check_zlib.m4 b/libs/tgl/docs/m4_ax_check_zlib.m4
new file mode 100644
index 0000000000..ae5705f624
--- /dev/null
+++ b/libs/tgl/docs/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/libs/tgl/docs/mime.types b/libs/tgl/docs/mime.types
new file mode 100644
index 0000000000..da8cd69187
--- /dev/null
+++ b/libs/tgl/docs/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/libs/tgl/generate.vcxproj.filters b/libs/tgl/generate.vcxproj.filters
new file mode 100644
index 0000000000..d0100c59d2
--- /dev/null
+++ b/libs/tgl/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="src\wingetopt.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\generate.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\tools.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="src\wingetopt.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\generate.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\tools.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/libs/tgl/generate_12.vcxproj b/libs/tgl/generate_12.vcxproj
new file mode 100644
index 0000000000..99a488007d
--- /dev/null
+++ b/libs/tgl/generate_12.vcxproj
@@ -0,0 +1,155 @@
+<?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>
+ <ProjectName>generate</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </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>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\bin\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)64\bin\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\Obj\$(ProjectName)\</IntDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\bin\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64\bin\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\Obj\$(ProjectName)\</IntDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\</IntDir>
+ <IgnoreImportLibrary>true</IgnoreImportLibrary>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>HAVE_CONFIG_H;_CONSOLE;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>openssl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalLibraryDirectories>openssl\lib\x86\Debug\2013;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalDependencies>libeay32MTd.lib;ssleay32MTd.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <SubSystem>Console</SubSystem>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>HAVE_CONFIG_H;_CONSOLE;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>openssl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalLibraryDirectories>openssl\lib\x64\Debug\2013;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalDependencies>libeay32MTd.lib;ssleay32MTd.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <SubSystem>Console</SubSystem>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Full</Optimization>
+ <PreprocessorDefinitions>HAVE_CONFIG_H;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>openssl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalLibraryDirectories>openssl\lib\x86\Release\2013;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalDependencies>libeay32MT.lib;ssleay32MT.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <SubSystem>Console</SubSystem>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Full</Optimization>
+ <PreprocessorDefinitions>HAVE_CONFIG_H;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>openssl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalLibraryDirectories>openssl\lib\x64\Release\2013;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalDependencies>libeay32MT.lib;ssleay32MT.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <SubSystem>Console</SubSystem>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="src\generate.h" />
+ <ClInclude Include="src\tools.h" />
+ <ClInclude Include="src\wingetopt.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="src\generate.c" />
+ <ClCompile Include="src\tools.c" />
+ <ClCompile Include="src\wingetopt.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\zlib\zlib.vcxproj">
+ <Project>{e2a369cd-eda3-414f-8ad0-e732cd7ee68c}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/libs/tgl/libevent/.gitignore b/libs/tgl/libevent/.gitignore
new file mode 100644
index 0000000000..01821fe1c5
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/.travis.yml b/libs/tgl/libevent/.travis.yml
new file mode 100644
index 0000000000..f1d8141f5a
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/CMakeLists.txt b/libs/tgl/libevent/CMakeLists.txt
new file mode 100644
index 0000000000..708f8a1bfa
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/ChangeLog b/libs/tgl/libevent/ChangeLog
new file mode 100644
index 0000000000..1499637504
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/ChangeLog-1.4 b/libs/tgl/libevent/ChangeLog-1.4
new file mode 100644
index 0000000000..166d30872f
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/ChangeLog-2.0 b/libs/tgl/libevent/ChangeLog-2.0
new file mode 100644
index 0000000000..a925d33b18
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/Doxyfile b/libs/tgl/libevent/Doxyfile
new file mode 100644
index 0000000000..d9d6603459
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/LICENSE b/libs/tgl/libevent/LICENSE
new file mode 100644
index 0000000000..402ca50896
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/Makefile.am b/libs/tgl/libevent/Makefile.am
new file mode 100644
index 0000000000..3053cc016a
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/Makefile.nmake b/libs/tgl/libevent/Makefile.nmake
new file mode 100644
index 0000000000..f27cd61949
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/README.md b/libs/tgl/libevent/README.md
new file mode 100644
index 0000000000..fdd777ee8d
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/WIN32-Code/getopt.c b/libs/tgl/libevent/WIN32-Code/getopt.c
new file mode 100644
index 0000000000..0fcba5d915
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/WIN32-Code/getopt.h b/libs/tgl/libevent/WIN32-Code/getopt.h
new file mode 100644
index 0000000000..796f455050
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/WIN32-Code/getopt_long.c b/libs/tgl/libevent/WIN32-Code/getopt_long.c
new file mode 100644
index 0000000000..03f0c01a15
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/WIN32-Code/nmake/evconfig-private.h b/libs/tgl/libevent/WIN32-Code/nmake/evconfig-private.h
new file mode 100644
index 0000000000..88e206272b
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/WIN32-Code/nmake/event2/event-config.h b/libs/tgl/libevent/WIN32-Code/nmake/event2/event-config.h
new file mode 100644
index 0000000000..8cbf190289
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/WIN32-Code/tree.h b/libs/tgl/libevent/WIN32-Code/tree.h
new file mode 100644
index 0000000000..2ccfbf20ac
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/appveyor.yml b/libs/tgl/libevent/appveyor.yml
new file mode 100644
index 0000000000..f9af62d2db
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/arc4random.c b/libs/tgl/libevent/arc4random.c
new file mode 100644
index 0000000000..a2338e692a
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/autogen.sh b/libs/tgl/libevent/autogen.sh
new file mode 100644
index 0000000000..57eeb940b9
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/buffer.c b/libs/tgl/libevent/buffer.c
new file mode 100644
index 0000000000..7cca0e8a7d
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/buffer.obj b/libs/tgl/libevent/buffer.obj
new file mode 100644
index 0000000000..231994448e
--- /dev/null
+++ b/libs/tgl/libevent/buffer.obj
Binary files differ
diff --git a/libs/tgl/libevent/buffer_iocp.c b/libs/tgl/libevent/buffer_iocp.c
new file mode 100644
index 0000000000..2d76a90e77
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/buffer_iocp.obj b/libs/tgl/libevent/buffer_iocp.obj
new file mode 100644
index 0000000000..0fe943a60a
--- /dev/null
+++ b/libs/tgl/libevent/buffer_iocp.obj
Binary files differ
diff --git a/libs/tgl/libevent/bufferevent-internal.h b/libs/tgl/libevent/bufferevent-internal.h
new file mode 100644
index 0000000000..d9d9e66640
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/bufferevent.c b/libs/tgl/libevent/bufferevent.c
new file mode 100644
index 0000000000..59ae24f143
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/bufferevent.obj b/libs/tgl/libevent/bufferevent.obj
new file mode 100644
index 0000000000..ae232c3748
--- /dev/null
+++ b/libs/tgl/libevent/bufferevent.obj
Binary files differ
diff --git a/libs/tgl/libevent/bufferevent_async.c b/libs/tgl/libevent/bufferevent_async.c
new file mode 100644
index 0000000000..6395e57a9f
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/bufferevent_async.obj b/libs/tgl/libevent/bufferevent_async.obj
new file mode 100644
index 0000000000..2318267d42
--- /dev/null
+++ b/libs/tgl/libevent/bufferevent_async.obj
Binary files differ
diff --git a/libs/tgl/libevent/bufferevent_filter.c b/libs/tgl/libevent/bufferevent_filter.c
new file mode 100644
index 0000000000..6c3ffc4f2d
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/bufferevent_filter.obj b/libs/tgl/libevent/bufferevent_filter.obj
new file mode 100644
index 0000000000..b9e202e3cf
--- /dev/null
+++ b/libs/tgl/libevent/bufferevent_filter.obj
Binary files differ
diff --git a/libs/tgl/libevent/bufferevent_openssl.c b/libs/tgl/libevent/bufferevent_openssl.c
new file mode 100644
index 0000000000..37478b6a83
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/bufferevent_pair.c b/libs/tgl/libevent/bufferevent_pair.c
new file mode 100644
index 0000000000..d80e5f81d6
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/bufferevent_pair.obj b/libs/tgl/libevent/bufferevent_pair.obj
new file mode 100644
index 0000000000..99d0ab332c
--- /dev/null
+++ b/libs/tgl/libevent/bufferevent_pair.obj
Binary files differ
diff --git a/libs/tgl/libevent/bufferevent_ratelim.c b/libs/tgl/libevent/bufferevent_ratelim.c
new file mode 100644
index 0000000000..bde192021b
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/bufferevent_ratelim.obj b/libs/tgl/libevent/bufferevent_ratelim.obj
new file mode 100644
index 0000000000..1e481e49f1
--- /dev/null
+++ b/libs/tgl/libevent/bufferevent_ratelim.obj
Binary files differ
diff --git a/libs/tgl/libevent/bufferevent_sock.c b/libs/tgl/libevent/bufferevent_sock.c
new file mode 100644
index 0000000000..a2b381ac4d
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/bufferevent_sock.obj b/libs/tgl/libevent/bufferevent_sock.obj
new file mode 100644
index 0000000000..f7d3083037
--- /dev/null
+++ b/libs/tgl/libevent/bufferevent_sock.obj
Binary files differ
diff --git a/libs/tgl/libevent/changelist-internal.h b/libs/tgl/libevent/changelist-internal.h
new file mode 100644
index 0000000000..98fc52aebf
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/cmake/AddCompilerFlags.cmake b/libs/tgl/libevent/cmake/AddCompilerFlags.cmake
new file mode 100644
index 0000000000..c7da188b7a
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/cmake/COPYING-CMAKE-SCRIPTS b/libs/tgl/libevent/cmake/COPYING-CMAKE-SCRIPTS
new file mode 100644
index 0000000000..ab3c4d25d1
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/cmake/CheckFileOffsetBits.c b/libs/tgl/libevent/cmake/CheckFileOffsetBits.c
new file mode 100644
index 0000000000..d948fecf2b
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/cmake/CheckFileOffsetBits.cmake b/libs/tgl/libevent/cmake/CheckFileOffsetBits.cmake
new file mode 100644
index 0000000000..1253440160
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/cmake/CheckFunctionExistsEx.c b/libs/tgl/libevent/cmake/CheckFunctionExistsEx.c
new file mode 100644
index 0000000000..5ee3e5913a
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/cmake/CheckFunctionExistsEx.cmake b/libs/tgl/libevent/cmake/CheckFunctionExistsEx.cmake
new file mode 100644
index 0000000000..f513f4e108
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/cmake/CheckFunctionKeywords.cmake b/libs/tgl/libevent/cmake/CheckFunctionKeywords.cmake
new file mode 100644
index 0000000000..3d968b8a6b
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/cmake/CheckPrototypeDefinition.c.in b/libs/tgl/libevent/cmake/CheckPrototypeDefinition.c.in
new file mode 100644
index 0000000000..a97344ac3e
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/cmake/CheckPrototypeDefinition.cmake b/libs/tgl/libevent/cmake/CheckPrototypeDefinition.cmake
new file mode 100644
index 0000000000..e0c6a572c0
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/cmake/CheckWorkingKqueue.cmake b/libs/tgl/libevent/cmake/CheckWorkingKqueue.cmake
new file mode 100644
index 0000000000..47bf4e838a
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/cmake/CodeCoverage.cmake b/libs/tgl/libevent/cmake/CodeCoverage.cmake
new file mode 100644
index 0000000000..969f273253
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/cmake/Copyright.txt b/libs/tgl/libevent/cmake/Copyright.txt
new file mode 100644
index 0000000000..813124f02e
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/cmake/FindGit.cmake b/libs/tgl/libevent/cmake/FindGit.cmake
new file mode 100644
index 0000000000..2abbfe4e9d
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/cmake/LibeventConfig.cmake.in b/libs/tgl/libevent/cmake/LibeventConfig.cmake.in
new file mode 100644
index 0000000000..b28cacb5fb
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/cmake/LibeventConfigBuildTree.cmake.in b/libs/tgl/libevent/cmake/LibeventConfigBuildTree.cmake.in
new file mode 100644
index 0000000000..02edef32fc
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/cmake/LibeventConfigVersion.cmake.in b/libs/tgl/libevent/cmake/LibeventConfigVersion.cmake.in
new file mode 100644
index 0000000000..56371a8fee
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/cmake/VersionViaGit.cmake b/libs/tgl/libevent/cmake/VersionViaGit.cmake
new file mode 100644
index 0000000000..f183a64713
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/compat/sys/queue.h b/libs/tgl/libevent/compat/sys/queue.h
new file mode 100644
index 0000000000..c387bdcf50
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/configure.ac b/libs/tgl/libevent/configure.ac
new file mode 100644
index 0000000000..6a669fb701
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/defer-internal.h b/libs/tgl/libevent/defer-internal.h
new file mode 100644
index 0000000000..e3c7d7da5b
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/devpoll.c b/libs/tgl/libevent/devpoll.c
new file mode 100644
index 0000000000..3a2f86d6f1
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/epoll.c b/libs/tgl/libevent/epoll.c
new file mode 100644
index 0000000000..bf730b23db
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/epoll_sub.c b/libs/tgl/libevent/epoll_sub.c
new file mode 100644
index 0000000000..3f01f6a699
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/epolltable-internal.h b/libs/tgl/libevent/epolltable-internal.h
new file mode 100644
index 0000000000..da30e0973a
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/evbuffer-internal.h b/libs/tgl/libevent/evbuffer-internal.h
new file mode 100644
index 0000000000..cf4bddc80e
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/evconfig-private.h.cmake b/libs/tgl/libevent/evconfig-private.h.cmake
new file mode 100644
index 0000000000..32f04794d2
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/evconfig-private.h.in b/libs/tgl/libevent/evconfig-private.h.in
new file mode 100644
index 0000000000..7b3dfdb10e
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/evdns.3 b/libs/tgl/libevent/evdns.3
new file mode 100644
index 0000000000..10414fa2ef
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/evdns.c b/libs/tgl/libevent/evdns.c
new file mode 100644
index 0000000000..c4112330a9
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/evdns.obj b/libs/tgl/libevent/evdns.obj
new file mode 100644
index 0000000000..354cf6a3da
--- /dev/null
+++ b/libs/tgl/libevent/evdns.obj
Binary files differ
diff --git a/libs/tgl/libevent/event-config.h.cmake b/libs/tgl/libevent/event-config.h.cmake
new file mode 100644
index 0000000000..76e0d1f981
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/event-internal.h b/libs/tgl/libevent/event-internal.h
new file mode 100644
index 0000000000..66dcfc329c
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/event.3 b/libs/tgl/libevent/event.3
new file mode 100644
index 0000000000..655a823efe
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/event.c b/libs/tgl/libevent/event.c
new file mode 100644
index 0000000000..503003e249
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/event.obj b/libs/tgl/libevent/event.obj
new file mode 100644
index 0000000000..dfc99f232e
--- /dev/null
+++ b/libs/tgl/libevent/event.obj
Binary files differ
diff --git a/libs/tgl/libevent/event_iocp.c b/libs/tgl/libevent/event_iocp.c
new file mode 100644
index 0000000000..a9902fbc42
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/event_iocp.obj b/libs/tgl/libevent/event_iocp.obj
new file mode 100644
index 0000000000..3a32d6e6cd
--- /dev/null
+++ b/libs/tgl/libevent/event_iocp.obj
Binary files differ
diff --git a/libs/tgl/libevent/event_rpcgen.py b/libs/tgl/libevent/event_rpcgen.py
new file mode 100644
index 0000000000..c537565696
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/event_tagging.c b/libs/tgl/libevent/event_tagging.c
new file mode 100644
index 0000000000..6459dfa72e
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/event_tagging.obj b/libs/tgl/libevent/event_tagging.obj
new file mode 100644
index 0000000000..920a698e34
--- /dev/null
+++ b/libs/tgl/libevent/event_tagging.obj
Binary files differ
diff --git a/libs/tgl/libevent/evmap-internal.h b/libs/tgl/libevent/evmap-internal.h
new file mode 100644
index 0000000000..dfc81d5087
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/evmap.c b/libs/tgl/libevent/evmap.c
new file mode 100644
index 0000000000..3f76dd0ae1
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/evmap.obj b/libs/tgl/libevent/evmap.obj
new file mode 100644
index 0000000000..7b16cf4a94
--- /dev/null
+++ b/libs/tgl/libevent/evmap.obj
Binary files differ
diff --git a/libs/tgl/libevent/evport.c b/libs/tgl/libevent/evport.c
new file mode 100644
index 0000000000..a014386bfe
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/evrpc-internal.h b/libs/tgl/libevent/evrpc-internal.h
new file mode 100644
index 0000000000..9eb376386d
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/evrpc.c b/libs/tgl/libevent/evrpc.c
new file mode 100644
index 0000000000..2443ab2793
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/evrpc.obj b/libs/tgl/libevent/evrpc.obj
new file mode 100644
index 0000000000..4733bf298b
--- /dev/null
+++ b/libs/tgl/libevent/evrpc.obj
Binary files differ
diff --git a/libs/tgl/libevent/evsignal-internal.h b/libs/tgl/libevent/evsignal-internal.h
new file mode 100644
index 0000000000..5cff03b525
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/evthread-internal.h b/libs/tgl/libevent/evthread-internal.h
new file mode 100644
index 0000000000..efdecf81e7
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/evthread.c b/libs/tgl/libevent/evthread.c
new file mode 100644
index 0000000000..f3f1eddc89
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/evthread.obj b/libs/tgl/libevent/evthread.obj
new file mode 100644
index 0000000000..e956cc88ae
--- /dev/null
+++ b/libs/tgl/libevent/evthread.obj
Binary files differ
diff --git a/libs/tgl/libevent/evthread_pthread.c b/libs/tgl/libevent/evthread_pthread.c
new file mode 100644
index 0000000000..4e11f74970
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/evthread_win32.c b/libs/tgl/libevent/evthread_win32.c
new file mode 100644
index 0000000000..2ec80560a5
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/evthread_win32.obj b/libs/tgl/libevent/evthread_win32.obj
new file mode 100644
index 0000000000..f50cf71184
--- /dev/null
+++ b/libs/tgl/libevent/evthread_win32.obj
Binary files differ
diff --git a/libs/tgl/libevent/evutil.c b/libs/tgl/libevent/evutil.c
new file mode 100644
index 0000000000..495bfcc029
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/evutil.obj b/libs/tgl/libevent/evutil.obj
new file mode 100644
index 0000000000..6beedbadef
--- /dev/null
+++ b/libs/tgl/libevent/evutil.obj
Binary files differ
diff --git a/libs/tgl/libevent/evutil_rand.c b/libs/tgl/libevent/evutil_rand.c
new file mode 100644
index 0000000000..046a14b07a
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/evutil_rand.obj b/libs/tgl/libevent/evutil_rand.obj
new file mode 100644
index 0000000000..576e3d79a1
--- /dev/null
+++ b/libs/tgl/libevent/evutil_rand.obj
Binary files differ
diff --git a/libs/tgl/libevent/evutil_time.c b/libs/tgl/libevent/evutil_time.c
new file mode 100644
index 0000000000..8f53c66b68
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/evutil_time.obj b/libs/tgl/libevent/evutil_time.obj
new file mode 100644
index 0000000000..3b4a859019
--- /dev/null
+++ b/libs/tgl/libevent/evutil_time.obj
Binary files differ
diff --git a/libs/tgl/libevent/ht-internal.h b/libs/tgl/libevent/ht-internal.h
new file mode 100644
index 0000000000..50375bbaa9
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/http-internal.h b/libs/tgl/libevent/http-internal.h
new file mode 100644
index 0000000000..ba6e49ef9b
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/http.c b/libs/tgl/libevent/http.c
new file mode 100644
index 0000000000..fd7ce3cbf2
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/http.obj b/libs/tgl/libevent/http.obj
new file mode 100644
index 0000000000..203f779154
--- /dev/null
+++ b/libs/tgl/libevent/http.obj
Binary files differ
diff --git a/libs/tgl/libevent/include/evdns.h b/libs/tgl/libevent/include/evdns.h
new file mode 100644
index 0000000000..8672db0369
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/event.h b/libs/tgl/libevent/include/event.h
new file mode 100644
index 0000000000..ba5186713b
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/event2/buffer.h b/libs/tgl/libevent/include/event2/buffer.h
new file mode 100644
index 0000000000..468588b9f1
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/event2/buffer_compat.h b/libs/tgl/libevent/include/event2/buffer_compat.h
new file mode 100644
index 0000000000..24f828c210
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/event2/bufferevent.h b/libs/tgl/libevent/include/event2/bufferevent.h
new file mode 100644
index 0000000000..825918e3a4
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/event2/bufferevent_compat.h b/libs/tgl/libevent/include/event2/bufferevent_compat.h
new file mode 100644
index 0000000000..65482042f9
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/event2/bufferevent_ssl.h b/libs/tgl/libevent/include/event2/bufferevent_ssl.h
new file mode 100644
index 0000000000..bf39b844a9
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/event2/bufferevent_struct.h b/libs/tgl/libevent/include/event2/bufferevent_struct.h
new file mode 100644
index 0000000000..e84c082c30
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/event2/dns.h b/libs/tgl/libevent/include/event2/dns.h
new file mode 100644
index 0000000000..17cd86a2ec
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/event2/dns_compat.h b/libs/tgl/libevent/include/event2/dns_compat.h
new file mode 100644
index 0000000000..965fd65445
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/event2/dns_struct.h b/libs/tgl/libevent/include/event2/dns_struct.h
new file mode 100644
index 0000000000..593a8a70b6
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/event2/event.h b/libs/tgl/libevent/include/event2/event.h
new file mode 100644
index 0000000000..6e0a4f04c7
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/event2/event_compat.h b/libs/tgl/libevent/include/event2/event_compat.h
new file mode 100644
index 0000000000..5110175a1b
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/event2/event_struct.h b/libs/tgl/libevent/include/event2/event_struct.h
new file mode 100644
index 0000000000..1c8b71b6b0
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/event2/http.h b/libs/tgl/libevent/include/event2/http.h
new file mode 100644
index 0000000000..e99782073f
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/event2/http_compat.h b/libs/tgl/libevent/include/event2/http_compat.h
new file mode 100644
index 0000000000..0d9af17f3f
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/event2/http_struct.h b/libs/tgl/libevent/include/event2/http_struct.h
new file mode 100644
index 0000000000..4bf5b1ff60
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/event2/keyvalq_struct.h b/libs/tgl/libevent/include/event2/keyvalq_struct.h
new file mode 100644
index 0000000000..bffa54b3a7
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/event2/listener.h b/libs/tgl/libevent/include/event2/listener.h
new file mode 100644
index 0000000000..84b4da055d
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/event2/rpc.h b/libs/tgl/libevent/include/event2/rpc.h
new file mode 100644
index 0000000000..dd43df266a
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/event2/rpc_compat.h b/libs/tgl/libevent/include/event2/rpc_compat.h
new file mode 100644
index 0000000000..8d8334d25f
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/event2/rpc_struct.h b/libs/tgl/libevent/include/event2/rpc_struct.h
new file mode 100644
index 0000000000..8f691f49fb
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/event2/tag.h b/libs/tgl/libevent/include/event2/tag.h
new file mode 100644
index 0000000000..2f73bfc00e
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/event2/tag_compat.h b/libs/tgl/libevent/include/event2/tag_compat.h
new file mode 100644
index 0000000000..a276c0d35b
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/event2/thread.h b/libs/tgl/libevent/include/event2/thread.h
new file mode 100644
index 0000000000..b51998631b
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/event2/util.h b/libs/tgl/libevent/include/event2/util.h
new file mode 100644
index 0000000000..3936786ec9
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/event2/visibility.h b/libs/tgl/libevent/include/event2/visibility.h
new file mode 100644
index 0000000000..fb16dbeedd
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/evhttp.h b/libs/tgl/libevent/include/evhttp.h
new file mode 100644
index 0000000000..549bc9b14a
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/evrpc.h b/libs/tgl/libevent/include/evrpc.h
new file mode 100644
index 0000000000..7e986f7dab
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/evutil.h b/libs/tgl/libevent/include/evutil.h
new file mode 100644
index 0000000000..12c137d745
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/include/include.am b/libs/tgl/libevent/include/include.am
new file mode 100644
index 0000000000..9aad2dba4a
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/iocp-internal.h b/libs/tgl/libevent/iocp-internal.h
new file mode 100644
index 0000000000..93dbe2b1a4
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/ipv6-internal.h b/libs/tgl/libevent/ipv6-internal.h
new file mode 100644
index 0000000000..0c207377b8
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/kqueue-internal.h b/libs/tgl/libevent/kqueue-internal.h
new file mode 100644
index 0000000000..02c5a3606c
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/kqueue.c b/libs/tgl/libevent/kqueue.c
new file mode 100644
index 0000000000..1f41b5a768
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/libevent.lib b/libs/tgl/libevent/libevent.lib
new file mode 100644
index 0000000000..c1beefd6af
--- /dev/null
+++ b/libs/tgl/libevent/libevent.lib
Binary files differ
diff --git a/libs/tgl/libevent/libevent.pc.in b/libs/tgl/libevent/libevent.pc.in
new file mode 100644
index 0000000000..7030884eeb
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/libevent_core.lib b/libs/tgl/libevent/libevent_core.lib
new file mode 100644
index 0000000000..36bcb0e417
--- /dev/null
+++ b/libs/tgl/libevent/libevent_core.lib
Binary files differ
diff --git a/libs/tgl/libevent/libevent_extras.lib b/libs/tgl/libevent/libevent_extras.lib
new file mode 100644
index 0000000000..44f6619eaf
--- /dev/null
+++ b/libs/tgl/libevent/libevent_extras.lib
Binary files differ
diff --git a/libs/tgl/libevent/libevent_openssl.pc.in b/libs/tgl/libevent/libevent_openssl.pc.in
new file mode 100644
index 0000000000..a65d1e0668
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/libevent_pthreads.pc.in b/libs/tgl/libevent/libevent_pthreads.pc.in
new file mode 100644
index 0000000000..9bc2392b34
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/listener.c b/libs/tgl/libevent/listener.c
new file mode 100644
index 0000000000..2af14e3a7b
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/listener.obj b/libs/tgl/libevent/listener.obj
new file mode 100644
index 0000000000..5791e090eb
--- /dev/null
+++ b/libs/tgl/libevent/listener.obj
Binary files differ
diff --git a/libs/tgl/libevent/log-internal.h b/libs/tgl/libevent/log-internal.h
new file mode 100644
index 0000000000..330478a9ed
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/log.c b/libs/tgl/libevent/log.c
new file mode 100644
index 0000000000..e8ae9fdc31
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/log.obj b/libs/tgl/libevent/log.obj
new file mode 100644
index 0000000000..4a0dff73c4
--- /dev/null
+++ b/libs/tgl/libevent/log.obj
Binary files differ
diff --git a/libs/tgl/libevent/m4/ac_backport_259_ssizet.m4 b/libs/tgl/libevent/m4/ac_backport_259_ssizet.m4
new file mode 100644
index 0000000000..75fde386cb
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/m4/acx_pthread.m4 b/libs/tgl/libevent/m4/acx_pthread.m4
new file mode 100644
index 0000000000..d2b116945f
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/m4/libevent_openssl.m4 b/libs/tgl/libevent/m4/libevent_openssl.m4
new file mode 100644
index 0000000000..3cb064a0bd
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/m4/ntp_pkg_config.m4 b/libs/tgl/libevent/m4/ntp_pkg_config.m4
new file mode 100644
index 0000000000..1bce8a6e4d
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/make-event-config.sed b/libs/tgl/libevent/make-event-config.sed
new file mode 100644
index 0000000000..e31018a2dd
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/make_epoll_table.py b/libs/tgl/libevent/make_epoll_table.py
new file mode 100644
index 0000000000..1b15a91a67
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/minheap-internal.h b/libs/tgl/libevent/minheap-internal.h
new file mode 100644
index 0000000000..b3b6f1fd49
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/mm-internal.h b/libs/tgl/libevent/mm-internal.h
new file mode 100644
index 0000000000..4ba6fce4ad
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/poll.c b/libs/tgl/libevent/poll.c
new file mode 100644
index 0000000000..51475934b3
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/ratelim-internal.h b/libs/tgl/libevent/ratelim-internal.h
new file mode 100644
index 0000000000..6cc1cdde2c
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/sample/dns-example.c b/libs/tgl/libevent/sample/dns-example.c
new file mode 100644
index 0000000000..fb705664aa
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/sample/event-read-fifo.c b/libs/tgl/libevent/sample/event-read-fifo.c
new file mode 100644
index 0000000000..27b0b530d5
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/sample/hello-world.c b/libs/tgl/libevent/sample/hello-world.c
new file mode 100644
index 0000000000..d3cf058a8b
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/sample/hostcheck.c b/libs/tgl/libevent/sample/hostcheck.c
new file mode 100644
index 0000000000..50709369c0
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/sample/hostcheck.h b/libs/tgl/libevent/sample/hostcheck.h
new file mode 100644
index 0000000000..f40bc43435
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/sample/http-connect.c b/libs/tgl/libevent/sample/http-connect.c
new file mode 100644
index 0000000000..d6c7b5ea0b
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/sample/http-server.c b/libs/tgl/libevent/sample/http-server.c
new file mode 100644
index 0000000000..cbb9c914dd
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/sample/https-client.c b/libs/tgl/libevent/sample/https-client.c
new file mode 100644
index 0000000000..029cd19c75
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/sample/include.am b/libs/tgl/libevent/sample/include.am
new file mode 100644
index 0000000000..d1a7242f7c
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/sample/le-proxy.c b/libs/tgl/libevent/sample/le-proxy.c
new file mode 100644
index 0000000000..30e0a5f6b9
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/sample/openssl_hostname_validation.c b/libs/tgl/libevent/sample/openssl_hostname_validation.c
new file mode 100644
index 0000000000..00e63d1e15
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/sample/openssl_hostname_validation.h b/libs/tgl/libevent/sample/openssl_hostname_validation.h
new file mode 100644
index 0000000000..54aa1c436d
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/sample/signal-test.c b/libs/tgl/libevent/sample/signal-test.c
new file mode 100644
index 0000000000..a61642f325
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/sample/time-test.c b/libs/tgl/libevent/sample/time-test.c
new file mode 100644
index 0000000000..c94c18a500
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/select.c b/libs/tgl/libevent/select.c
new file mode 100644
index 0000000000..8ae53cc11e
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/signal.c b/libs/tgl/libevent/signal.c
new file mode 100644
index 0000000000..3f46295024
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/signal.obj b/libs/tgl/libevent/signal.obj
new file mode 100644
index 0000000000..97a9c944b5
--- /dev/null
+++ b/libs/tgl/libevent/signal.obj
Binary files differ
diff --git a/libs/tgl/libevent/strlcpy-internal.h b/libs/tgl/libevent/strlcpy-internal.h
new file mode 100644
index 0000000000..cfc27ec662
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/strlcpy.c b/libs/tgl/libevent/strlcpy.c
new file mode 100644
index 0000000000..3876475f5a
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/strlcpy.obj b/libs/tgl/libevent/strlcpy.obj
new file mode 100644
index 0000000000..2bc0f36f3e
--- /dev/null
+++ b/libs/tgl/libevent/strlcpy.obj
Binary files differ
diff --git a/libs/tgl/libevent/test/Makefile.nmake b/libs/tgl/libevent/test/Makefile.nmake
new file mode 100644
index 0000000000..30c3eb792b
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/bench.c b/libs/tgl/libevent/test/bench.c
new file mode 100644
index 0000000000..214479c1ff
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/bench_cascade.c b/libs/tgl/libevent/test/bench_cascade.c
new file mode 100644
index 0000000000..2d85cc1f10
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/bench_http.c b/libs/tgl/libevent/test/bench_http.c
new file mode 100644
index 0000000000..6d0d971799
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/bench_httpclient.c b/libs/tgl/libevent/test/bench_httpclient.c
new file mode 100644
index 0000000000..bcddc95f43
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/check-dumpevents.py b/libs/tgl/libevent/test/check-dumpevents.py
new file mode 100644
index 0000000000..16fe9bc92f
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/include.am b/libs/tgl/libevent/test/include.am
new file mode 100644
index 0000000000..4cd49ef630
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/print-winsock-errors.c b/libs/tgl/libevent/test/print-winsock-errors.c
new file mode 100644
index 0000000000..ab6e610e84
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/print-winsock-errors.exe b/libs/tgl/libevent/test/print-winsock-errors.exe
new file mode 100644
index 0000000000..7bdbd19034
--- /dev/null
+++ b/libs/tgl/libevent/test/print-winsock-errors.exe
Binary files differ
diff --git a/libs/tgl/libevent/test/print-winsock-errors.obj b/libs/tgl/libevent/test/print-winsock-errors.obj
new file mode 100644
index 0000000000..ca803f6340
--- /dev/null
+++ b/libs/tgl/libevent/test/print-winsock-errors.obj
Binary files differ
diff --git a/libs/tgl/libevent/test/regress.c b/libs/tgl/libevent/test/regress.c
new file mode 100644
index 0000000000..b12c66dfa0
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/regress.exe b/libs/tgl/libevent/test/regress.exe
new file mode 100644
index 0000000000..651b62c564
--- /dev/null
+++ b/libs/tgl/libevent/test/regress.exe
Binary files differ
diff --git a/libs/tgl/libevent/test/regress.gen.c b/libs/tgl/libevent/test/regress.gen.c
new file mode 100644
index 0000000000..2cf8925e9a
--- /dev/null
+++ b/libs/tgl/libevent/test/regress.gen.c
@@ -0,0 +1 @@
+//
diff --git a/libs/tgl/libevent/test/regress.gen.h b/libs/tgl/libevent/test/regress.gen.h
new file mode 100644
index 0000000000..4578e5f7f3
--- /dev/null
+++ b/libs/tgl/libevent/test/regress.gen.h
@@ -0,0 +1 @@
+#define NO_PYTHON_EXISTS
diff --git a/libs/tgl/libevent/test/regress.gen.obj b/libs/tgl/libevent/test/regress.gen.obj
new file mode 100644
index 0000000000..ba20c4cca8
--- /dev/null
+++ b/libs/tgl/libevent/test/regress.gen.obj
Binary files differ
diff --git a/libs/tgl/libevent/test/regress.h b/libs/tgl/libevent/test/regress.h
new file mode 100644
index 0000000000..de1aed3089
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/regress.obj b/libs/tgl/libevent/test/regress.obj
new file mode 100644
index 0000000000..b3832b8411
--- /dev/null
+++ b/libs/tgl/libevent/test/regress.obj
Binary files differ
diff --git a/libs/tgl/libevent/test/regress.rpc b/libs/tgl/libevent/test/regress.rpc
new file mode 100644
index 0000000000..0ee904e913
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/regress_buffer.c b/libs/tgl/libevent/test/regress_buffer.c
new file mode 100644
index 0000000000..957e59f178
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/regress_buffer.obj b/libs/tgl/libevent/test/regress_buffer.obj
new file mode 100644
index 0000000000..a2db69f000
--- /dev/null
+++ b/libs/tgl/libevent/test/regress_buffer.obj
Binary files differ
diff --git a/libs/tgl/libevent/test/regress_bufferevent.c b/libs/tgl/libevent/test/regress_bufferevent.c
new file mode 100644
index 0000000000..68e6876405
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/regress_bufferevent.obj b/libs/tgl/libevent/test/regress_bufferevent.obj
new file mode 100644
index 0000000000..1142945e51
--- /dev/null
+++ b/libs/tgl/libevent/test/regress_bufferevent.obj
Binary files differ
diff --git a/libs/tgl/libevent/test/regress_dns.c b/libs/tgl/libevent/test/regress_dns.c
new file mode 100644
index 0000000000..1873636245
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/regress_dns.obj b/libs/tgl/libevent/test/regress_dns.obj
new file mode 100644
index 0000000000..4406585f06
--- /dev/null
+++ b/libs/tgl/libevent/test/regress_dns.obj
Binary files differ
diff --git a/libs/tgl/libevent/test/regress_et.c b/libs/tgl/libevent/test/regress_et.c
new file mode 100644
index 0000000000..229a78e2d4
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/regress_et.obj b/libs/tgl/libevent/test/regress_et.obj
new file mode 100644
index 0000000000..e745dc87e6
--- /dev/null
+++ b/libs/tgl/libevent/test/regress_et.obj
Binary files differ
diff --git a/libs/tgl/libevent/test/regress_finalize.c b/libs/tgl/libevent/test/regress_finalize.c
new file mode 100644
index 0000000000..552210fe9d
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/regress_finalize.obj b/libs/tgl/libevent/test/regress_finalize.obj
new file mode 100644
index 0000000000..765fd66e38
--- /dev/null
+++ b/libs/tgl/libevent/test/regress_finalize.obj
Binary files differ
diff --git a/libs/tgl/libevent/test/regress_http.c b/libs/tgl/libevent/test/regress_http.c
new file mode 100644
index 0000000000..cbe7aea34c
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/regress_http.obj b/libs/tgl/libevent/test/regress_http.obj
new file mode 100644
index 0000000000..85099a6a04
--- /dev/null
+++ b/libs/tgl/libevent/test/regress_http.obj
Binary files differ
diff --git a/libs/tgl/libevent/test/regress_iocp.c b/libs/tgl/libevent/test/regress_iocp.c
new file mode 100644
index 0000000000..17b385241f
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/regress_iocp.obj b/libs/tgl/libevent/test/regress_iocp.obj
new file mode 100644
index 0000000000..5e2f0d2149
--- /dev/null
+++ b/libs/tgl/libevent/test/regress_iocp.obj
Binary files differ
diff --git a/libs/tgl/libevent/test/regress_listener.c b/libs/tgl/libevent/test/regress_listener.c
new file mode 100644
index 0000000000..4db102df68
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/regress_listener.obj b/libs/tgl/libevent/test/regress_listener.obj
new file mode 100644
index 0000000000..b05b290d36
--- /dev/null
+++ b/libs/tgl/libevent/test/regress_listener.obj
Binary files differ
diff --git a/libs/tgl/libevent/test/regress_main.c b/libs/tgl/libevent/test/regress_main.c
new file mode 100644
index 0000000000..6d045bb833
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/regress_main.obj b/libs/tgl/libevent/test/regress_main.obj
new file mode 100644
index 0000000000..27aaa4eb28
--- /dev/null
+++ b/libs/tgl/libevent/test/regress_main.obj
Binary files differ
diff --git a/libs/tgl/libevent/test/regress_minheap.c b/libs/tgl/libevent/test/regress_minheap.c
new file mode 100644
index 0000000000..05db32e26f
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/regress_minheap.obj b/libs/tgl/libevent/test/regress_minheap.obj
new file mode 100644
index 0000000000..0ab530f4fa
--- /dev/null
+++ b/libs/tgl/libevent/test/regress_minheap.obj
Binary files differ
diff --git a/libs/tgl/libevent/test/regress_rpc.c b/libs/tgl/libevent/test/regress_rpc.c
new file mode 100644
index 0000000000..01a058cbb2
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/regress_rpc.obj b/libs/tgl/libevent/test/regress_rpc.obj
new file mode 100644
index 0000000000..6c1d24abcd
--- /dev/null
+++ b/libs/tgl/libevent/test/regress_rpc.obj
Binary files differ
diff --git a/libs/tgl/libevent/test/regress_ssl.c b/libs/tgl/libevent/test/regress_ssl.c
new file mode 100644
index 0000000000..a415952a7d
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/regress_testutils.c b/libs/tgl/libevent/test/regress_testutils.c
new file mode 100644
index 0000000000..7554a5413f
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/regress_testutils.h b/libs/tgl/libevent/test/regress_testutils.h
new file mode 100644
index 0000000000..040516a585
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/regress_testutils.obj b/libs/tgl/libevent/test/regress_testutils.obj
new file mode 100644
index 0000000000..f596a67e4c
--- /dev/null
+++ b/libs/tgl/libevent/test/regress_testutils.obj
Binary files differ
diff --git a/libs/tgl/libevent/test/regress_thread.c b/libs/tgl/libevent/test/regress_thread.c
new file mode 100644
index 0000000000..9ff6a8fa88
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/regress_thread.h b/libs/tgl/libevent/test/regress_thread.h
new file mode 100644
index 0000000000..831b51e507
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/regress_thread.obj b/libs/tgl/libevent/test/regress_thread.obj
new file mode 100644
index 0000000000..9654fe8ddb
--- /dev/null
+++ b/libs/tgl/libevent/test/regress_thread.obj
Binary files differ
diff --git a/libs/tgl/libevent/test/regress_util.c b/libs/tgl/libevent/test/regress_util.c
new file mode 100644
index 0000000000..60f085bf1d
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/regress_util.obj b/libs/tgl/libevent/test/regress_util.obj
new file mode 100644
index 0000000000..79a948f2a5
--- /dev/null
+++ b/libs/tgl/libevent/test/regress_util.obj
Binary files differ
diff --git a/libs/tgl/libevent/test/regress_zlib.c b/libs/tgl/libevent/test/regress_zlib.c
new file mode 100644
index 0000000000..8406676932
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/rpcgen_wrapper.sh b/libs/tgl/libevent/test/rpcgen_wrapper.sh
new file mode 100644
index 0000000000..aaa03031a1
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/test-changelist.c b/libs/tgl/libevent/test/test-changelist.c
new file mode 100644
index 0000000000..6e2466d5a5
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/test-changelist.exe b/libs/tgl/libevent/test/test-changelist.exe
new file mode 100644
index 0000000000..2adeacc62f
--- /dev/null
+++ b/libs/tgl/libevent/test/test-changelist.exe
Binary files differ
diff --git a/libs/tgl/libevent/test/test-changelist.obj b/libs/tgl/libevent/test/test-changelist.obj
new file mode 100644
index 0000000000..d5e1a181f6
--- /dev/null
+++ b/libs/tgl/libevent/test/test-changelist.obj
Binary files differ
diff --git a/libs/tgl/libevent/test/test-closed.c b/libs/tgl/libevent/test/test-closed.c
new file mode 100644
index 0000000000..5b04f354ac
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/test-closed.exe b/libs/tgl/libevent/test/test-closed.exe
new file mode 100644
index 0000000000..68bd7e1de1
--- /dev/null
+++ b/libs/tgl/libevent/test/test-closed.exe
Binary files differ
diff --git a/libs/tgl/libevent/test/test-closed.obj b/libs/tgl/libevent/test/test-closed.obj
new file mode 100644
index 0000000000..3894c88833
--- /dev/null
+++ b/libs/tgl/libevent/test/test-closed.obj
Binary files differ
diff --git a/libs/tgl/libevent/test/test-dumpevents.c b/libs/tgl/libevent/test/test-dumpevents.c
new file mode 100644
index 0000000000..1c272d4c01
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/test-eof.c b/libs/tgl/libevent/test/test-eof.c
new file mode 100644
index 0000000000..a9ca5343a2
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/test-eof.exe b/libs/tgl/libevent/test/test-eof.exe
new file mode 100644
index 0000000000..0c20f43d91
--- /dev/null
+++ b/libs/tgl/libevent/test/test-eof.exe
Binary files differ
diff --git a/libs/tgl/libevent/test/test-eof.obj b/libs/tgl/libevent/test/test-eof.obj
new file mode 100644
index 0000000000..05c17400b8
--- /dev/null
+++ b/libs/tgl/libevent/test/test-eof.obj
Binary files differ
diff --git a/libs/tgl/libevent/test/test-fdleak.c b/libs/tgl/libevent/test/test-fdleak.c
new file mode 100644
index 0000000000..4c4eba25e7
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/test-init.c b/libs/tgl/libevent/test/test-init.c
new file mode 100644
index 0000000000..92fbc6b146
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/test-init.exe b/libs/tgl/libevent/test/test-init.exe
new file mode 100644
index 0000000000..c404d2c1a1
--- /dev/null
+++ b/libs/tgl/libevent/test/test-init.exe
Binary files differ
diff --git a/libs/tgl/libevent/test/test-init.obj b/libs/tgl/libevent/test/test-init.obj
new file mode 100644
index 0000000000..606fcf91d5
--- /dev/null
+++ b/libs/tgl/libevent/test/test-init.obj
Binary files differ
diff --git a/libs/tgl/libevent/test/test-ratelim.c b/libs/tgl/libevent/test/test-ratelim.c
new file mode 100644
index 0000000000..17babfdcbc
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/test-ratelim.sh b/libs/tgl/libevent/test/test-ratelim.sh
new file mode 100644
index 0000000000..b5e0ca62a9
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/test-time.c b/libs/tgl/libevent/test/test-time.c
new file mode 100644
index 0000000000..bcc7086df7
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/test-time.exe b/libs/tgl/libevent/test/test-time.exe
new file mode 100644
index 0000000000..7cdcfd61ac
--- /dev/null
+++ b/libs/tgl/libevent/test/test-time.exe
Binary files differ
diff --git a/libs/tgl/libevent/test/test-time.obj b/libs/tgl/libevent/test/test-time.obj
new file mode 100644
index 0000000000..c5fa6cbeac
--- /dev/null
+++ b/libs/tgl/libevent/test/test-time.obj
Binary files differ
diff --git a/libs/tgl/libevent/test/test-weof.c b/libs/tgl/libevent/test/test-weof.c
new file mode 100644
index 0000000000..c379f287cb
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/test-weof.exe b/libs/tgl/libevent/test/test-weof.exe
new file mode 100644
index 0000000000..1fe6973f46
--- /dev/null
+++ b/libs/tgl/libevent/test/test-weof.exe
Binary files differ
diff --git a/libs/tgl/libevent/test/test-weof.obj b/libs/tgl/libevent/test/test-weof.obj
new file mode 100644
index 0000000000..5ca123d600
--- /dev/null
+++ b/libs/tgl/libevent/test/test-weof.obj
Binary files differ
diff --git a/libs/tgl/libevent/test/test.sh b/libs/tgl/libevent/test/test.sh
new file mode 100644
index 0000000000..b73c1adced
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/tinytest.c b/libs/tgl/libevent/test/tinytest.c
new file mode 100644
index 0000000000..3a8e331055
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/tinytest.h b/libs/tgl/libevent/test/tinytest.h
new file mode 100644
index 0000000000..ed07b26bc0
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/tinytest.obj b/libs/tgl/libevent/test/tinytest.obj
new file mode 100644
index 0000000000..f9b5885695
--- /dev/null
+++ b/libs/tgl/libevent/test/tinytest.obj
Binary files differ
diff --git a/libs/tgl/libevent/test/tinytest_demo.c b/libs/tgl/libevent/test/tinytest_demo.c
new file mode 100644
index 0000000000..f6bfd66a1a
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/tinytest_local.h b/libs/tgl/libevent/test/tinytest_local.h
new file mode 100644
index 0000000000..87ec2fa67e
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/test/tinytest_macros.h b/libs/tgl/libevent/test/tinytest_macros.h
new file mode 100644
index 0000000000..c3728d1fdd
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/time-internal.h b/libs/tgl/libevent/time-internal.h
new file mode 100644
index 0000000000..2c584fa752
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/util-internal.h b/libs/tgl/libevent/util-internal.h
new file mode 100644
index 0000000000..06aa97299a
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/whatsnew-2.0.txt b/libs/tgl/libevent/whatsnew-2.0.txt
new file mode 100644
index 0000000000..3561fcb94c
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/whatsnew-2.1.txt b/libs/tgl/libevent/whatsnew-2.1.txt
new file mode 100644
index 0000000000..0be54ae11b
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/win32select.c b/libs/tgl/libevent/win32select.c
new file mode 100644
index 0000000000..1766858c2c
--- /dev/null
+++ b/libs/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/libs/tgl/libevent/win32select.obj b/libs/tgl/libevent/win32select.obj
new file mode 100644
index 0000000000..225738415a
--- /dev/null
+++ b/libs/tgl/libevent/win32select.obj
Binary files differ
diff --git a/libs/tgl/openssl/include/openssl/aes.h b/libs/tgl/openssl/include/openssl/aes.h
new file mode 100644
index 0000000000..faa66c4914
--- /dev/null
+++ b/libs/tgl/openssl/include/openssl/aes.h
@@ -0,0 +1,149 @@
+/* crypto/aes/aes.h */
+/* ====================================================================
+ * 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/libs/tgl/openssl/include/openssl/applink.c b/libs/tgl/openssl/include/openssl/applink.c
new file mode 100644
index 0000000000..2831b39e9a
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/asn1.h b/libs/tgl/openssl/include/openssl/asn1.h
new file mode 100644
index 0000000000..68e791fcdb
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/asn1_mac.h b/libs/tgl/openssl/include/openssl/asn1_mac.h
new file mode 100644
index 0000000000..abc6dc35ca
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/asn1t.h b/libs/tgl/openssl/include/openssl/asn1t.h
new file mode 100644
index 0000000000..99bc0eecf3
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/bio.h b/libs/tgl/openssl/include/openssl/bio.h
new file mode 100644
index 0000000000..6e2293bc66
--- /dev/null
+++ b/libs/tgl/openssl/include/openssl/bio.h
@@ -0,0 +1,883 @@
+/* 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_ctrl(b,BIO_C_GET_CONNECT,3,0,NULL)
+
+# define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL)
+
+/* BIO_s_accept() */
+# 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)
+
+/* BIO_s_accept() and BIO_s_connect() */
+# 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)
+
+/* BIO_s_datagram(), BIO_s_fd(), BIO_s_socket(), BIO_s_accept() and BIO_s_connect() */
+# 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)
+
+/* BIO_s_file() */
+# 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)
+
+/* BIO_s_fd() and BIO_s_file() */
+# 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/libs/tgl/openssl/include/openssl/blowfish.h b/libs/tgl/openssl/include/openssl/blowfish.h
new file mode 100644
index 0000000000..832930272c
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/bn.h b/libs/tgl/openssl/include/openssl/bn.h
new file mode 100644
index 0000000000..5696965e9a
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/buffer.h b/libs/tgl/openssl/include/openssl/buffer.h
new file mode 100644
index 0000000000..efd240a5f9
--- /dev/null
+++ b/libs/tgl/openssl/include/openssl/buffer.h
@@ -0,0 +1,125 @@
+/* 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);
+
+/*
+ * Like strndup, but in addition, explicitly guarantees to never read past the
+ * first |siz| bytes of |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/libs/tgl/openssl/include/openssl/camellia.h b/libs/tgl/openssl/include/openssl/camellia.h
new file mode 100644
index 0000000000..45e8d25b1d
--- /dev/null
+++ b/libs/tgl/openssl/include/openssl/camellia.h
@@ -0,0 +1,132 @@
+/* crypto/camellia/camellia.h */
+/* ====================================================================
+ * 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/libs/tgl/openssl/include/openssl/cast.h b/libs/tgl/openssl/include/openssl/cast.h
new file mode 100644
index 0000000000..0003ec9c7c
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/cmac.h b/libs/tgl/openssl/include/openssl/cmac.h
new file mode 100644
index 0000000000..175be8348a
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/cms.h b/libs/tgl/openssl/include/openssl/cms.h
new file mode 100644
index 0000000000..e6c7f964bf
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/comp.h b/libs/tgl/openssl/include/openssl/comp.h
new file mode 100644
index 0000000000..406c428aae
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/conf.h b/libs/tgl/openssl/include/openssl/conf.h
new file mode 100644
index 0000000000..8d926d5d82
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/conf_api.h b/libs/tgl/openssl/include/openssl/conf_api.h
new file mode 100644
index 0000000000..e478f7df4b
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/crypto.h b/libs/tgl/openssl/include/openssl/crypto.h
new file mode 100644
index 0000000000..c450d7a3c3
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/des.h b/libs/tgl/openssl/include/openssl/des.h
new file mode 100644
index 0000000000..1b40144e1b
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/des_old.h b/libs/tgl/openssl/include/openssl/des_old.h
new file mode 100644
index 0000000000..ee7607a241
--- /dev/null
+++ b/libs/tgl/openssl/include/openssl/des_old.h
@@ -0,0 +1,497 @@
+/* crypto/des/des_old.h */
+
+/*-
+ * 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/libs/tgl/openssl/include/openssl/dh.h b/libs/tgl/openssl/include/openssl/dh.h
new file mode 100644
index 0000000000..5498a9dc10
--- /dev/null
+++ b/libs/tgl/openssl/include/openssl/dh.h
@@ -0,0 +1,393 @@
+/* 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 % p */
+ 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
+# define DH_CHECK_PUBKEY_INVALID 0x03
+
+/*
+ * 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/libs/tgl/openssl/include/openssl/dsa.h b/libs/tgl/openssl/include/openssl/dsa.h
new file mode 100644
index 0000000000..545358fd02
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/dso.h b/libs/tgl/openssl/include/openssl/dso.h
new file mode 100644
index 0000000000..c9013f5cea
--- /dev/null
+++ b/libs/tgl/openssl/include/openssl/dso.h
@@ -0,0 +1,451 @@
+/* dso.h */
+/*
+ * 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/libs/tgl/openssl/include/openssl/dtls1.h b/libs/tgl/openssl/include/openssl/dtls1.h
new file mode 100644
index 0000000000..30bbcf278a
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/e_os2.h b/libs/tgl/openssl/include/openssl/e_os2.h
new file mode 100644
index 0000000000..7be9989ac3
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/ebcdic.h b/libs/tgl/openssl/include/openssl/ebcdic.h
new file mode 100644
index 0000000000..4cbdfeb7ae
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/ec.h b/libs/tgl/openssl/include/openssl/ec.h
new file mode 100644
index 0000000000..81e6faf6c5
--- /dev/null
+++ b/libs/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 0x04 */
+ 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/libs/tgl/openssl/include/openssl/ecdh.h b/libs/tgl/openssl/include/openssl/ecdh.h
new file mode 100644
index 0000000000..25348b30fe
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/ecdsa.h b/libs/tgl/openssl/include/openssl/ecdsa.h
new file mode 100644
index 0000000000..a6f0930f82
--- /dev/null
+++ b/libs/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(const 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/libs/tgl/openssl/include/openssl/engine.h b/libs/tgl/openssl/include/openssl/engine.h
new file mode 100644
index 0000000000..bd7b591447
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/err.h b/libs/tgl/openssl/include/openssl/err.h
new file mode 100644
index 0000000000..585aa8ba3d
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/evp.h b/libs/tgl/openssl/include/openssl/evp.h
new file mode 100644
index 0000000000..39ab7937d2
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/hmac.h b/libs/tgl/openssl/include/openssl/hmac.h
new file mode 100644
index 0000000000..b8b55cda7d
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/idea.h b/libs/tgl/openssl/include/openssl/idea.h
new file mode 100644
index 0000000000..6075984039
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/krb5_asn.h b/libs/tgl/openssl/include/openssl/krb5_asn.h
new file mode 100644
index 0000000000..9cf5a26dd8
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/kssl.h b/libs/tgl/openssl/include/openssl/kssl.h
new file mode 100644
index 0000000000..ae8a51f472
--- /dev/null
+++ b/libs/tgl/openssl/include/openssl/kssl.h
@@ -0,0 +1,197 @@
+/* ssl/kssl.h */
+/*
+ * 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/libs/tgl/openssl/include/openssl/lhash.h b/libs/tgl/openssl/include/openssl/lhash.h
new file mode 100644
index 0000000000..b6c328bffb
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/md4.h b/libs/tgl/openssl/include/openssl/md4.h
new file mode 100644
index 0000000000..11fd71295b
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/md5.h b/libs/tgl/openssl/include/openssl/md5.h
new file mode 100644
index 0000000000..2659038abd
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/mdc2.h b/libs/tgl/openssl/include/openssl/mdc2.h
new file mode 100644
index 0000000000..7efe53bc29
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/modes.h b/libs/tgl/openssl/include/openssl/modes.h
new file mode 100644
index 0000000000..fd488499a0
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/obj_mac.h b/libs/tgl/openssl/include/openssl/obj_mac.h
new file mode 100644
index 0000000000..779c309b86
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/objects.h b/libs/tgl/openssl/include/openssl/objects.h
new file mode 100644
index 0000000000..b8dafa89ce
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/ocsp.h b/libs/tgl/openssl/include/openssl/ocsp.h
new file mode 100644
index 0000000000..ca2ee76dce
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/opensslconf.h b/libs/tgl/openssl/include/openssl/opensslconf.h
new file mode 100644
index 0000000000..b9e0f904b0
--- /dev/null
+++ b/libs/tgl/openssl/include/openssl/opensslconf.h
@@ -0,0 +1,260 @@
+/* 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
+#ifndef OPENSSL_NO_ASM
+# define OPENSSL_NO_ASM
+#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
+
+/* 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 "D:\\opensource\\openssl-dist-1.0.2f-vs2013\\openssl-x86-shared-release-vs2013/lib/engines"
+#define OPENSSLDIR "D:\\opensource\\openssl-dist-1.0.2f-vs2013\\openssl-x86-shared-release-vs2013/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 ) || 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/libs/tgl/openssl/include/openssl/opensslv.h b/libs/tgl/openssl/include/openssl/opensslv.h
new file mode 100644
index 0000000000..03b8c48437
--- /dev/null
+++ b/libs/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 0x1000206fL
+# ifdef OPENSSL_FIPS
+# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2f-fips 28 Jan 2016"
+# else
+# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2f 28 Jan 2016"
+# 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/libs/tgl/openssl/include/openssl/ossl_typ.h b/libs/tgl/openssl/include/openssl/ossl_typ.h
new file mode 100644
index 0000000000..9144ea2cf6
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/pem.h b/libs/tgl/openssl/include/openssl/pem.h
new file mode 100644
index 0000000000..d3b23fc997
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/pem2.h b/libs/tgl/openssl/include/openssl/pem2.h
new file mode 100644
index 0000000000..84897d5ec3
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/pkcs12.h b/libs/tgl/openssl/include/openssl/pkcs12.h
new file mode 100644
index 0000000000..a39adf5eb5
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/pkcs7.h b/libs/tgl/openssl/include/openssl/pkcs7.h
new file mode 100644
index 0000000000..b51b3863eb
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/pqueue.h b/libs/tgl/openssl/include/openssl/pqueue.h
new file mode 100644
index 0000000000..d40d9c7d85
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/rand.h b/libs/tgl/openssl/include/openssl/rand.h
new file mode 100644
index 0000000000..2553afda20
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/rc2.h b/libs/tgl/openssl/include/openssl/rc2.h
new file mode 100644
index 0000000000..29d02d7322
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/rc4.h b/libs/tgl/openssl/include/openssl/rc4.h
new file mode 100644
index 0000000000..39162b1648
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/ripemd.h b/libs/tgl/openssl/include/openssl/ripemd.h
new file mode 100644
index 0000000000..b88ef25e72
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/rsa.h b/libs/tgl/openssl/include/openssl/rsa.h
new file mode 100644
index 0000000000..d2ee37406e
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/safestack.h b/libs/tgl/openssl/include/openssl/safestack.h
new file mode 100644
index 0000000000..1d4f87eab3
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/seed.h b/libs/tgl/openssl/include/openssl/seed.h
new file mode 100644
index 0000000000..8cbf0d9281
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/sha.h b/libs/tgl/openssl/include/openssl/sha.h
new file mode 100644
index 0000000000..e5169e4fee
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/srp.h b/libs/tgl/openssl/include/openssl/srp.h
new file mode 100644
index 0000000000..d072536fec
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/srtp.h b/libs/tgl/openssl/include/openssl/srtp.h
new file mode 100644
index 0000000000..2279c32b89
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/ssl.h b/libs/tgl/openssl/include/openssl/ssl.h
new file mode 100644
index 0000000000..ae8c92575e
--- /dev/null
+++ b/libs/tgl/openssl/include/openssl/ssl.h
@@ -0,0 +1,3170 @@
+/* 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
+/* Does nothing: retained for compatibility */
+# 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,slistlen,(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_GENERATE_MASTER_SECRET 388
+# 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_SHUTDOWN 396
+# 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_G_VALUE 375
+# define SSL_R_BAD_DH_PUB_KEY_LENGTH 109
+# define SSL_R_BAD_DH_PUB_KEY_VALUE 393
+# define SSL_R_BAD_DH_P_LENGTH 110
+# define SSL_R_BAD_DH_P_VALUE 395
+# 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_SHUTDOWN_WHILE_IN_INIT 407
+# 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/libs/tgl/openssl/include/openssl/ssl2.h b/libs/tgl/openssl/include/openssl/ssl2.h
new file mode 100644
index 0000000000..03c7dd8cac
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/ssl23.h b/libs/tgl/openssl/include/openssl/ssl23.h
new file mode 100644
index 0000000000..9de4685af9
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/ssl3.h b/libs/tgl/openssl/include/openssl/ssl3.h
new file mode 100644
index 0000000000..e681d50a9e
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/stack.h b/libs/tgl/openssl/include/openssl/stack.h
new file mode 100644
index 0000000000..eb07216659
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/symhacks.h b/libs/tgl/openssl/include/openssl/symhacks.h
new file mode 100644
index 0000000000..239fa4fb1b
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/tls1.h b/libs/tgl/openssl/include/openssl/tls1.h
new file mode 100644
index 0000000000..7e237d0631
--- /dev/null
+++ b/libs/tgl/openssl/include/openssl/tls1.h
@@ -0,0 +1,810 @@
+/* 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 RFC7301 */
+# define TLSEXT_TYPE_application_layer_protocol_negotiation 16
+
+/*
+ * ExtensionType value for TLS padding extension.
+ * http://tools.ietf.org/html/draft-agl-tls-padding
+ */
+# 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 RFC3546 */
+# define TLSEXT_NAMETYPE_host_name 0
+/* status request value from RFC3546 */
+# define TLSEXT_STATUSTYPE_ocsp 1
+
+/* ECPointFormat values from RFC4492 */
+# 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 RFC5246 */
+# 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 RFC4492 */
+# 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/libs/tgl/openssl/include/openssl/ts.h b/libs/tgl/openssl/include/openssl/ts.h
new file mode 100644
index 0000000000..16eccbb38d
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/txt_db.h b/libs/tgl/openssl/include/openssl/txt_db.h
new file mode 100644
index 0000000000..98e23a2003
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/ui.h b/libs/tgl/openssl/include/openssl/ui.h
new file mode 100644
index 0000000000..0dc16330b8
--- /dev/null
+++ b/libs/tgl/openssl/include/openssl/ui.h
@@ -0,0 +1,415 @@
+/* crypto/ui/ui.h */
+/*
+ * 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/libs/tgl/openssl/include/openssl/ui_compat.h b/libs/tgl/openssl/include/openssl/ui_compat.h
new file mode 100644
index 0000000000..bf541542c0
--- /dev/null
+++ b/libs/tgl/openssl/include/openssl/ui_compat.h
@@ -0,0 +1,88 @@
+/* crypto/ui/ui.h */
+/*
+ * 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/libs/tgl/openssl/include/openssl/whrlpool.h b/libs/tgl/openssl/include/openssl/whrlpool.h
new file mode 100644
index 0000000000..73c749da81
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/x509.h b/libs/tgl/openssl/include/openssl/x509.h
new file mode 100644
index 0000000000..99337b849a
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/include/openssl/x509_vfy.h b/libs/tgl/openssl/include/openssl/x509_vfy.h
new file mode 100644
index 0000000000..2663e1c0a3
--- /dev/null
+++ b/libs/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
+# define X509_V_ERR_UNSPECIFIED 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/libs/tgl/openssl/include/openssl/x509v3.h b/libs/tgl/openssl/include/openssl/x509v3.h
new file mode 100644
index 0000000000..f5c61560aa
--- /dev/null
+++ b/libs/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/libs/tgl/openssl/lib/x64/Debug/2010/libeay32MTd.lib b/libs/tgl/openssl/lib/x64/Debug/2010/libeay32MTd.lib
new file mode 100644
index 0000000000..c65d581eaf
--- /dev/null
+++ b/libs/tgl/openssl/lib/x64/Debug/2010/libeay32MTd.lib
Binary files differ
diff --git a/libs/tgl/openssl/lib/x64/Debug/2010/ssleay32MTd.lib b/libs/tgl/openssl/lib/x64/Debug/2010/ssleay32MTd.lib
new file mode 100644
index 0000000000..fd31f8bd3a
--- /dev/null
+++ b/libs/tgl/openssl/lib/x64/Debug/2010/ssleay32MTd.lib
Binary files differ
diff --git a/libs/tgl/openssl/lib/x64/Debug/2013/libeay32MTd.lib b/libs/tgl/openssl/lib/x64/Debug/2013/libeay32MTd.lib
new file mode 100644
index 0000000000..3f92910463
--- /dev/null
+++ b/libs/tgl/openssl/lib/x64/Debug/2013/libeay32MTd.lib
Binary files differ
diff --git a/libs/tgl/openssl/lib/x64/Debug/2013/ssleay32MTd.lib b/libs/tgl/openssl/lib/x64/Debug/2013/ssleay32MTd.lib
new file mode 100644
index 0000000000..831060bda2
--- /dev/null
+++ b/libs/tgl/openssl/lib/x64/Debug/2013/ssleay32MTd.lib
Binary files differ
diff --git a/libs/tgl/openssl/lib/x64/Debug/2015/libeay32MTd.lib b/libs/tgl/openssl/lib/x64/Debug/2015/libeay32MTd.lib
new file mode 100644
index 0000000000..291d09f41f
--- /dev/null
+++ b/libs/tgl/openssl/lib/x64/Debug/2015/libeay32MTd.lib
Binary files differ
diff --git a/libs/tgl/openssl/lib/x64/Debug/2015/ssleay32MTd.lib b/libs/tgl/openssl/lib/x64/Debug/2015/ssleay32MTd.lib
new file mode 100644
index 0000000000..b6b2720338
--- /dev/null
+++ b/libs/tgl/openssl/lib/x64/Debug/2015/ssleay32MTd.lib
Binary files differ
diff --git a/libs/tgl/openssl/lib/x64/Release/2010/libeay32MT.lib b/libs/tgl/openssl/lib/x64/Release/2010/libeay32MT.lib
new file mode 100644
index 0000000000..c51bba52c5
--- /dev/null
+++ b/libs/tgl/openssl/lib/x64/Release/2010/libeay32MT.lib
Binary files differ
diff --git a/libs/tgl/openssl/lib/x64/Release/2010/ssleay32MT.lib b/libs/tgl/openssl/lib/x64/Release/2010/ssleay32MT.lib
new file mode 100644
index 0000000000..e9c6e0debb
--- /dev/null
+++ b/libs/tgl/openssl/lib/x64/Release/2010/ssleay32MT.lib
Binary files differ
diff --git a/libs/tgl/openssl/lib/x64/Release/2013/libeay32MT.lib b/libs/tgl/openssl/lib/x64/Release/2013/libeay32MT.lib
new file mode 100644
index 0000000000..294494c46b
--- /dev/null
+++ b/libs/tgl/openssl/lib/x64/Release/2013/libeay32MT.lib
Binary files differ
diff --git a/libs/tgl/openssl/lib/x64/Release/2013/ssleay32MT.lib b/libs/tgl/openssl/lib/x64/Release/2013/ssleay32MT.lib
new file mode 100644
index 0000000000..20590adf1d
--- /dev/null
+++ b/libs/tgl/openssl/lib/x64/Release/2013/ssleay32MT.lib
Binary files differ
diff --git a/libs/tgl/openssl/lib/x64/Release/2015/libeay32MT.lib b/libs/tgl/openssl/lib/x64/Release/2015/libeay32MT.lib
new file mode 100644
index 0000000000..3bd7cd2685
--- /dev/null
+++ b/libs/tgl/openssl/lib/x64/Release/2015/libeay32MT.lib
Binary files differ
diff --git a/libs/tgl/openssl/lib/x64/Release/2015/ssleay32MT.lib b/libs/tgl/openssl/lib/x64/Release/2015/ssleay32MT.lib
new file mode 100644
index 0000000000..2bdb6bcc5f
--- /dev/null
+++ b/libs/tgl/openssl/lib/x64/Release/2015/ssleay32MT.lib
Binary files differ
diff --git a/libs/tgl/openssl/lib/x86/Debug/2010/libeay32MTd.lib b/libs/tgl/openssl/lib/x86/Debug/2010/libeay32MTd.lib
new file mode 100644
index 0000000000..c1a3f245fc
--- /dev/null
+++ b/libs/tgl/openssl/lib/x86/Debug/2010/libeay32MTd.lib
Binary files differ
diff --git a/libs/tgl/openssl/lib/x86/Debug/2010/ssleay32MTd.lib b/libs/tgl/openssl/lib/x86/Debug/2010/ssleay32MTd.lib
new file mode 100644
index 0000000000..309072e8a3
--- /dev/null
+++ b/libs/tgl/openssl/lib/x86/Debug/2010/ssleay32MTd.lib
Binary files differ
diff --git a/libs/tgl/openssl/lib/x86/Debug/2013/libeay32MTd.lib b/libs/tgl/openssl/lib/x86/Debug/2013/libeay32MTd.lib
new file mode 100644
index 0000000000..65162bdd79
--- /dev/null
+++ b/libs/tgl/openssl/lib/x86/Debug/2013/libeay32MTd.lib
Binary files differ
diff --git a/libs/tgl/openssl/lib/x86/Debug/2013/ssleay32MTd.lib b/libs/tgl/openssl/lib/x86/Debug/2013/ssleay32MTd.lib
new file mode 100644
index 0000000000..4de31bc46c
--- /dev/null
+++ b/libs/tgl/openssl/lib/x86/Debug/2013/ssleay32MTd.lib
Binary files differ
diff --git a/libs/tgl/openssl/lib/x86/Debug/2015/libeay32MTd.lib b/libs/tgl/openssl/lib/x86/Debug/2015/libeay32MTd.lib
new file mode 100644
index 0000000000..98515ce2d5
--- /dev/null
+++ b/libs/tgl/openssl/lib/x86/Debug/2015/libeay32MTd.lib
Binary files differ
diff --git a/libs/tgl/openssl/lib/x86/Debug/2015/ssleay32MTd.lib b/libs/tgl/openssl/lib/x86/Debug/2015/ssleay32MTd.lib
new file mode 100644
index 0000000000..da7be9628c
--- /dev/null
+++ b/libs/tgl/openssl/lib/x86/Debug/2015/ssleay32MTd.lib
Binary files differ
diff --git a/libs/tgl/openssl/lib/x86/Release/2010/libeay32MT.lib b/libs/tgl/openssl/lib/x86/Release/2010/libeay32MT.lib
new file mode 100644
index 0000000000..679345df7f
--- /dev/null
+++ b/libs/tgl/openssl/lib/x86/Release/2010/libeay32MT.lib
Binary files differ
diff --git a/libs/tgl/openssl/lib/x86/Release/2010/ssleay32MT.lib b/libs/tgl/openssl/lib/x86/Release/2010/ssleay32MT.lib
new file mode 100644
index 0000000000..ce5dcf76c5
--- /dev/null
+++ b/libs/tgl/openssl/lib/x86/Release/2010/ssleay32MT.lib
Binary files differ
diff --git a/libs/tgl/openssl/lib/x86/Release/2013/libeay32MT.lib b/libs/tgl/openssl/lib/x86/Release/2013/libeay32MT.lib
new file mode 100644
index 0000000000..42ee039d0b
--- /dev/null
+++ b/libs/tgl/openssl/lib/x86/Release/2013/libeay32MT.lib
Binary files differ
diff --git a/libs/tgl/openssl/lib/x86/Release/2013/ssleay32MT.lib b/libs/tgl/openssl/lib/x86/Release/2013/ssleay32MT.lib
new file mode 100644
index 0000000000..74954a6e41
--- /dev/null
+++ b/libs/tgl/openssl/lib/x86/Release/2013/ssleay32MT.lib
Binary files differ
diff --git a/libs/tgl/openssl/lib/x86/Release/2015/libeay32MT.lib b/libs/tgl/openssl/lib/x86/Release/2015/libeay32MT.lib
new file mode 100644
index 0000000000..267e7fc66d
--- /dev/null
+++ b/libs/tgl/openssl/lib/x86/Release/2015/libeay32MT.lib
Binary files differ
diff --git a/libs/tgl/openssl/lib/x86/Release/2015/ssleay32MT.lib b/libs/tgl/openssl/lib/x86/Release/2015/ssleay32MT.lib
new file mode 100644
index 0000000000..af04a4238a
--- /dev/null
+++ b/libs/tgl/openssl/lib/x86/Release/2015/ssleay32MT.lib
Binary files differ
diff --git a/libs/tgl/src/auto-static-autocomplete.c b/libs/tgl/src/auto-static-autocomplete.c
new file mode 100644
index 0000000000..43ec4cc02e
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto-static-fetch-ds.c b/libs/tgl/src/auto-static-fetch-ds.c
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/libs/tgl/src/auto-static-fetch-ds.c
diff --git a/libs/tgl/src/auto-static-fetch.c b/libs/tgl/src/auto-static-fetch.c
new file mode 100644
index 0000000000..4d4e47cc5c
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto-static-free-ds.c b/libs/tgl/src/auto-static-free-ds.c
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/libs/tgl/src/auto-static-free-ds.c
diff --git a/libs/tgl/src/auto-static-print-ds.c b/libs/tgl/src/auto-static-print-ds.c
new file mode 100644
index 0000000000..cfec470fcc
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto-static-print.c b/libs/tgl/src/auto-static-print.c
new file mode 100644
index 0000000000..3c4e810fad
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto-static-skip.c b/libs/tgl/src/auto-static-skip.c
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/libs/tgl/src/auto-static-skip.c
diff --git a/libs/tgl/src/auto-static-store-ds.c b/libs/tgl/src/auto-static-store-ds.c
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/libs/tgl/src/auto-static-store-ds.c
diff --git a/libs/tgl/src/auto-static-store.c b/libs/tgl/src/auto-static-store.c
new file mode 100644
index 0000000000..bff0cb5f84
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto-static.c b/libs/tgl/src/auto-static.c
new file mode 100644
index 0000000000..89a0a176bf
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto.h b/libs/tgl/src/auto.h
new file mode 100644
index 0000000000..b2e216aff3
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto/auto-autocomplete.c b/libs/tgl/src/auto/auto-autocomplete.c
new file mode 100644
index 0000000000..e0f5d4a990
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto/auto-autocomplete.h b/libs/tgl/src/auto/auto-autocomplete.h
new file mode 100644
index 0000000000..1e58313e55
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto/auto-fetch-ds.c b/libs/tgl/src/auto/auto-fetch-ds.c
new file mode 100644
index 0000000000..da360323a0
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto/auto-fetch-ds.h b/libs/tgl/src/auto/auto-fetch-ds.h
new file mode 100644
index 0000000000..6c39473b14
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto/auto-fetch.c b/libs/tgl/src/auto/auto-fetch.c
new file mode 100644
index 0000000000..adb2ef789d
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto/auto-fetch.h b/libs/tgl/src/auto/auto-fetch.h
new file mode 100644
index 0000000000..803f7b6902
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto/auto-free-ds.c b/libs/tgl/src/auto/auto-free-ds.c
new file mode 100644
index 0000000000..1538633aff
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto/auto-free-ds.h b/libs/tgl/src/auto/auto-free-ds.h
new file mode 100644
index 0000000000..7785aa0141
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto/auto-print-ds.c b/libs/tgl/src/auto/auto-print-ds.c
new file mode 100644
index 0000000000..6ca075d912
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto/auto-print-ds.h b/libs/tgl/src/auto/auto-print-ds.h
new file mode 100644
index 0000000000..2f74cd9f17
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto/auto-skip.c b/libs/tgl/src/auto/auto-skip.c
new file mode 100644
index 0000000000..9ff28a1de2
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto/auto-skip.h b/libs/tgl/src/auto/auto-skip.h
new file mode 100644
index 0000000000..f26a800b1a
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto/auto-store-ds.c b/libs/tgl/src/auto/auto-store-ds.c
new file mode 100644
index 0000000000..1a5356e4d0
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto/auto-store-ds.h b/libs/tgl/src/auto/auto-store-ds.h
new file mode 100644
index 0000000000..4abc26b3ce
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto/auto-store.c b/libs/tgl/src/auto/auto-store.c
new file mode 100644
index 0000000000..50d5ff7970
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto/auto-store.h b/libs/tgl/src/auto/auto-store.h
new file mode 100644
index 0000000000..9a7a737ad2
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto/auto-types.c b/libs/tgl/src/auto/auto-types.c
new file mode 100644
index 0000000000..d81edf0949
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto/auto-types.h b/libs/tgl/src/auto/auto-types.h
new file mode 100644
index 0000000000..74e8de9039
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto/constants.h b/libs/tgl/src/auto/constants.h
new file mode 100644
index 0000000000..643496f2d2
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto/scheme.tl b/libs/tgl/src/auto/scheme.tl
new file mode 100644
index 0000000000..e95425f435
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/auto/scheme.tlo b/libs/tgl/src/auto/scheme.tlo
new file mode 100644
index 0000000000..02d3ca415e
--- /dev/null
+++ b/libs/tgl/src/auto/scheme.tlo
Binary files differ
diff --git a/libs/tgl/src/auto/scheme2.tl b/libs/tgl/src/auto/scheme2.tl
new file mode 100644
index 0000000000..1867166cb2
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/binlog.c b/libs/tgl/src/binlog.c
new file mode 100644
index 0000000000..74a47b38c2
--- /dev/null
+++ b/libs/tgl/src/binlog.c
@@ -0,0 +1,1830 @@
+/*
+ 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 <share.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/libs/tgl/src/binlog.tl b/libs/tgl/src/binlog.tl
new file mode 100644
index 0000000000..a0c52424d7
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/config.h b/libs/tgl/src/config.h
new file mode 100644
index 0000000000..eaca5156db
--- /dev/null
+++ b/libs/tgl/src/config.h
@@ -0,0 +1,162 @@
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* disable extf queries */
+// #undef DISABLE_EXTF
+
+/* Use libevent v1 */
+//#undef EVENT_V1
+
+/* Use libevent v2 */
+#define EVENT_V2 1
+
+/* 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. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `event' library (-levent). */
+// #undef HAVE_LIBEVENT
+
+/* Define to 1 if you have the `m' library (-lm). */
+#define HAVE_LIBM 1
+
+/* Define to 1 if you have `z' library (-lz) */
+#define HAVE_LIBZ 1
+
+/* 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. */
+#define HAVE_MALLOC 1
+
+/* Define to 1 if you have the <malloc.h> header file. */
+#define HAVE_MALLOC_H 1
+
+/* Define to 1 if you have the `memmove' function. */
+#define HAVE_MEMMOVE 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `memset' function. */
+#define HAVE_MEMSET 1
+
+/* Define to 1 if you have the `mkdir' function. */
+#define HAVE_MKDIR 1
+
+/* 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. */
+#define HAVE_REALLOC 1
+
+/* Define to 1 if you have the `select' function. */
+#define HAVE_SELECT 1
+
+/* Define to 1 if you have the `socket' function. */
+#define HAVE_SOCKET 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `strdup' function. */
+#define HAVE_STRDUP 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+// #undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strndup' function. */
+#define HAVE_STRNDUP 1
+
+/* 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. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <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. */
+#define PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "telegram-cli"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "telegram-cli 1.0"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "telegram-cli"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "1.0"
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* fixed for correct valgrind work */
+// #undef VALGRIND_FIXES
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#define gid_t int
+
+/* 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
+#define inline __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. */
+#define uid_t int
diff --git a/libs/tgl/src/encrypted_scheme.tl b/libs/tgl/src/encrypted_scheme.tl
new file mode 100644
index 0000000000..6fff5b6a55
--- /dev/null
+++ b/libs/tgl/src/encrypted_scheme.tl
@@ -0,0 +1 @@
+encrypted_scheme23.tl \ No newline at end of file
diff --git a/libs/tgl/src/encrypted_scheme16.tl b/libs/tgl/src/encrypted_scheme16.tl
new file mode 100644
index 0000000000..eb58ed4475
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/encrypted_scheme17.tl b/libs/tgl/src/encrypted_scheme17.tl
new file mode 100644
index 0000000000..95e661bda5
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/encrypted_scheme18.tl b/libs/tgl/src/encrypted_scheme18.tl
new file mode 100644
index 0000000000..134f719973
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/encrypted_scheme23.tl b/libs/tgl/src/encrypted_scheme23.tl
new file mode 100644
index 0000000000..ae31312de1
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/errors b/libs/tgl/src/errors
new file mode 100644
index 0000000000..481a144737
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/event-old.h b/libs/tgl/src/event-old.h
new file mode 100644
index 0000000000..b920e68f02
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/generate.c b/libs/tgl/src/generate.c
new file mode 100644
index 0000000000..68bf30272d
--- /dev/null
+++ b/libs/tgl/src/generate.c
@@ -0,0 +1,3219 @@
+/*
+ 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 <share.h>
+#include <assert.h>
+#include <string.h>
+
+#include "..\tl-parser\src\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/libs/tgl/src/generate.h b/libs/tgl/src/generate.h
new file mode 100644
index 0000000000..5d46a6c4ec
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/mime-types.c b/libs/tgl/src/mime-types.c
new file mode 100644
index 0000000000..0110d3fa2e
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/mtproto-client.c b/libs/tgl/src/mtproto-client.c
new file mode 100644
index 0000000000..37530b5afb
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/mtproto-client.h b/libs/tgl/src/mtproto-client.h
new file mode 100644
index 0000000000..13a98fd406
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/mtproto-common.c b/libs/tgl/src/mtproto-common.c
new file mode 100644
index 0000000000..32a9597639
--- /dev/null
+++ b/libs/tgl/src/mtproto-common.c
@@ -0,0 +1,475 @@
+/*
+ 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 <share.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/libs/tgl/src/mtproto-common.h b/libs/tgl/src/mtproto-common.h
new file mode 100644
index 0000000000..afcea1eeb4
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/mtproto-utils.c b/libs/tgl/src/mtproto-utils.c
new file mode 100644
index 0000000000..481bff6371
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/mtproto-utils.h b/libs/tgl/src/mtproto-utils.h
new file mode 100644
index 0000000000..e9bb6aeef3
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/mtproto.tl b/libs/tgl/src/mtproto.tl
new file mode 100644
index 0000000000..2f02c49ae8
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/no-preview.h b/libs/tgl/src/no-preview.h
new file mode 100644
index 0000000000..cf2651d9d2
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/queries-encrypted.c b/libs/tgl/src/queries-encrypted.c
new file mode 100644
index 0000000000..cdfea63029
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/queries.c b/libs/tgl/src/queries.c
new file mode 100644
index 0000000000..374f78e1f1
--- /dev/null
+++ b/libs/tgl/src/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 <share.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/libs/tgl/src/queries.h b/libs/tgl/src/queries.h
new file mode 100644
index 0000000000..9665667d55
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/scheme.tl b/libs/tgl/src/scheme.tl
new file mode 100644
index 0000000000..a38980aea4
--- /dev/null
+++ b/libs/tgl/src/scheme.tl
@@ -0,0 +1 @@
+scheme31.tl \ No newline at end of file
diff --git a/libs/tgl/src/scheme12.tl b/libs/tgl/src/scheme12.tl
new file mode 100644
index 0000000000..7d37a6fdc5
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/scheme15.tl b/libs/tgl/src/scheme15.tl
new file mode 100644
index 0000000000..4e18fad21b
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/scheme16.tl b/libs/tgl/src/scheme16.tl
new file mode 100644
index 0000000000..b1e1f196d8
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/scheme17.tl b/libs/tgl/src/scheme17.tl
new file mode 100644
index 0000000000..c564155c19
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/scheme18.tl b/libs/tgl/src/scheme18.tl
new file mode 100644
index 0000000000..6b7fdd5fc4
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/scheme19.tl b/libs/tgl/src/scheme19.tl
new file mode 100644
index 0000000000..732093a02a
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/scheme22.tl b/libs/tgl/src/scheme22.tl
new file mode 100644
index 0000000000..1ed65373e0
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/scheme25.tl b/libs/tgl/src/scheme25.tl
new file mode 100644
index 0000000000..89447c4ff2
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/scheme28.tl b/libs/tgl/src/scheme28.tl
new file mode 100644
index 0000000000..302731ef77
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/scheme30.tl b/libs/tgl/src/scheme30.tl
new file mode 100644
index 0000000000..d6c9b7cf87
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/scheme31.tl b/libs/tgl/src/scheme31.tl
new file mode 100644
index 0000000000..83a2084170
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/structures.c b/libs/tgl/src/structures.c
new file mode 100644
index 0000000000..a680e4c415
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/tg-mime-types.c b/libs/tgl/src/tg-mime-types.c
new file mode 100644
index 0000000000..578d8da780
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/tg-mime-types.h b/libs/tgl/src/tg-mime-types.h
new file mode 100644
index 0000000000..3a3539e56a
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/tgl-binlog.h b/libs/tgl/src/tgl-binlog.h
new file mode 100644
index 0000000000..fdd838f70c
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/tgl-fetch.h b/libs/tgl/src/tgl-fetch.h
new file mode 100644
index 0000000000..37b2ac5d1d
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/tgl-inner.h b/libs/tgl/src/tgl-inner.h
new file mode 100644
index 0000000000..2ffa932762
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/tgl-layout.h b/libs/tgl/src/tgl-layout.h
new file mode 100644
index 0000000000..fee5b2c3d6
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/tgl-methods-in.h b/libs/tgl/src/tgl-methods-in.h
new file mode 100644
index 0000000000..0d149db7d6
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/tgl-net-inner.h b/libs/tgl/src/tgl-net-inner.h
new file mode 100644
index 0000000000..53b9c10dfe
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/tgl-net.c b/libs/tgl/src/tgl-net.c
new file mode 100644
index 0000000000..7439ee145d
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/tgl-net.h b/libs/tgl/src/tgl-net.h
new file mode 100644
index 0000000000..6c589a4a38
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/tgl-structures.h b/libs/tgl/src/tgl-structures.h
new file mode 100644
index 0000000000..4e3fd9ec32
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/tgl-timers.c b/libs/tgl/src/tgl-timers.c
new file mode 100644
index 0000000000..d68f9ac0ec
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/tgl-timers.h b/libs/tgl/src/tgl-timers.h
new file mode 100644
index 0000000000..7f52f3bd15
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/tgl.c b/libs/tgl/src/tgl.c
new file mode 100644
index 0000000000..dd4f2713c9
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/tgl.h b/libs/tgl/src/tgl.h
new file mode 100644
index 0000000000..2da8c7a254
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/tools.c b/libs/tgl/src/tools.c
new file mode 100644
index 0000000000..e4022c0ca1
--- /dev/null
+++ b/libs/tgl/src/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\src\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/libs/tgl/src/tools.h b/libs/tgl/src/tools.h
new file mode 100644
index 0000000000..9484e60bf1
--- /dev/null
+++ b/libs/tgl/src/tools.h
@@ -0,0 +1,142 @@
+/*
+ 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
+
+struct _timespec32
+{
+ __time32_t tv_sec;
+ long tv_nsec;
+};
+
+struct _timespec64
+{
+ __time64_t tv_sec;
+ long tv_nsec;
+};
+
+#ifndef _CRT_NO_TIME_T
+struct timespec
+{
+ time_t tv_sec; // Seconds - >= 0
+ long tv_nsec; // Nanoseconds - [0, 999999999]
+};
+#endif
+
+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/libs/tgl/src/tree.h b/libs/tgl/src/tree.h
new file mode 100644
index 0000000000..18feb3aed5
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/updates.c b/libs/tgl/src/updates.c
new file mode 100644
index 0000000000..0f4b209f54
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/updates.h b/libs/tgl/src/updates.h
new file mode 100644
index 0000000000..98f4654544
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/wingetopt.c b/libs/tgl/src/wingetopt.c
new file mode 100644
index 0000000000..09dac17a4f
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/src/wingetopt.h b/libs/tgl/src/wingetopt.h
new file mode 100644
index 0000000000..4372c66011
--- /dev/null
+++ b/libs/tgl/src/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/libs/tgl/tgl.vcxproj.filters b/libs/tgl/tgl.vcxproj.filters
new file mode 100644
index 0000000000..595ba5ec91
--- /dev/null
+++ b/libs/tgl/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="src\auto.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\event-old.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\mtproto-client.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\mtproto-common.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\mtproto-utils.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\no-preview.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\queries.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\tg-mime-types.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\tgl-binlog.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\tgl-fetch.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\tgl-inner.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\tgl-layout.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\tgl-methods-in.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\tgl-net-inner.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\tgl-net.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\tgl-structures.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\tgl-timers.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\tgl.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\tools.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\tree.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\updates.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="src\auto\auto-autocomplete.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\auto\auto-fetch-ds.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\auto\auto-fetch.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\auto\auto-free-ds.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\auto\auto-print-ds.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\auto\auto-skip.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\auto\auto-store-ds.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\auto\auto-store.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\auto\auto-types.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\binlog.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\mime-types.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\mtproto-client.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\mtproto-common.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\mtproto-utils.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\queries.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\structures.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\tg-mime-types.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\tgl-net.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\tgl-timers.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\tgl.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\tools.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\updates.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/libs/tgl/tgl_12.vcxproj b/libs/tgl/tgl_12.vcxproj
new file mode 100644
index 0000000000..281c30f3fb
--- /dev/null
+++ b/libs/tgl/tgl_12.vcxproj
@@ -0,0 +1,192 @@
+<?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>{C3106192-32AD-442F-A3A2-E3CFB63F0CF1}</ProjectGuid>
+ <ProjectName>tgl</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </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>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\Libs\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)64\Libs\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\Obj\$(ProjectName)\</IntDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\Libs\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64\Libs\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\Obj\$(ProjectName)\</IntDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\</IntDir>
+ <IgnoreImportLibrary>true</IgnoreImportLibrary>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>openssl\include;libevent\include\;libevent\WIN32-Code\nmake\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Lib>
+ <AdditionalDependencies>libevent.lib;libeay32MTd.lib;ssleay32MTd.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>openssl\lib\x86\Debug\2013;libevent\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>openssl\include;libevent\include\;libevent\WIN32-Code\nmake\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Lib>
+ <AdditionalDependencies>libevent.lib;libeay32MTd.lib;ssleay32MTd.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>openssl\lib\x64\Debug\2013;libevent\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Full</Optimization>
+ <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>openssl\include;libevent\include\;libevent\WIN32-Code\nmake\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Lib>
+ <AdditionalDependencies>libevent.lib;libeay32MT.lib;ssleay32MT.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>openssl\lib\x86\Release\2013;libevent\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Full</Optimization>
+ <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>openssl\include;libevent\include\;libevent\WIN32-Code\nmake\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Lib>
+ <AdditionalDependencies>libevent.lib;libeay32MT.lib;ssleay32MT.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>openssl\lib\x64\Release\2013;libevent\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="src\auto.h" />
+ <ClInclude Include="src\event-old.h" />
+ <ClInclude Include="src\mtproto-client.h" />
+ <ClInclude Include="src\mtproto-common.h" />
+ <ClInclude Include="src\mtproto-utils.h" />
+ <ClInclude Include="src\no-preview.h" />
+ <ClInclude Include="src\queries.h" />
+ <ClInclude Include="src\tg-mime-types.h" />
+ <ClInclude Include="src\tgl-binlog.h" />
+ <ClInclude Include="src\tgl-fetch.h" />
+ <ClInclude Include="src\tgl-inner.h" />
+ <ClInclude Include="src\tgl-layout.h" />
+ <ClInclude Include="src\tgl-methods-in.h" />
+ <ClInclude Include="src\tgl-net-inner.h" />
+ <ClInclude Include="src\tgl-net.h" />
+ <ClInclude Include="src\tgl-structures.h" />
+ <ClInclude Include="src\tgl-timers.h" />
+ <ClInclude Include="src\tgl.h" />
+ <ClInclude Include="src\tools.h" />
+ <ClInclude Include="src\tree.h" />
+ <ClInclude Include="src\updates.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="src\auto\auto-autocomplete.c" />
+ <ClCompile Include="src\auto\auto-fetch-ds.c" />
+ <ClCompile Include="src\auto\auto-fetch.c" />
+ <ClCompile Include="src\auto\auto-free-ds.c" />
+ <ClCompile Include="src\auto\auto-print-ds.c" />
+ <ClCompile Include="src\auto\auto-skip.c" />
+ <ClCompile Include="src\auto\auto-store-ds.c" />
+ <ClCompile Include="src\auto\auto-store.c" />
+ <ClCompile Include="src\auto\auto-types.c" />
+ <ClCompile Include="src\binlog.c" />
+ <ClCompile Include="src\mime-types.c" />
+ <ClCompile Include="src\mtproto-client.c" />
+ <ClCompile Include="src\mtproto-common.c" />
+ <ClCompile Include="src\mtproto-utils.c" />
+ <ClCompile Include="src\queries.c" />
+ <ClCompile Include="src\structures.c" />
+ <ClCompile Include="src\tg-mime-types.c" />
+ <ClCompile Include="src\tgl-net.c" />
+ <ClCompile Include="src\tgl-timers.c" />
+ <ClCompile Include="src\tgl.c" />
+ <ClCompile Include="src\tools.c" />
+ <ClCompile Include="src\updates.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\zlib\zlib.vcxproj">
+ <Project>{e2a369cd-eda3-414f-8ad0-e732cd7ee68c}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="generate_12.vcxproj">
+ <Project>{03A484BF-4CF0-4290-9BD2-D649F0797703}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="tl-parser\tl-parser_12.vcxproj">
+ <Project>{14022761-9F27-4A2D-B7EA-F41FB9B3274C}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/libs/tgl/tl-parser/docs/LICENSE b/libs/tgl/tl-parser/docs/LICENSE
new file mode 100644
index 0000000000..d159169d10
--- /dev/null
+++ b/libs/tgl/tl-parser/docs/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/libs/tgl/tl-parser/docs/Makefile.in b/libs/tgl/tl-parser/docs/Makefile.in
new file mode 100644
index 0000000000..446f49afdb
--- /dev/null
+++ b/libs/tgl/tl-parser/docs/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/libs/tgl/tl-parser/docs/README.md b/libs/tgl/tl-parser/docs/README.md
new file mode 100644
index 0000000000..ce211a248a
--- /dev/null
+++ b/libs/tgl/tl-parser/docs/README.md
@@ -0,0 +1 @@
+Parse tl scheme to tlo file. Formely part of telegram-cli
diff --git a/libs/tgl/tl-parser/docs/config.bat b/libs/tgl/tl-parser/docs/config.bat
new file mode 100644
index 0000000000..bc8cb80292
--- /dev/null
+++ b/libs/tgl/tl-parser/docs/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=src\config.h.in
+set CONFIG_HEADER=config.h
+set DEFAULT_OUT_FOLDER=src
+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/libs/tgl/tl-parser/docs/config.h.in b/libs/tgl/tl-parser/docs/config.h.in
new file mode 100644
index 0000000000..6cffe69f2b
--- /dev/null
+++ b/libs/tgl/tl-parser/docs/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/libs/tgl/tl-parser/docs/configure b/libs/tgl/tl-parser/docs/configure
new file mode 100644
index 0000000000..6ba3c417da
--- /dev/null
+++ b/libs/tgl/tl-parser/docs/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/libs/tgl/tl-parser/docs/configure.ac b/libs/tgl/tl-parser/docs/configure.ac
new file mode 100644
index 0000000000..82d1c6b027
--- /dev/null
+++ b/libs/tgl/tl-parser/docs/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/libs/tgl/tl-parser/docs/m4-ax_gcc_builtin.m4 b/libs/tgl/tl-parser/docs/m4-ax_gcc_builtin.m4
new file mode 100644
index 0000000000..b28a91b14a
--- /dev/null
+++ b/libs/tgl/tl-parser/docs/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/libs/tgl/tl-parser/src/config.h b/libs/tgl/tl-parser/src/config.h
new file mode 100644
index 0000000000..a41afdc1d6
--- /dev/null
+++ b/libs/tgl/tl-parser/src/config.h
@@ -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. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `z' library (-lz). */
+#define HAVE_LIBZ 1
+
+/* 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. */
+#define HAVE_MALLOC 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `memset' function. */
+#define HAVE_MEMSET 1
+
+/* Define to 1 if your system has a GNU libc compatible `realloc' function,
+ and to 0 otherwise. */
+#define HAVE_REALLOC 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `strdup' function. */
+#define HAVE_STRDUP 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+// #undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+// #undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <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. */
+#define PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "tl-parser"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "tl-parser 1.0"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "tl-parser"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "1.0"
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* 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
+#define inline __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/libs/tgl/tl-parser/src/portable_endian.h b/libs/tgl/tl-parser/src/portable_endian.h
new file mode 100644
index 0000000000..b39a51ea63
--- /dev/null
+++ b/libs/tgl/tl-parser/src/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/libs/tgl/tl-parser/src/tl-parser-tree.h b/libs/tgl/tl-parser/src/tl-parser-tree.h
new file mode 100644
index 0000000000..fba7c67521
--- /dev/null
+++ b/libs/tgl/tl-parser/src/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/libs/tgl/tl-parser/src/tl-parser.c b/libs/tgl/tl-parser/src/tl-parser.c
new file mode 100644
index 0000000000..22a01051ea
--- /dev/null
+++ b/libs/tgl/tl-parser/src/tl-parser.c
@@ -0,0 +1,3112 @@
+/*
+ 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 <share.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+#include <time.h>
+#include "portable_endian.h"
+#include "..\..\..\zlib\src\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/libs/tgl/tl-parser/src/tl-parser.h b/libs/tgl/tl-parser/src/tl-parser.h
new file mode 100644
index 0000000000..7eb7524787
--- /dev/null
+++ b/libs/tgl/tl-parser/src/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/libs/tgl/tl-parser/src/tl-tl.h b/libs/tgl/tl-parser/src/tl-tl.h
new file mode 100644
index 0000000000..8bc0a707bc
--- /dev/null
+++ b/libs/tgl/tl-parser/src/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/libs/tgl/tl-parser/src/tlc.c b/libs/tgl/tl-parser/src/tlc.c
new file mode 100644
index 0000000000..e5043f31a3
--- /dev/null
+++ b/libs/tgl/tl-parser/src/tlc.c
@@ -0,0 +1,180 @@
+/*
+ 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 <share.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/libs/tgl/tl-parser/src/wingetopt.c b/libs/tgl/tl-parser/src/wingetopt.c
new file mode 100644
index 0000000000..09dac17a4f
--- /dev/null
+++ b/libs/tgl/tl-parser/src/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/libs/tgl/tl-parser/src/wingetopt.h b/libs/tgl/tl-parser/src/wingetopt.h
new file mode 100644
index 0000000000..4372c66011
--- /dev/null
+++ b/libs/tgl/tl-parser/src/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/libs/tgl/tl-parser/tl-parser.vcxproj.filters b/libs/tgl/tl-parser/tl-parser.vcxproj.filters
new file mode 100644
index 0000000000..ea695731d6
--- /dev/null
+++ b/libs/tgl/tl-parser/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="src\portable_endian.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\tl-parser.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\tl-parser-tree.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\tl-tl.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\config.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\wingetopt.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="src\tlc.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\tl-parser.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\wingetopt.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/libs/tgl/tl-parser/tl-parser_12.vcxproj b/libs/tgl/tl-parser/tl-parser_12.vcxproj
new file mode 100644
index 0000000000..0f2047dcd9
--- /dev/null
+++ b/libs/tgl/tl-parser/tl-parser_12.vcxproj
@@ -0,0 +1,150 @@
+<?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>{14022761-9F27-4A2D-B7EA-F41FB9B3274C}</ProjectGuid>
+ <ProjectName>tl-parser</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </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>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\bin\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)64\bin\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\Obj\$(ProjectName)\</IntDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\bin\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64\bin\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\Obj\$(ProjectName)\</IntDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\</IntDir>
+ <IgnoreImportLibrary>true</IgnoreImportLibrary>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Full</Optimization>
+ <PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ <PreBuildEvent />
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Full</Optimization>
+ <PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="src\portable_endian.h" />
+ <ClInclude Include="src\tl-parser-tree.h" />
+ <ClInclude Include="src\tl-parser.h" />
+ <ClInclude Include="src\tl-tl.h" />
+ <ClInclude Include="src\config.h" />
+ <ClInclude Include="src\wingetopt.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="src\tl-parser.c" />
+ <ClCompile Include="src\tlc.c" />
+ <ClCompile Include="src\wingetopt.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\zlib\zlib.vcxproj">
+ <Project>{e2a369cd-eda3-414f-8ad0-e732cd7ee68c}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file