Full Code of vysheng/tgl for AI

master ffb04caca71d cached
88 files
1.3 MB
615.4k tokens
1773 symbols
1 requests
Download .txt
Showing preview only (1,399K chars total). Download the full file or copy to clipboard to get everything.
Repository: vysheng/tgl
Branch: master
Commit: ffb04caca71d
Files: 88
Total size: 1.3 MB

Directory structure:
gitextract_7j9eshnc/

├── .gitignore
├── .gitmodules
├── CHANGELOG
├── LICENSE
├── Makefile.in
├── Makefile.tl-parser
├── README.md
├── append.tl
├── auto-static-autocomplete.c
├── auto-static-fetch.c
├── auto-static-print-ds.c
├── auto-static-skip.c
├── auto-static-store.c
├── auto-static.c
├── auto.h
├── binlog.c
├── binlog.tl
├── config.h.in
├── configure
├── configure.ac
├── crypto/
│   ├── aes.h
│   ├── aes_altern.c
│   ├── aes_openssl.c
│   ├── bn.h
│   ├── bn_altern.c
│   ├── bn_openssl.c
│   ├── err.h
│   ├── err_altern.c
│   ├── err_openssl.c
│   ├── md5.h
│   ├── md5_altern.c
│   ├── md5_openssl.c
│   ├── meta.h
│   ├── rand.h
│   ├── rand_altern.c
│   ├── rand_openssl.c
│   ├── rsa_pem.h
│   ├── rsa_pem_altern.c
│   ├── rsa_pem_openssl.c
│   ├── sha.h
│   ├── sha_altern.c
│   └── sha_openssl.c
├── encrypted_scheme.tl
├── errors
├── event-old.h
├── gen_constants_h.awk
├── generate.c
├── generate.h
├── m4_ax_check_openssl.m4
├── m4_ax_check_zlib.m4
├── mime-types.c
├── mime.types
├── mtproto-client.c
├── mtproto-client.h
├── mtproto-common.c
├── mtproto-common.h
├── mtproto-key.c
├── mtproto-key.h
├── mtproto-utils.c
├── mtproto-utils.h
├── mtproto.tl
├── no-preview.h
├── queries-encrypted.c
├── queries.c
├── queries.h
├── scheme.tl
├── structures.c
├── tg-mime-types.c
├── tg-mime-types.h
├── tgl-binlog.h
├── tgl-fetch.h
├── tgl-inner.h
├── tgl-layout.h
├── tgl-methods-in.h
├── tgl-net-inner.h
├── tgl-net.c
├── tgl-net.h
├── tgl-queries.h
├── tgl-structures.h
├── tgl-timers.c
├── tgl-timers.h
├── tgl.c
├── tgl.h
├── tools.c
├── tools.h
├── tree.h
├── updates.c
└── updates.h

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
Makefile
autom4te.cache
config.h
config.log
config.status
.idea/
nbproject/
bin/
objs/
dep/
auto/
libs/


================================================
FILE: .gitmodules
================================================
[submodule "tl-parser"]
	path = tl-parser
	url = https://github.com/vysheng/tl-parser


================================================
FILE: CHANGELOG
================================================
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


================================================
FILE: LICENSE
================================================
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!



================================================
FILE: Makefile.in
================================================
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} ${DEP}/crypto ${AUTO} ${EXE} ${OBJ} ${OBJ}/crypto ${LIB} ${DEP}/auto ${OBJ}/auto

LIB_LIST=${LIB}/libtgl.a ${LIB}/libtgl.so

TGL_OBJECTS=${OBJ}/mtproto-common.o ${OBJ}/mtproto-client.o ${OBJ}/mtproto-key.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 ${OBJ}/crypto/bn_openssl.o ${OBJ}/crypto/bn_altern.o ${OBJ}/crypto/rsa_pem_openssl.o ${OBJ}/crypto/rsa_pem_altern.o ${OBJ}/crypto/md5_openssl.o ${OBJ}/crypto/md5_altern.o ${OBJ}/crypto/sha_openssl.o ${OBJ}/crypto/sha_altern.o ${OBJ}/crypto/aes_openssl.o ${OBJ}/crypto/aes_altern.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}/crypto/rand_openssl.o ${OBJ}/crypto/rand_altern.o ${OBJ}/crypto/err_openssl.o ${OBJ}/crypto/err_altern.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 $@ $^

${LIB}/libtgl.so: ${TGL_OBJECTS} ${COMMON_OBJECTS} ${TGL_OBJECTS_AUTO}
	${CC} -shared -o $@ $^ ${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 $@ && false )

${AUTO}/auto-%.h: ${AUTO}/scheme.tlo ${EXE}/generate
	${EXE}/generate -g $(patsubst ${AUTO}/auto-%.h,%-header,$@) ${AUTO}/scheme.tlo > $@ || ( rm $@ && false )


${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}

distclean:
	rm -rf ${DIR_LIST} config.h config.log config.status

mime-types.c: mime.types
	@echo "// DO NOT EDIT! SEE MAKE-TARGET 'gen-mime-types'" > mime-types.c
# xxd is usually packaged with vim-common
	xxd -i mime.types >> mime-types.c


================================================
FILE: Makefile.tl-parser
================================================
TL_PARSER_OBJECTS=${OBJ}/tl-parser.o ${OBJ}/tlc.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 $@


================================================
FILE: README.md
================================================
This is library that handles telegram api and protocol.

Current versions:

- scheme.tl: Layer 38
- encrypted_scheme.tl: Layer 23

### API, Protocol documentation

Documentation for Telegram API is available here: https://core.telegram.org/api

Documentation for MTproto protocol is available here: https://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

You can also avoid the OpenSSL dependency: Install gcrypt (>= 1.60, Debian derivates know it as "libgcrypt20-dev"), and add --disable-openssl 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



================================================
FILE: append.tl
================================================
---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---


================================================
FILE: auto-static-autocomplete.c
================================================
#include <assert.h>

#include "config.h"

#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) {
#ifdef DISABLE_EXTF
  (void) free_vars_to_be_freed;
  assert (0);
#else
  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
}


================================================
FILE: auto-static-fetch.c
================================================
#include <assert.h>

#include "config.h"

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) {
#ifdef DISABLE_EXTF
  assert (0);
#else
  out_buf_pos = 0;
  if (fetch_type_any (T) < 0) { return 0; }
  return out_buf;
#endif
}


================================================
FILE: auto-static-print-ds.c
================================================
#include "config.h"
#ifdef DISABLE_EXTF
#error "EXTF disabled, so nothing uses auto-print anymore."
#endif

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;
}


================================================
FILE: auto-static-skip.c
================================================


================================================
FILE: auto-static-store.c
================================================
#include <assert.h>

#include "config.h"

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) { 
#ifdef DISABLE_EXTF
  assert (0);
#else
  buffer_pos = (char *)data;
  buffer_end = (char *)(data + data_len);
  local_next_token ();
  return store_function_any ();
#endif
}

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


================================================
FILE: auto-static.c
================================================
/* 
    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


================================================
FILE: auto.h
================================================
/* 
    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


================================================
FILE: binlog.c
================================================
/* 
    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 <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/file.h>
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include "crypto/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 "crypto/sha.h"

static int mystreq1 (const char *a, const char *b, int l) {
  if ((int)strlen (a) != l) { return 1; }
  return memcmp (a, b, l);
}

void bl_do_dc_option (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;
    }
  }
  
  vlogprintf (E_NOTICE, "DC%d '%.*s' update: %.*s:%d\n", 
    id, 
    l1, name,
    l2, ip,
    port
  );

  tglmp_alloc_dc (TLS,
    flags,
    id,
    tstrndup (ip, l2),
    port
  );
}
/* }}} */

void bl_do_set_working_dc (struct tgl_state *TLS, int num) /* {{{ */ {
  assert (num > 0 && num <= MAX_DC_ID);
  TLS->DC_working = TLS->DC_list[num];
  TLS->dc_working_num = num;
}
/* }}} */

void bl_do_dc_signed (struct tgl_state *TLS, int num) /* {{{ */ {
  assert (num > 0 && num <= MAX_DC_ID);
  assert (TLS->DC_list[num]);
  TLS->DC_list[num]->flags |= TGLDCF_LOGGED_IN;
}
/* }}} */

void bl_do_set_auth_key (struct tgl_state *TLS, int num, unsigned char *buf) /* {{{ */ {
  assert (num > 0 && num <= MAX_DC_ID);
  assert (TLS->DC_list[num]);

  memcpy (TLS->DC_list[num]->auth_key, buf, 256);
  
  static unsigned char sha1_buffer[20];
  TGLC_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;
}
/* }}} */

void bl_do_set_our_id (struct tgl_state *TLS, tgl_peer_id_t id) /* {{{ */ {
  /*if (TLS->our_id.peer_type) {
    assert (!tgl_cmp_peer_id (TLS->our_id, id));
    return;
  }*/

  TLS->our_id = id;

  if (TLS->callback.our_id) {
    TLS->callback.our_id (TLS, TLS->our_id);
  }
}
/* }}} */

void bl_do_set_dh_params (struct tgl_state *TLS, int root, unsigned char prime[], int version) /* {{{ */ {
  if (TLS->encr_prime) { tfree (TLS->encr_prime, 256); TGLC_bn_free (TLS->encr_prime_bn); }

  TLS->encr_root = root;

  TLS->encr_prime = talloc (256);
  memcpy (TLS->encr_prime, prime, 256);
  TLS->encr_prime_bn = TGLC_bn_new ();
  TGLC_bn_bin2bn ((void *)TLS->encr_prime, 256, TLS->encr_prime_bn);
  
  TLS->encr_param_version = version;
    
  assert (tglmp_check_DH_params (TLS, TLS->encr_prime_bn, TLS->encr_root) >= 0);
}
/* }}} */

void bl_do_set_pts (struct tgl_state *TLS, int pts) /* {{{ */ {
  if (TLS->locks & TGL_LOCK_DIFF) { return; }
  if (pts <= TLS->pts) { return; }
  
  TLS->pts = pts;
}
/* }}} */

void bl_do_set_channel_pts (struct tgl_state *TLS, int id, int pts) /* {{{ */ {
  tgl_peer_t *E = tgl_peer_get (TLS, TGL_MK_CHANNEL (id));
  if (!E || !(E->flags & TGLPF_CREATED)) { return; }
  if (E->flags & TGLCHF_DIFF) { return ; }
  if (E->channel.pts <= pts) { return; }
  E->channel.pts = pts;
}
/* }}} */

void bl_do_set_qts (struct tgl_state *TLS, int qts) /* {{{ */ {
  if (TLS->locks & TGL_LOCK_DIFF) { return; }
  if (qts <= TLS->qts) { return; }
  
  TLS->qts = qts;
}
/* }}} */

void bl_do_set_date (struct tgl_state *TLS, int date) /* {{{ */ {
  if (TLS->locks & TGL_LOCK_DIFF) { return; }
  if (date <= TLS->date) { return; }
  
  TLS->date = date;
}
/* }}} */

void bl_do_set_seq (struct tgl_state *TLS, int seq) /* {{{ */ {
  if (TLS->locks & TGL_LOCK_DIFF) { return; }
  if (seq <= TLS->seq) { return; }
  
  TLS->seq = seq;
}
/* }}} */

void bl_do_set_msg_id (struct tgl_state *TLS, tgl_message_id_t *old_id, tgl_message_id_t *new_id) /* {{{ */ {
  if (!memcmp (old_id, new_id, sizeof (tgl_message_id_t))) {
    return;
  }

  struct tgl_message *M = tgl_message_get (TLS, 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->permanent_id = *new_id;
  if (tgl_message_get (TLS, new_id)) {
    tglm_message_del_use (TLS, M);
    tglm_message_del_temp_id (TLS, M);
    tglm_message_del_random_id (TLS, M);
    tgls_free_message (TLS, M);
  } else {
    tglm_message_insert_tree (TLS, M);
    tglm_message_add_peer (TLS, M);
  }

  M->server_id = new_id->id;
}
/* }}} */

void bl_do_chat_add_user (struct tgl_state *TLS, tgl_peer_id_t id, int version, int user, int inviter, int date) /* {{{ */ {
  tgl_peer_t *P = tgl_peer_get (TLS, id);
  if (!P || !(P->flags & TGLPF_CREATED)) { return; }

  struct tgl_chat *C = &P->chat;
  if (C->user_list_version >= version || !C->user_list_version) { return; }

  int i;
  for (i = 0; i < C->user_list_size; i++) {
    if (C->user_list[i].user_id == user) { 
      return;
    }
  }

  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);
  }
}
/* }}} */

void bl_do_chat_del_user (struct tgl_state *TLS, tgl_peer_id_t id, int version, int user) /* {{{ */ {
  tgl_peer_t *P = tgl_peer_get (TLS, id);
  if (!P || !(P->flags & TGLPF_CREATED)) { return; }

  struct tgl_chat *C = &P->chat;
  if (C->user_list_version >= version || !C->user_list_version) { return; }
  
  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; }

  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);
  }
}
/* }}} */

void bl_do_edit_message (struct tgl_state *TLS, tgl_message_id_t *id, tgl_peer_id_t *from_id, tgl_peer_id_t *to_id, tgl_peer_id_t *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, struct tl_ds_vector *entities, int flags) /* {{{ */ {
  assert (!(flags & 0xfffe0000));
  
  struct tgl_message *M = tgl_message_get (TLS, id);
  
  assert (flags & TGLMF_CREATED);
  assert (!(flags & TGLMF_ENCRYPTED));

  if (flags & (1 << 16)) {
    if (!M) {
      M = tglm_message_alloc (TLS, id);
    }
    M->server_id = id->id;
    assert (!(M->flags & TGLMF_CREATED));
  } else {
    assert (M->flags & TGLMF_CREATED);
  }

  assert (M);
  assert (!(M->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 (from_id) {
    M->from_id = *from_id;
  } else {
    if (!M->from_id.peer_type) {
      assert (to_id);
      M->from_id = *to_id;
    }
  }

  if (to_id) {
    assert (flags & 0x10000);
    M->to_id = *to_id;
  }

  if (date) {
    M->date = *date;
  }
  
  if (fwd_from_id) {
    assert (fwd_date);
    M->fwd_from_id = *fwd_from_id;
    M->fwd_date = *fwd_date;;
  }
  
  if (action) {
    tglf_fetch_message_action (TLS, &M->action, action);
    M->flags |= TGLMF_SERVICE;
  } 

  if (message) {
    M->message_len = message_len;
    M->message = tstrndup (message, message_len);
    assert (!(M->flags & TGLMF_SERVICE));
  }

  if (media) {
    tglf_fetch_message_media (TLS, &M->media, media);
    assert (!(M->flags & TGLMF_SERVICE));
  }

  if (entities) {
    tglf_fetch_message_entities (TLS, M, entities);
  }

  if (reply_id) {
    M->reply_id = *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->permanent_id.id);
  }

  if (reply_markup) {
    M->reply_markup = tglf_fetch_alloc_reply_markup (TLS, M->next, reply_markup);
  }

  if (M->flags & TGLMF_PENDING) {
    tgls_message_change_random_id (TLS, M, M->permanent_id.id);
  }
  
  if (!M->temp_id) {
    tgls_message_change_temp_id (TLS, M, ++TLS->last_temp_id);
  }
}
/* }}} */

void bl_do_edit_message_encr (struct tgl_state *TLS, tgl_message_id_t *id, tgl_peer_id_t *from_id, tgl_peer_id_t *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));
  
  struct tgl_message *M = tgl_message_get (TLS, id);

  if (flags & (1 << 16)) {
    if (!M) {
      M = tglm_message_alloc (TLS, id);
    } 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 (from_id) {
    M->from_id = *from_id;
  }
  if (to_id) {  
    assert (flags & 0x10000);
    M->to_id = *to_id;
  }

  if (date) {
    M->date = *date;
  }

  struct tgl_secret_chat *E = (void *)tgl_peer_get (TLS, M->to_id);
  assert (E);

  if (action) {
    tglf_fetch_message_action_encrypted (TLS, &M->action, action);
    M->flags |= TGLMF_SERVICE;
  }

  if (message) {
    M->message_len = message_len;
    M->message = tstrndup (message, message_len);
    assert (!(M->flags & TGLMF_SERVICE));
  }

  if (media) {
    tglf_fetch_message_media_encrypted (TLS, &M->media, media);
    assert (!(M->flags & TGLMF_SERVICE));
  }

  if (file) {
    tglf_fetch_encrypted_message_file (TLS, &M->media, file);
    assert (!(M->flags & TGLMF_SERVICE));
  }

  if (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);
  }
}
/* }}} */

void bl_do_message_delete (struct tgl_state *TLS, tgl_message_id_t *id) /* {{{ */ {
  struct tgl_message *M = tgl_message_get (TLS, id);
  if (!M) { return; }
  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);
  tglm_message_del_temp_id (TLS, M);
  tglm_message_del_random_id (TLS, M);
  tgls_free_message (TLS, M);
}
/* }}} */

void bl_do_msg_update (struct tgl_state *TLS, tgl_message_id_t *id) /* {{{ */ {
  struct tgl_message *M = tgl_message_get (TLS, id);
  if (!M) { return; }
  assert (M);
  
  if (!(M->flags & TGLMF_ENCRYPTED)) {
    if (TLS->max_msg_id < M->server_id) {
      TLS->max_msg_id = M->server_id;
    }
  }

  if (TLS->callback.msg_receive) {
    TLS->callback.msg_receive (TLS, M);
  }
}
/* }}} */

void bl_do_reset_authorization (struct tgl_state *TLS) /* {{{ */ {
  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;
}
/* }}} */

void bl_do_encr_chat_exchange (struct tgl_state *TLS, tgl_peer_id_t id, long long *exchange_id, const void *key, int *state) /* {{{ */ {
  tgl_peer_t *P = tgl_peer_get (TLS, id);
  if (!P) { return; }
  
  if (state) {
    P->encr_chat.exchange_state = *state;
  }
  if (exchange_id) {
    P->encr_chat.exchange_id = *exchange_id;
  }

  static unsigned char sha_buffer[20];
  switch (P->encr_chat.exchange_state) {
  case tgl_sce_requested:
    memcpy (P->encr_chat.exchange_key, key, 256);
    break;
  case tgl_sce_accepted:
    memcpy (P->encr_chat.exchange_key, key, 256);
  
    TGLC_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;

    memcpy (P->encr_chat.key, key, 256);
  
    TGLC_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);
  }
}
/* }}} */

void bl_do_user (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, 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 *_U = tgl_peer_get (TLS, TGL_MK_USER (id));

  unsigned updates = 0;

  if ((flags & TGLPF_CREATE) && (flags != TGL_FLAGS_UNCHANGED)) {
    if (!_U) {
      _U = talloc0 (sizeof (*_U));
      _U->id = TGL_MK_USER (id);
      tglp_insert_user (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 == TGL_FLAGS_UNCHANGED) { flags = U->flags; }
  flags &= TGLUF_TYPE_MASK;
  
  if ((flags & TGLUF_TYPE_MASK) != (U->flags & TGLUF_TYPE_MASK)) {
    updates |= TGL_UPDATE_FLAGS;
  }
  U->flags = (U->flags & ~TGLUF_TYPE_MASK) | flags;

  if (access_hash && *access_hash != U->access_hash) {
    U->access_hash = *access_hash;
    U->id.access_hash = *access_hash;
    updates |= TGL_UPDATE_ACCESS_HASH;
  }

  if (first_name || last_name) {
    if (!U->first_name || !U->last_name || mystreq1 (U->first_name, first_name, first_name_len) || mystreq1 (U->last_name, last_name, last_name_len)) {
      if (U->first_name) {
        tfree_str (U->first_name);
      }
      U->first_name = tstrndup (first_name, first_name_len);
      if (U->last_name) {
        tfree_str (U->last_name);
      }
      U->last_name = tstrndup (last_name, last_name_len);
    
      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 (phone && (!U->phone || mystreq1 (U->phone, phone, phone_len))) {
    if (U->phone) {
      tfree_str (U->phone);
    }
    U->phone = tstrndup (phone, phone_len);
    updates |= TGL_UPDATE_PHONE;
  }

  if (username && (!U->username || mystreq1 (U->username, username, username_len))) {
    if (U->username) {
      tfree_str (U->username);
    }
    U->username = tstrndup (username, username_len);
    updates |= TGL_UPDATE_USERNAME;
  }

  if (photo) {
    if (!U->photo || U->photo->id != DS_LVAL (photo->id)) {
      if (U->photo) {
        tgls_free_photo (TLS, U->photo);
      }
      U->photo = tglf_fetch_alloc_photo (TLS, photo);
      U->flags |= TGLUF_HAS_PHOTO;
    }
  }
  
  if (profile_photo) {
    if (U->photo_id != DS_LVAL (profile_photo->photo_id)) {
      U->photo_id = DS_LVAL (profile_photo->photo_id);
      tglf_fetch_file_location (TLS, &U->photo_big, profile_photo->photo_big);
      tglf_fetch_file_location (TLS, &U->photo_small, profile_photo->photo_small);
      updates |= TGL_UPDATE_PHOTO;
    }
  }

  if (last_read_in) {
    U->last_read_in = *last_read_in;
    tgls_messages_mark_read (TLS, U->last, 0, U->last_read_in);
  }
  if (last_read_out) {
    U->last_read_out = *last_read_out;
    tgls_messages_mark_read (TLS, U->last, TGLMF_OUT, U->last_read_out);
  }
  
  if (bot_info) {
    if (!U->bot_info || U->bot_info->version != DS_LVAL (bot_info->version)) {
      if (U->bot_info) {
        tgls_free_bot_info (TLS, U->bot_info);
      }
      U->bot_info = tglf_fetch_alloc_bot_info (TLS, bot_info);
    }
  }

  if (TLS->callback.user_update && updates) {
    TLS->callback.user_update (TLS, U, updates);
  }
}
/* }}} */

void bl_do_chat (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 *_U = tgl_peer_get (TLS, TGL_MK_CHAT (id));

  unsigned updates = 0;

  if ((flags & TGLPF_CREATE) && (flags != TGL_FLAGS_UNCHANGED)) {
    if (!_U) {
      _U = talloc0 (sizeof (*_U));
      _U->id = TGL_MK_CHAT (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 == TGL_FLAGS_UNCHANGED) { flags = C->flags; }
  flags &= TGLCF_TYPE_MASK;
  
  if ((flags & TGLCF_TYPE_MASK) != (C->flags & TGLCF_TYPE_MASK)) {
    updates |= TGL_UPDATE_FLAGS;
  }
  C->flags = (C->flags & ~TGLCF_TYPE_MASK) | flags;

  if (title && (!C->title || mystreq1 (C->title, title, title_len))) {
    if (C->title) {
      tfree_str (C->title);
    }
    C->title = tstrndup (title, title_len);

    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 (user_num) {
    C->users_num = *user_num;
  }
  
  if (date) {
    C->date = *date;
  }

  if (chat_photo && chat_photo->photo_big) {
    if (DS_LVAL (chat_photo->photo_big->secret) != C->photo_big.secret) {
      tglf_fetch_file_location (TLS, &C->photo_big, chat_photo->photo_big);
      tglf_fetch_file_location (TLS, &C->photo_small, chat_photo->photo_small);
      updates |= TGL_UPDATE_PHOTO;
    }
  }

  if (photo) {
    if (!C->photo || C->photo->id != DS_LVAL (photo->id)) {
      if (C->photo) {
        tgls_free_photo (TLS, C->photo);
      }
      C->photo = tglf_fetch_alloc_photo (TLS, photo);
      C->flags |= TGLPF_HAS_PHOTO;
      //updates |= TGL_UPDATE_PHOTO;
    }
  }

  if (admin && *admin != C->admin_id) {
    C->admin_id = *admin;
    updates |= TGL_UPDATE_ADMIN;
  }
  
  if (version) {
    assert (participants);
    if (*version > C->version) {
      C->version = *version;

      if (C->user_list) { tfree (C->user_list, 12 * C->user_list_size); }

      C->user_list_size = DS_LVAL (participants->f1);
      C->user_list = talloc (12 * C->user_list_size);

      int i;
      for (i = 0; i < C->user_list_size; i++) {
        struct tl_ds_chat_participant *DS_P = participants->f2[i];
        C->user_list[i].user_id = DS_LVAL (DS_P->user_id);
        C->user_list[i].inviter_id = DS_LVAL (DS_P->inviter_id);
        C->user_list[i].date = DS_LVAL (DS_P->date);
      }

      updates |= TGL_UPDATE_MEMBERS;
    }
  }
 
  if (last_read_in) {
    C->last_read_in = *last_read_in;
    tgls_messages_mark_read (TLS, C->last, 0, C->last_read_in);
  }
 
  if (last_read_out) {
    C->last_read_out = *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);
  }
}
/* }}} */

void bl_do_encr_chat (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, const char *print_name, int print_name_len) /* {{{ */ {
  tgl_peer_t *_U = tgl_peer_get (TLS, TGL_MK_ENCR_CHAT (id));

  unsigned updates = 0;

  if ((flags & TGLPF_CREATE) && (flags != TGL_FLAGS_UNCHANGED)) {
    if (!_U) {
      _U = talloc0 (sizeof (*_U));
      _U->id = TGL_MK_ENCR_CHAT (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 == TGL_FLAGS_UNCHANGED) { flags = U->flags; }
  flags &= TGLECF_TYPE_MASK;
  
  if ((flags & TGLECF_TYPE_MASK) != (U->flags & TGLECF_TYPE_MASK)) {
    updates |= TGL_UPDATE_FLAGS;
  }
  U->flags = (U->flags & ~TGLECF_TYPE_MASK) | flags;

  if (access_hash && *access_hash != U->access_hash) {
    U->access_hash = *access_hash;
    U->id.access_hash = *access_hash;
    updates |= TGL_UPDATE_ACCESS_HASH;
  }

  if (date) {
    U->date = *date;
  }

  if (admin) {
    U->admin_id = *admin;
  }

  if (user_id) {
    U->user_id = *user_id;
  }

  if (key_fingerprint) {
    U->key_fingerprint = *key_fingerprint;
  }

  if (in_seq_no) {
    U->in_seq_no = *in_seq_no;
  }
  if (out_seq_no) {
    U->out_seq_no = *out_seq_no;
  }
  if (last_in_seq_no) {
    U->last_in_seq_no = *last_in_seq_no;
  }

  tgl_peer_t *Us = tgl_peer_get (TLS, TGL_MK_USER (U->user_id));
  
  if (!U->print_name) {
    if (print_name) {
      U->print_name = tstrndup (print_name, print_name_len);
    } else {
      if (Us) {
        U->print_name = TLS->callback.create_print_name (TLS, TGL_MK_ENCR_CHAT (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, TGL_MK_ENCR_CHAT (id), "!", buf, 0, 0);
      }
      tglp_peer_insert_name (TLS, (void *)U);
    }
  }

  if (g_key) {
    if (!U->g_key)  {
      U->g_key = talloc (256);
    }
    memcpy (U->g_key, g_key, 256);
  }

  if (key) {
    memcpy (U->key, key, 256);
  }

  if (first_key_id) {
    memcpy (U->first_key_sha, first_key_id, 20);
  }

  if (state) {
    if (U->state == sc_waiting && *state == sc_ok) {
      tgl_do_create_keys_end (TLS, U);
    }
    if ((int)U->state != *state) {
      switch (*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 = *state;
  }
  
  if (TLS->callback.secret_chat_update && updates) {
    TLS->callback.secret_chat_update (TLS, U, updates);
  }
}
/* }}} */

void bl_do_channel (struct tgl_state *TLS, int id, long long *access_hash, int *date, const char *title, int title_len, const char *username, int username_len, struct tl_ds_chat_photo *chat_photo, struct tl_ds_photo *photo, int *version, char *about, int about_len, int *participants_count, int *admins_count, int *kicked_count, int *last_read_in, int flags) /* {{{ */ {
  tgl_peer_t *_U = tgl_peer_get (TLS, TGL_MK_CHANNEL (id));

  unsigned updates = 0;

  if ((flags & TGLPF_CREATE) && (flags != TGL_FLAGS_UNCHANGED)) {
    if (!_U) {
      _U = talloc0 (sizeof (*_U));
      _U->id = TGL_MK_CHANNEL (id);
      tglp_insert_channel (TLS, _U);
    } else {
      assert (!(_U->flags & TGLPF_CREATED));
    }
    updates |= TGL_UPDATE_CREATED;
  } else {
    assert (_U->flags & TGLPF_CREATED);
  }
  
  struct tgl_channel *C = &_U->channel;
  if (flags == TGL_FLAGS_UNCHANGED) { flags = C->flags; }
  flags &= TGLCHF_TYPE_MASK;
  
  if ((flags & TGLCHF_TYPE_MASK) != (C->flags & TGLCHF_TYPE_MASK)) {
    updates |= TGL_UPDATE_FLAGS;
  }
  C->flags = (C->flags & ~TGLCHF_TYPE_MASK) | flags;

  if (access_hash && *access_hash != C->access_hash) {
    C->access_hash = *access_hash;
    C->id.access_hash = *access_hash;
    updates |= TGL_UPDATE_ACCESS_HASH;
  }

  if (date) {
    C->date = *date;
  }

  if (title && (!C->title || mystreq1 (C->title, title, title_len))) {
    if (C->title) {
      tfree_str (C->title);
    }
    C->title = tstrndup (title, title_len);
    
    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 (chat_photo) {
    if (chat_photo->photo_big && DS_LVAL (chat_photo->photo_big->secret) != C->photo_big.secret) {
      tglf_fetch_file_location (TLS, &C->photo_big, chat_photo->photo_big);
      tglf_fetch_file_location (TLS, &C->photo_small, chat_photo->photo_small);
      updates |= TGL_UPDATE_PHOTO;
    }
  }

  if (photo) {
    if (!C->photo || C->photo->id != DS_LVAL (photo->id)) {
      if (C->photo) {
        tgls_free_photo (TLS, C->photo);
      }
      C->photo = tglf_fetch_alloc_photo (TLS, photo);
      C->flags |= TGLPF_HAS_PHOTO;
    }
  }

  if (username) {
    if (!C->username || mystreq1 (C->username, username, username_len)) {
      if (C->username) {
        tfree_str (C->username);
      }
      C->username = tstrndup (username, username_len);
      updates |= TGL_UPDATE_USERNAME;
    }
  }
  
  if (about) {
    if (!C->about || mystreq1 (C->about, about, about_len)) {
      tfree_str (C->about);
    }
    C->about = tstrndup (about, about_len);
  }

  if (admins_count) {
    C->admins_count = *admins_count;
  }
  
  if (participants_count) {
    C->participants_count = *participants_count;
  }
  
  if (kicked_count) {
    C->kicked_count = *kicked_count;
  }
  
  if (last_read_in) {
    C->last_read_in = *last_read_in;
    tgls_messages_mark_read (TLS, C->last, 0, C->last_read_in);
  }
  
  if (TLS->callback.channel_update && updates) {
    TLS->callback.channel_update (TLS, C, updates);
  }
}
/* }}} */

void bl_do_peer_delete (struct tgl_state *TLS, tgl_peer_id_t id) /* {{{ */ {
  tgl_peer_t *P = tgl_peer_get (TLS, id);
  if (!P || !(P->flags & TGLPF_CREATED)) { return; }

  if (P->flags & TGLPF_DELETED) { return; }
  P->flags |= TGLPF_DELETED;

  switch (id.peer_type) {
  case TGL_PEER_USER:
    if (TLS->callback.user_update) {
      TLS->callback.user_update (TLS, (void *)P, TGL_UPDATE_DELETED);
    }
    break;
  case TGL_PEER_CHAT:
    if (TLS->callback.chat_update) {
      TLS->callback.chat_update (TLS, (void *)P, TGL_UPDATE_DELETED);
    }
    break;
  case TGL_PEER_ENCR_CHAT:
    if (TLS->callback.secret_chat_update) {
      TLS->callback.secret_chat_update (TLS, (void *)P, TGL_UPDATE_DELETED);
    }
    break;
  case TGL_PEER_CHANNEL:
    if (TLS->callback.channel_update) {
      TLS->callback.channel_update (TLS, (void *)P, TGL_UPDATE_DELETED);
    }
    break;
  default:
    assert (0);
  }
}
/* }}} */


================================================
FILE: binlog.tl
================================================
---types---

binlog.encrKey key:64*[int] = binlog.EncrKey;

binlog.peerUser = binlog.PeerType;
binlog.peerChat = binlog.PeerType;
binlog.peerChannel = binlog.PeerType;

binlog.peer peer_type:binlog.PeerType peer_id:int = binlog.Peer;


binlog.start = binlog.Update;

binlog.authKey dc:int key:%binlog.EncrKey = binlog.Update; 
binlog.defaultDc dc:int = binlog.Update;
binlog.dcSigned dc:int = binlog.Update;

binlog.dcOption flags:int dc:int name:string ip:string port: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.peerDelete peer:%binlog.Peer = binlog.Update;

binlog.encrChat#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.encrChatExchange#9d49488d flags:# id:int
  exchange_id:flags.17?long
  key:flags.18?%binlog.EncrKey
  state:flags.19?int 
    = binlog.Update;

binlog.user#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.chat#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.channel flags:# id:int
  title:flags.17?string
  username:flags.18?string
  date:flags.19?int
  version:flags.20?int
  chat_photo:flags.21?ChatPhoto
  photo:flags.22?Photo
  about:flags.23?int
  last_read_in:flags.24?int
  admins_count:flags.25?int
  kicked_count:flags.26?int
  access_hash:flags.27?long 
    = 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:flags.17?%binlog.Peer to:flags.17?%binlog.Peer
  fwd_from_id:flags.18?%binlog.Peer 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:flags.17?%binlog.Peer to:flags.17?%binlog.Peer
  //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---


================================================
FILE: config.h.in
================================================
/* 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 `gcrypt' library (-lgcrypt). */
#undef HAVE_LIBGCRYPT

/* 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

/* avoid OpenSSL entirely, use libgcrypt instead (this can't read *.pub files,
   though.) */
#undef TGL_AVOID_OPENSSL

/* 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


================================================
FILE: configure
================================================
#! /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
enable_openssl
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]
  --disable-openssl	  disables OpenSSL, and don't link against it
			  (this can't read *.pub files, though.)
  --enable-extf		  enables extended queries system
  --enable-libevent	  include libevent-based net and timers
  --enable-valgrind	  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.




# 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 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

# Check whether --enable-openssl was given.
if test "${enable_openssl+set}" = set; then :
  enableval=$enable_openssl;
  if test "x$enableval" = "xno" ; then

$as_echo "#define TGL_AVOID_OPENSSL 1" >>confdefs.h

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcry_mpi_snatch in -lgcrypt" >&5
$as_echo_n "checking for gcry_mpi_snatch in -lgcrypt... " >&6; }
if ${ac_cv_lib_gcrypt_gcry_mpi_snatch+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgcrypt  $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 gcry_mpi_snatch ();
int
main ()
{
return gcry_mpi_snatch ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_gcrypt_gcry_mpi_snatch=yes
else
  ac_cv_lib_gcrypt_gcry_mpi_snatch=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_gcrypt_gcry_mpi_snatch" >&5
$as_echo "$ac_cv_lib_gcrypt_gcry_mpi_snatch" >&6; }
if test "x$ac_cv_lib_gcrypt_gcry_mpi_snatch" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBGCRYPT 1
_ACEOF

  LIBS="-lgcrypt $LIBS"

else
  as_fn_error $? "\"Need libgcrypt >= 1.60\"" "$LINENO" 5
fi

  else
    # Don't be annoying, so don't inform the user about --disable-openssl

    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"





  fi

else


    found=false

#
Download .txt
gitextract_7j9eshnc/

├── .gitignore
├── .gitmodules
├── CHANGELOG
├── LICENSE
├── Makefile.in
├── Makefile.tl-parser
├── README.md
├── append.tl
├── auto-static-autocomplete.c
├── auto-static-fetch.c
├── auto-static-print-ds.c
├── auto-static-skip.c
├── auto-static-store.c
├── auto-static.c
├── auto.h
├── binlog.c
├── binlog.tl
├── config.h.in
├── configure
├── configure.ac
├── crypto/
│   ├── aes.h
│   ├── aes_altern.c
│   ├── aes_openssl.c
│   ├── bn.h
│   ├── bn_altern.c
│   ├── bn_openssl.c
│   ├── err.h
│   ├── err_altern.c
│   ├── err_openssl.c
│   ├── md5.h
│   ├── md5_altern.c
│   ├── md5_openssl.c
│   ├── meta.h
│   ├── rand.h
│   ├── rand_altern.c
│   ├── rand_openssl.c
│   ├── rsa_pem.h
│   ├── rsa_pem_altern.c
│   ├── rsa_pem_openssl.c
│   ├── sha.h
│   ├── sha_altern.c
│   └── sha_openssl.c
├── encrypted_scheme.tl
├── errors
├── event-old.h
├── gen_constants_h.awk
├── generate.c
├── generate.h
├── m4_ax_check_openssl.m4
├── m4_ax_check_zlib.m4
├── mime-types.c
├── mime.types
├── mtproto-client.c
├── mtproto-client.h
├── mtproto-common.c
├── mtproto-common.h
├── mtproto-key.c
├── mtproto-key.h
├── mtproto-utils.c
├── mtproto-utils.h
├── mtproto.tl
├── no-preview.h
├── queries-encrypted.c
├── queries.c
├── queries.h
├── scheme.tl
├── structures.c
├── tg-mime-types.c
├── tg-mime-types.h
├── tgl-binlog.h
├── tgl-fetch.h
├── tgl-inner.h
├── tgl-layout.h
├── tgl-methods-in.h
├── tgl-net-inner.h
├── tgl-net.c
├── tgl-net.h
├── tgl-queries.h
├── tgl-structures.h
├── tgl-timers.c
├── tgl-timers.h
├── tgl.c
├── tgl.h
├── tools.c
├── tools.h
├── tree.h
├── updates.c
└── updates.h
Download .txt
SYMBOL INDEX (1773 symbols across 56 files)

FILE: auto-static-autocomplete.c
  function set_autocomplete_string (line 13) | static void set_autocomplete_string (const char *s) {
  function set_autocomplete_type (line 20) | static void set_autocomplete_type (int (*f)(const char *, int, int, char...
  type paramed_type (line 26) | struct paramed_type
  function add_var_to_be_freed (line 29) | static void add_var_to_be_freed (struct paramed_type *P) {
  function free_vars_to_be_freed (line 34) | static void free_vars_to_be_freed (void) {
  function tglf_extf_autocomplete (line 42) | int tglf_extf_autocomplete (struct tgl_state *TLS, const char *text, int...

FILE: auto-static-fetch.c
  function valid_utf8_char (line 21) | static int valid_utf8_char (const char *str) {
  function print_escaped_string (line 50) | static void print_escaped_string (const char *str, int len) {
  function print_offset (line 99) | static void print_offset (void) {
  type tgl_state (line 106) | struct tgl_state
  type paramed_type (line 106) | struct paramed_type

FILE: auto-static-print-ds.c
  function valid_utf8_char (line 22) | static int valid_utf8_char (const char *str) {
  function print_escaped_string (line 51) | static void print_escaped_string (const char *str, int len) {
  function print_offset (line 100) | static void print_offset (void) {
  type tgl_state (line 107) | struct tgl_state
  type paramed_type (line 107) | struct paramed_type

FILE: auto-static-store.c
  function is_int (line 28) | static int is_int (void) {
  function get_int (line 40) | static long long get_int (void) {
  function is_double (line 52) | static int is_double (void) {
  function get_double (line 65) | static double get_double (void) {
  function is_wspc (line 80) | static int is_wspc (char c) {
  function skip_wspc (line 84) | static void skip_wspc (void) {
  function is_letter (line 90) | static int is_letter (char c) {
  function is_hex (line 98) | static inline int is_hex (char c) {
  function hex2dec (line 102) | static inline int hex2dec (char c) {
  function expand_backslashed (line 107) | static void expand_backslashed (char *s, int len) {
  function local_next_token (line 156) | static void local_next_token (void) {
  type paramed_type (line 213) | struct paramed_type
  type paramed_type (line 213) | struct paramed_type
  type paramed_type (line 215) | struct paramed_type
  function tgl_paramed_type_free (line 235) | void tgl_paramed_type_free (struct paramed_type *P) {
  type paramed_type (line 249) | struct paramed_type
  type paramed_type (line 253) | struct paramed_type
  type tgl_state (line 253) | struct tgl_state
  function tglf_store_type (line 264) | int tglf_store_type (struct tgl_state *TLS, const char *data, int data_l...

FILE: auto-static.c
  function set_autocomplete_string (line 54) | static void set_autocomplete_string (const char *s) {
  function set_autocomplete_type (line 61) | static void set_autocomplete_type (int (*f)(const char *, int, int, char...
  function is_int (line 66) | static int is_int (void) {
  function get_int (line 78) | static long long get_int (void) {
  function is_double (line 90) | static int is_double (void) {
  function get_double (line 102) | static double get_double (void) {
  type paramed_type (line 114) | struct paramed_type
  type paramed_type (line 114) | struct paramed_type
  type paramed_type (line 116) | struct paramed_type
  function tgl_paramed_type_free (line 135) | void tgl_paramed_type_free (struct paramed_type *P) {
  function is_wspc (line 151) | static int is_wspc (char c) {
  function skip_wspc (line 155) | static void skip_wspc (void) {
  function is_letter (line 161) | static int is_letter (char c) {
  function is_hex (line 169) | static inline int is_hex (char c) {
  function hex2dec (line 173) | static inline int hex2dec (char c) {
  function expand_backslashed (line 178) | static void expand_backslashed (char *s, int len) {
  function local_next_token (line 227) | static void local_next_token (void) {
  type paramed_type (line 285) | struct paramed_type
  function add_var_to_be_freed (line 288) | static void add_var_to_be_freed (struct paramed_type *P) {
  function free_vars_to_be_freed (line 293) | static void free_vars_to_be_freed (void) {
  function tglf_extf_autocomplete (line 301) | int tglf_extf_autocomplete (struct tgl_state *TLS, const char *text, int...

FILE: auto.h
  type tl_type_descr (line 25) | struct tl_type_descr {
  type paramed_type (line 32) | struct paramed_type {
  type paramed_type (line 60) | struct paramed_type

FILE: binlog.c
  function mystreq1 (line 56) | static int mystreq1 (const char *a, const char *b, int l) {
  function bl_do_dc_option (line 61) | void bl_do_dc_option (struct tgl_state *TLS, int flags, int id, const ch...
  function bl_do_set_working_dc (line 90) | void bl_do_set_working_dc (struct tgl_state *TLS, int num) /* {{{ */ {
  function bl_do_dc_signed (line 97) | void bl_do_dc_signed (struct tgl_state *TLS, int num) /* {{{ */ {
  function bl_do_set_auth_key (line 104) | void bl_do_set_auth_key (struct tgl_state *TLS, int num, unsigned char *...
  function bl_do_set_our_id (line 118) | void bl_do_set_our_id (struct tgl_state *TLS, tgl_peer_id_t id) /* {{{ */ {
  function bl_do_set_dh_params (line 132) | void bl_do_set_dh_params (struct tgl_state *TLS, int root, unsigned char...
  function bl_do_set_pts (line 148) | void bl_do_set_pts (struct tgl_state *TLS, int pts) /* {{{ */ {
  function bl_do_set_channel_pts (line 156) | void bl_do_set_channel_pts (struct tgl_state *TLS, int id, int pts) /* {...
  function bl_do_set_qts (line 165) | void bl_do_set_qts (struct tgl_state *TLS, int qts) /* {{{ */ {
  function bl_do_set_date (line 173) | void bl_do_set_date (struct tgl_state *TLS, int date) /* {{{ */ {
  function bl_do_set_seq (line 181) | void bl_do_set_seq (struct tgl_state *TLS, int seq) /* {{{ */ {
  function bl_do_set_msg_id (line 189) | void bl_do_set_msg_id (struct tgl_state *TLS, tgl_message_id_t *old_id, ...
  function bl_do_chat_add_user (line 221) | void bl_do_chat_add_user (struct tgl_state *TLS, tgl_peer_id_t id, int v...
  function bl_do_chat_del_user (line 248) | void bl_do_chat_del_user (struct tgl_state *TLS, tgl_peer_id_t id, int v...
  function bl_do_edit_message (line 277) | void bl_do_edit_message (struct tgl_state *TLS, tgl_message_id_t *id, tg...
  function bl_do_edit_message_encr (line 381) | void bl_do_edit_message_encr (struct tgl_state *TLS, tgl_message_id_t *i...
  function bl_do_message_delete (line 460) | void bl_do_message_delete (struct tgl_state *TLS, tgl_message_id_t *id) ...
  function bl_do_msg_update (line 478) | void bl_do_msg_update (struct tgl_state *TLS, tgl_message_id_t *id) /* {...
  function bl_do_reset_authorization (line 495) | void bl_do_reset_authorization (struct tgl_state *TLS) /* {{{ */ {
  function bl_do_encr_chat_exchange (line 508) | void bl_do_encr_chat_exchange (struct tgl_state *TLS, tgl_peer_id_t id, ...
  function bl_do_user (line 559) | void bl_do_user (struct tgl_state *TLS, int id, long long *access_hash, ...
  function bl_do_chat (line 673) | void bl_do_chat (struct tgl_state *TLS, int id, const char *title, int t...
  function bl_do_encr_chat (line 787) | void bl_do_encr_chat (struct tgl_state *TLS, int id, long long *access_h...
  function bl_do_channel (line 904) | void bl_do_channel (struct tgl_state *TLS, int id, long long *access_has...
  function bl_do_peer_delete (line 1015) | void bl_do_peer_delete (struct tgl_state *TLS, tgl_peer_id_t id) /* {{{ ...

FILE: crypto/aes.h
  type TGLC_aes_key (line 28) | typedef struct TGLC_aes_key {

FILE: crypto/aes_altern.c
  function TGLC_aes_set_encrypt_key (line 44) | void TGLC_aes_set_encrypt_key (const unsigned char *userKey, const int b...
  function TGLC_aes_set_decrypt_key (line 49) | void TGLC_aes_set_decrypt_key (const unsigned char *userKey, const int b...
  function do_xor_block (line 54) | static void do_xor_block (const unsigned char *in, const unsigned char *...
  function gcry_error_t (line 62) | static gcry_error_t do_ige_encrypt (const unsigned char *in, unsigned ch...
  function gcry_error_t (line 106) | static gcry_error_t do_ige_decrypt (const unsigned char *in, unsigned ch...
  function TGLC_aes_ige_encrypt (line 141) | void TGLC_aes_ige_encrypt (const unsigned char *in, unsigned char *out, ...

FILE: crypto/aes_openssl.c
  function TGLC_aes_set_encrypt_key (line 34) | void TGLC_aes_set_encrypt_key (const unsigned char *userKey, const int b...
  function TGLC_aes_set_decrypt_key (line 39) | void TGLC_aes_set_decrypt_key (const unsigned char *userKey, const int b...
  function TGLC_aes_ige_encrypt (line 44) | void TGLC_aes_ige_encrypt (const unsigned char *in, unsigned char *out, ...

FILE: crypto/bn.h
  type TGLC_bn_ctx (line 24) | typedef struct TGLC_bn_ctx TGLC_bn_ctx;
  type TGLC_bn (line 25) | typedef struct TGLC_bn TGLC_bn;

FILE: crypto/bn_altern.c
  function TGLC_bn_ctx (line 38) | TGLC_bn_ctx *TGLC_bn_ctx_new (void) {
  function TGLC_bn_ctx_free (line 43) | void TGLC_bn_ctx_free (TGLC_bn_ctx* ctx) {
  function TGLC_bn (line 47) | TGLC_bn *TGLC_bn_new (void) {
  function TGLC_bn_free (line 54) | void TGLC_bn_free (TGLC_bn *a) {
  function TGLC_bn_clear_free (line 58) | void TGLC_bn_clear_free (TGLC_bn *a) {
  function TGLC_bn_cmp (line 64) | int TGLC_bn_cmp (const TGLC_bn *a, const TGLC_bn *b) {
  function TGLC_bn_is_prime (line 68) | int TGLC_bn_is_prime (const TGLC_bn *a, int checks, void (*callback) (in...
  function TGLC_bn_bn2bin (line 81) | int TGLC_bn_bn2bin (const TGLC_bn *a, unsigned char *to) {
  function TGLC_bn (line 88) | TGLC_bn *TGLC_bn_bin2bn(const unsigned char *s, int len, TGLC_bn *ret) {
  function TGLC_bn_set_word (line 102) | int TGLC_bn_set_word (TGLC_bn *a, unsigned long w) {
  function TGLC_bn_get_word (line 108) | unsigned long TGLC_bn_get_word (const TGLC_bn *a) {
  function TGLC_bn_num_bits (line 126) | int TGLC_bn_num_bits (const TGLC_bn *a) {
  function TGLC_bn_sub (line 130) | void TGLC_bn_sub (TGLC_bn *r, const TGLC_bn *a, const TGLC_bn *b) {
  function TGLC_bn_div (line 134) | int TGLC_bn_div (TGLC_bn *dv, TGLC_bn *rem, const TGLC_bn *a, const TGLC...
  function TGLC_bn_mod_exp (line 140) | int TGLC_bn_mod_exp (TGLC_bn *r, const TGLC_bn *a, const TGLC_bn *p, con...

FILE: crypto/bn_openssl.c
  function TGLC_bn_ctx (line 35) | TGLC_bn_ctx *TGLC_bn_ctx_new (void) {
  function TGLC_bn_ctx_free (line 39) | void TGLC_bn_ctx_free (TGLC_bn_ctx* ctx) {
  function TGLC_bn (line 43) | TGLC_bn *TGLC_bn_new (void) {
  function TGLC_bn_free (line 47) | void TGLC_bn_free (TGLC_bn *a) {
  function TGLC_bn_clear_free (line 51) | void TGLC_bn_clear_free (TGLC_bn *a) {
  function TGLC_bn_cmp (line 55) | int TGLC_bn_cmp (const TGLC_bn *a, const TGLC_bn *b) {
  function TGLC_bn_is_prime (line 59) | int TGLC_bn_is_prime (const TGLC_bn *a, int checks, void (*callback) (in...
  function TGLC_bn_bn2bin (line 63) | int TGLC_bn_bn2bin (const TGLC_bn *a, unsigned char *to) {
  function TGLC_bn (line 67) | TGLC_bn * TGLC_bn_bin2bn(const unsigned char *s, int len, TGLC_bn *ret) {
  function TGLC_bn_set_word (line 71) | int TGLC_bn_set_word (TGLC_bn *a, unsigned long w) {
  function TGLC_bn_get_word (line 75) | unsigned long TGLC_bn_get_word (const TGLC_bn *a) {
  function TGLC_bn_num_bits (line 79) | int TGLC_bn_num_bits (const TGLC_bn *a) {
  function TGLC_bn_sub (line 83) | void TGLC_bn_sub (TGLC_bn *r, const TGLC_bn *a, const TGLC_bn *b) {
  function TGLC_bn_div (line 88) | int TGLC_bn_div (TGLC_bn *dv, TGLC_bn *rem, const TGLC_bn *a, const TGLC...
  function TGLC_bn_mod_exp (line 92) | int TGLC_bn_mod_exp (TGLC_bn *r, const TGLC_bn *a, const TGLC_bn *p, con...

FILE: crypto/err_altern.c
  function TGLC_err_print_errors_fp (line 29) | void TGLC_err_print_errors_fp (FILE *fp) {

FILE: crypto/err_openssl.c
  function TGLC_err_print_errors_fp (line 29) | void TGLC_err_print_errors_fp (FILE *fp) {

FILE: crypto/md5_altern.c
  function TGLC_md5 (line 34) | void TGLC_md5 (const unsigned char *d, size_t n, unsigned char *md) {

FILE: crypto/md5_openssl.c
  function TGLC_md5 (line 29) | void TGLC_md5(const unsigned char *d, size_t n, unsigned char *md) {

FILE: crypto/rand_altern.c
  function TGLC_rand_add (line 35) | void TGLC_rand_add (const void *buf, int num, double entropy) {
  function TGLC_rand_bytes (line 41) | int TGLC_rand_bytes (unsigned char *buf, int num) {
  function TGLC_rand_pseudo_bytes (line 46) | int TGLC_rand_pseudo_bytes (unsigned char *buf, int num) {

FILE: crypto/rand_openssl.c
  function TGLC_rand_add (line 29) | void TGLC_rand_add (const void *buf, int num, double entropy) {
  function TGLC_rand_bytes (line 33) | int TGLC_rand_bytes (unsigned char *buf, int num) {
  function TGLC_rand_pseudo_bytes (line 37) | int TGLC_rand_pseudo_bytes (unsigned char *buf, int num) {

FILE: crypto/rsa_pem.h
  type TGLC_rsa (line 28) | typedef struct TGLC_rsa TGLC_rsa;

FILE: crypto/rsa_pem_altern.c
  type TGLC_rsa (line 31) | struct TGLC_rsa {
  function TGLC_rsa (line 36) | TGLC_rsa *TGLC_rsa_new (unsigned long e, int n_bytes, const unsigned cha...
  function TGLC_rsa_free (line 54) | void TGLC_rsa_free (TGLC_rsa *key) {
  function TGLC_rsa (line 64) | TGLC_rsa *TGLC_pem_read_RSAPublicKey (FILE *fp) {

FILE: crypto/rsa_pem_openssl.c
  function TGLC_rsa (line 39) | TGLC_rsa *TGLC_rsa_new (unsigned long e, int n_bytes, const unsigned cha...
  function TGLC_rsa_free (line 55) | void TGLC_rsa_free (TGLC_rsa *p) {
  function TGLC_rsa (line 59) | TGLC_rsa *TGLC_pem_read_RSAPublicKey (FILE *fp) {

FILE: crypto/sha_altern.c
  function TGLC_sha1 (line 34) | void TGLC_sha1 (const unsigned char *d, size_t n, unsigned char *md) {
  function TGLC_sha256 (line 37) | void TGLC_sha256 (const unsigned char *d, size_t n, unsigned char *md) {

FILE: crypto/sha_openssl.c
  function TGLC_sha1 (line 29) | void TGLC_sha1 (const unsigned char *d, size_t n, unsigned char *md) {
  function TGLC_sha256 (line 32) | void TGLC_sha256 (const unsigned char *d, size_t n, unsigned char *md) {

FILE: event-old.h
  type evutil_socket_t (line 13) | typedef int evutil_socket_t;
  type event (line 15) | struct event
  type event_base (line 15) | struct event_base
  type event (line 16) | struct event
  type event_base (line 16) | struct event_base
  type event (line 17) | struct event
  type event (line 23) | struct event
  type event_base (line 23) | struct event_base
  type event (line 24) | struct event
  type event_base (line 24) | struct event_base
  type event (line 25) | struct event
  type event (line 31) | struct event
  function event_free (line 32) | static void event_free (struct event *ev) {
  type bufferevent (line 37) | struct bufferevent
  type event_base (line 37) | struct event_base
  type bufferevent (line 38) | struct bufferevent
  type event_base (line 38) | struct event_base
  type bufferevent (line 40) | struct bufferevent
  type event (line 45) | struct event

FILE: generate.c
  function strnlen (line 45) | size_t strnlen (const char *string, size_t maxlen)
  type tree_tl_type (line 79) | struct tree_tl_type
  type tree_tl_combinator (line 80) | struct tree_tl_combinator
  function tl_function_insert_by_name (line 82) | void tl_function_insert_by_name (struct tl_combinator *c) {
  type tl_type (line 86) | struct tl_type
  type tl_type (line 87) | struct tl_type
  function tl_type_insert_by_name (line 93) | void tl_type_insert_by_name (struct tl_type *t) {
  function is_empty (line 97) | int is_empty (struct tl_type *t) {
  function get_int (line 122) | int get_int (void) {
  function get_long (line 127) | long long get_long (void) {
  type tl_type (line 171) | struct tl_type
  type tl_combinator (line 172) | struct tl_combinator
  type tl_tree (line 174) | struct tl_tree
  type tl_tree (line 175) | struct tl_tree
  type tl_tree (line 176) | struct tl_tree
  type arg (line 177) | struct arg
  type tl_tree_nat_const (line 183) | struct tl_tree_nat_const
  function var_nat_const_to_int (line 194) | long long var_nat_const_to_int (void *x) {
  function tl_tree_type_type (line 202) | int tl_tree_type_type (struct tl_tree *x) {
  function tl_tree_type_array (line 206) | int tl_tree_type_array (struct tl_tree *x) {
  function tl_tree_type_nat_const (line 210) | int tl_tree_type_nat_const (struct tl_tree *x) {
  function tl_tree_type_var_num (line 214) | int tl_tree_type_var_num (struct tl_tree *x) {
  function tl_tree_type_var_type (line 218) | int tl_tree_type_var_type (struct tl_tree *x) {
  type tl_tree_methods (line 222) | struct tl_tree_methods
  type tl_tree_methods (line 226) | struct tl_tree_methods
  type tl_tree_methods (line 230) | struct tl_tree_methods
  type tl_tree_methods (line 234) | struct tl_tree_methods
  type tl_tree_methods (line 238) | struct tl_tree_methods
  type tl_tree_methods (line 242) | struct tl_tree_methods
  type tl_tree_methods (line 246) | struct tl_tree_methods
  type tl_tree_methods (line 250) | struct tl_tree_methods
  type tl_tree_methods (line 254) | struct tl_tree_methods
  type tl_tree_methods (line 258) | struct tl_tree_methods
  type tl_tree_methods (line 262) | struct tl_tree_methods
  type tl_tree (line 266) | struct tl_tree
  function print_c_type_name (line 271) | void print_c_type_name (struct tl_tree *t, char *offset, int in) {
  function gen_uni_skip (line 322) | int gen_uni_skip (struct tl_tree *t, char *cur_name, int *vars, int firs...
  function print_offset (line 395) | void print_offset (int len) {
  function gen_create (line 400) | int gen_create (struct tl_tree *t, int *vars, int offset) {
  function gen_field_skip (line 467) | int gen_field_skip (struct arg *arg, int *vars, int num) {
  function gen_field_fetch (line 530) | int gen_field_fetch (struct arg *arg, int *vars, int num, int empty) {
  function gen_field_store (line 611) | int gen_field_store (struct arg *arg, int *vars, int num, int from_func,...
  function gen_field_autocomplete (line 692) | int gen_field_autocomplete (struct arg *arg, int *vars, int num, int fro...
  function gen_field_fetch_ds (line 776) | int gen_field_fetch_ds (struct arg *arg, int *vars, int num, int empty) {
  function gen_field_free_ds (line 867) | int gen_field_free_ds (struct arg *arg, int *vars, int num, int empty) {
  function gen_field_store_ds (line 945) | int gen_field_store_ds (struct arg *arg, int *vars, int num, int empty) {
  function gen_field_print_ds (line 1023) | int gen_field_print_ds (struct arg *arg, int *vars, int num, int empty) {
  function gen_field_autocomplete_excl (line 1115) | int gen_field_autocomplete_excl (struct arg *arg, int *vars, int num, in...
  function gen_field_store_excl (line 1150) | int gen_field_store_excl (struct arg *arg, int *vars, int num, int from_...
  function gen_constructor_skip (line 1178) | void gen_constructor_skip (struct tl_combinator *c) {
  function gen_constructor_fetch (line 1227) | void gen_constructor_fetch (struct tl_combinator *c) {
  function gen_constructor_store (line 1287) | void gen_constructor_store (struct tl_combinator *c) {
  function gen_constructor_autocomplete (line 1354) | void gen_constructor_autocomplete (struct tl_combinator *c) {
  function gen_constructor_fetch_ds (line 1417) | void gen_constructor_fetch_ds (struct tl_combinator *c) {
  function gen_constructor_free_ds (line 1483) | void gen_constructor_free_ds (struct tl_combinator *c) {
  function gen_constructor_store_ds (line 1536) | void gen_constructor_store_ds (struct tl_combinator *c) {
  function gen_constructor_print_ds (line 1587) | void gen_constructor_print_ds (struct tl_combinator *c) {
  function gen_type_skip (line 1641) | void gen_type_skip (struct tl_type *t) {
  function gen_type_fetch (line 1669) | void gen_type_fetch (struct tl_type *t) {
  function gen_type_store (line 1719) | void gen_type_store (struct tl_type *t) {
  function gen_type_autocomplete (line 1763) | void gen_type_autocomplete (struct tl_type *t) {
  function gen_type_fetch_ds (line 1798) | void gen_type_fetch_ds (struct tl_type *t) {
  function gen_type_free_ds (line 1829) | void gen_type_free_ds (struct tl_type *t) {
  function gen_type_store_ds (line 1848) | void gen_type_store_ds (struct tl_type *t) {
  function gen_type_print_ds (line 1880) | void gen_type_print_ds (struct tl_type *t) {
  function gen_function_store (line 1915) | void gen_function_store (struct tl_combinator *f) {
  function gen_function_autocomplete (line 1940) | void gen_function_autocomplete (struct tl_combinator *f) {
  function gen_type_do_autocomplete (line 1964) | void gen_type_do_autocomplete (struct tl_type *t) {
  type tl_tree (line 1976) | struct tl_tree
  type tl_tree_var_num (line 1977) | struct tl_tree_var_num
  type tl_tree (line 1990) | struct tl_tree
  type tl_tree_var_type (line 1991) | struct tl_tree_var_type
  type tl_tree (line 2002) | struct tl_tree
  type tl_tree_array (line 2003) | struct tl_tree_array
  type tl_tree (line 2024) | struct tl_tree
  type tl_tree_type (line 2025) | struct tl_tree_type
  type tl_tree (line 2054) | struct tl_tree
  type tl_tree (line 2079) | struct tl_tree
  type tl_tree (line 2100) | struct tl_tree
  type tl_tree (line 2119) | struct tl_tree
  function read_args_list (line 2138) | int read_args_list (struct arg **args, int args_num, int *var_num) {
  function read_combinator_args_list (line 2181) | int read_combinator_args_list (struct tl_combinator *c) {
  function read_combinator_right (line 2192) | int read_combinator_right (struct tl_combinator *c) {
  function read_combinator_left (line 2199) | int read_combinator_left (struct tl_combinator *c) {
  type tl_combinator (line 2237) | struct tl_combinator
  type tl_combinator (line 2238) | struct tl_combinator
  type tl_type (line 2246) | struct tl_type
  type tl_type (line 2263) | struct tl_type
  type tl_type (line 2264) | struct tl_type
  function gen_skip_header (line 2288) | void gen_skip_header (void) {
  function gen_skip_source (line 2305) | void gen_skip_source (void) {
  function gen_fetch_header (line 2332) | void gen_fetch_header (void) {
  function gen_fetch_source (line 2353) | void gen_fetch_source (void) {
  function gen_store_header (line 2380) | void gen_store_header (void) {
  function gen_store_source (line 2405) | void gen_store_source (void ) {
  function gen_autocomplete_header (line 2457) | void gen_autocomplete_header (void) {
  function gen_autocomplete_source (line 2478) | void gen_autocomplete_source (void) {
  function gen_types_header (line 2532) | void gen_types_header (void) {
  function gen_types_source (line 2590) | void gen_types_source (void) {
  function gen_fetch_ds_source (line 2609) | void gen_fetch_ds_source (void) {
  function gen_fetch_ds_header (line 2636) | void gen_fetch_ds_header (void) {
  function gen_free_ds_source (line 2660) | void gen_free_ds_source (void) {
  function gen_free_ds_header (line 2687) | void gen_free_ds_header (void) {
  function gen_store_ds_source (line 2712) | void gen_store_ds_source (void) {
  function gen_store_ds_header (line 2739) | void gen_store_ds_header (void) {
  function gen_print_ds_header (line 2767) | void gen_print_ds_header (void) {
  function gen_print_ds_source (line 2799) | void gen_print_ds_source (void) {
  function parse_tlo_file (line 2830) | int parse_tlo_file (void) {
  function usage (line 2941) | void usage (void) {
  function logprintf (line 2948) | void logprintf (const char *format __attribute__ ((unused)), ...) {
  function print_backtrace (line 2958) | void print_backtrace (void) {
  function print_backtrace (line 2964) | void print_backtrace (void) {
  function sig_segv_handler (line 2971) | void sig_segv_handler (int signum __attribute__ ((unused))) {
  function sig_abrt_handler (line 2979) | void sig_abrt_handler (int signum __attribute__ ((unused))) {
  function read_all (line 2987) | static int read_all (int fd, void *buf, size_t len) {
  function main (line 3007) | int main (int argc, char **argv) {

FILE: generate.h
  type tl_combinator (line 27) | struct tl_combinator
  type tl_type (line 29) | struct tl_type {
  type tl_tree_methods (line 73) | struct tl_tree_methods
  type tl_tree_methods (line 74) | struct tl_tree_methods
  type tl_tree_methods (line 75) | struct tl_tree_methods
  type tl_tree_methods (line 76) | struct tl_tree_methods
  type tl_tree_methods (line 77) | struct tl_tree_methods
  type tl_tree_methods (line 78) | struct tl_tree_methods
  type tl_tree_methods (line 79) | struct tl_tree_methods
  type tl_tree_methods (line 80) | struct tl_tree_methods
  type tl_tree_methods (line 81) | struct tl_tree_methods
  type tl_tree_methods (line 82) | struct tl_tree_methods
  type tl_tree_methods (line 83) | struct tl_tree_methods
  type tl_tree_hash_t (line 91) | typedef unsigned long long tl_tree_hash_t;
  type tl_tree (line 92) | struct tl_tree
  type tl_tree_methods (line 94) | struct tl_tree_methods {
  type tl_tree (line 101) | struct tl_tree {
  type tl_tree_type (line 113) | struct tl_tree_type {
  type tl_tree_array (line 121) | struct tl_tree_array {
  type tl_tree_var_type (line 129) | struct tl_tree_var_type {
  type tl_tree_var_num (line 135) | struct tl_tree_var_num {
  type tl_tree_nat_const (line 142) | struct tl_tree_nat_const {
  type arg (line 148) | struct arg {
  type tl_combinator (line 157) | struct tl_combinator {

FILE: mtproto-client.c
  type tgl_state (line 72) | struct tgl_state
  type tgl_dc (line 72) | struct tgl_dc
  type tgl_session (line 72) | struct tgl_session
  type tgl_dc (line 73) | struct tgl_dc
  type tgl_state (line 80) | struct tgl_state
  type connection (line 80) | struct connection
  type tgl_state (line 81) | struct tgl_state
  type connection (line 81) | struct connection
  type tgl_state (line 82) | struct tgl_state
  type connection (line 82) | struct connection
  function get_utime (line 84) | static double get_utime (int clock_id) {
  function TGLC_rsa (line 93) | static TGLC_rsa *rsa_load_public_key (struct tgl_state *TLS, const char ...
  function encrypt_packet_buffer (line 126) | static int encrypt_packet_buffer (struct tgl_state *TLS, struct tgl_dc *...
  function encrypt_packet_buffer_aes_unauth (line 131) | static int encrypt_packet_buffer_aes_unauth (const char server_nonce[16]...
  function rpc_send_packet (line 139) | static int rpc_send_packet (struct tgl_state *TLS, struct connection *c) {
  function rpc_send_message (line 174) | static int rpc_send_message (struct tgl_state *TLS, struct connection *c...
  function check_unauthorized_header (line 200) | static int check_unauthorized_header (struct tgl_state *TLS) {
  function send_req_pq_packet (line 217) | static int send_req_pq_packet (struct tgl_state *TLS, struct connection ...
  function send_req_pq_temp_packet (line 232) | static int send_req_pq_temp_packet (struct tgl_state *TLS, struct connec...
  function send_req_dh_packet (line 251) | static void send_req_dh_packet (struct tgl_state *TLS, struct connection...
  function send_dh_params (line 297) | static void send_dh_params (struct tgl_state *TLS, struct connection *c,...
  function process_respq_answer (line 353) | static int process_respq_answer (struct tgl_state *TLS, struct connectio...
  function process_dh_answer (line 418) | static int process_dh_answer (struct tgl_state *TLS, struct connection *...
  function create_temp_auth_key (line 531) | static void create_temp_auth_key (struct tgl_state *TLS, struct connecti...
  type tgl_state (line 536) | struct tgl_state
  type connection (line 536) | struct connection
  type tgl_state (line 538) | struct tgl_state
  type tgl_state (line 539) | struct tgl_state
  type connection (line 539) | struct connection
  function process_auth_complete (line 546) | static int process_auth_complete (struct tgl_state *TLS, struct connecti...
  function bind_temp_auth_key (line 633) | static void bind_temp_auth_key (struct tgl_state *TLS, struct connection...
  type encrypted_message (line 670) | struct encrypted_message
  function get_server_time (line 672) | static double get_server_time (struct tgl_dc *DC) {
  function generate_next_msg_id (line 679) | static long long generate_next_msg_id (struct tgl_state *TLS, struct tgl...
  function init_enc_msg (line 689) | static void init_enc_msg (struct tgl_state *TLS, struct tgl_session *S, ...
  function init_enc_msg_inner_temp (line 708) | static void init_enc_msg_inner_temp (struct tgl_dc *DC, long long msg_id) {
  function aes_encrypt_message (line 717) | static int aes_encrypt_message (struct tgl_state *TLS, char *key, struct...
  function tglmp_encrypt_send_message (line 731) | long long tglmp_encrypt_send_message (struct tgl_state *TLS, struct conn...
  function tglmp_encrypt_inner_temp (line 760) | int tglmp_encrypt_inner_temp (struct tgl_state *TLS, struct connection *...
  type tgl_state (line 782) | struct tgl_state
  type connection (line 782) | struct connection
  function work_container (line 784) | static int work_container (struct tgl_state *TLS, struct connection *c, ...
  function work_new_session_created (line 807) | static int work_new_session_created (struct tgl_state *TLS, struct conne...
  function work_msgs_ack (line 825) | static int work_msgs_ack (struct tgl_state *TLS, struct connection *c, l...
  function work_rpc_result (line 839) | static int work_rpc_result (struct tgl_state *TLS, struct connection *c,...
  function work_packed (line 852) | static int work_packed (struct tgl_state *TLS, struct connection *c, lon...
  function work_bad_server_salt (line 875) | static int work_bad_server_salt (struct tgl_state *TLS, struct connectio...
  function work_pong (line 886) | static int work_pong (struct tgl_state *TLS, struct connection *c, long ...
  function work_detailed_info (line 893) | static int work_detailed_info (struct tgl_state *TLS, struct connection ...
  function work_new_detailed_info (line 902) | static int work_new_detailed_info (struct tgl_state *TLS, struct connect...
  function work_bad_msg_notification (line 910) | static int work_bad_msg_notification (struct tgl_state *TLS, struct conn...
  function rpc_execute_answer (line 938) | static int rpc_execute_answer (struct tgl_state *TLS, struct connection ...
  type mtproto_methods (line 974) | struct mtproto_methods
  type tgl_state (line 975) | struct tgl_state
  type tgl_session (line 975) | struct tgl_session
  function create_session_connect (line 1018) | static void create_session_connect (struct tgl_state *TLS, struct tgl_se...
  function fail_connection (line 1028) | static void fail_connection (struct tgl_state *TLS, struct connection *c) {
  function fail_session (line 1034) | static void fail_session (struct tgl_state *TLS, struct tgl_session *S) {
  function process_rpc_message (line 1042) | static int process_rpc_message (struct tgl_state *TLS, struct connection...
  function rpc_execute (line 1143) | static int rpc_execute (struct tgl_state *TLS, struct connection *c, int...
  function tc_close (line 1200) | static int tc_close (struct tgl_state *TLS, struct connection *c, int wh...
  function mpc_on_get_config (line 1205) | static void mpc_on_get_config (struct tgl_state *TLS, void *extra, int s...
  function tc_becomes_ready (line 1211) | static int tc_becomes_ready (struct tgl_state *TLS, struct connection *c) {
  function rpc_becomes_ready (line 1252) | static int rpc_becomes_ready (struct tgl_state *TLS, struct connection *...
  function rpc_close (line 1256) | static int rpc_close (struct tgl_state *TLS, struct connection *c) {
  function tglmp_on_start (line 1263) | int tglmp_on_start (struct tgl_state *TLS) {
  function tgl_dc_authorize (line 1299) | void tgl_dc_authorize (struct tgl_state *TLS, struct tgl_dc *DC) {
  function send_all_acks (line 1311) | static int send_all_acks (struct tgl_state *TLS, struct tgl_session *S) {
  function send_all_acks_gateway (line 1325) | static void send_all_acks_gateway (struct tgl_state *TLS, void *arg) {
  function tgln_insert_msg_id (line 1330) | void tgln_insert_msg_id (struct tgl_state *TLS, struct tgl_session *S, l...
  function regen_temp_key_gw (line 1342) | static void regen_temp_key_gw (struct tgl_state *TLS, void *arg) {
  type tgl_dc (line 1346) | struct tgl_dc
  type tgl_state (line 1346) | struct tgl_state
  type tgl_dc (line 1350) | struct tgl_dc
  type tgl_dc (line 1362) | struct tgl_dc
  type tgl_dc_option (line 1364) | struct tgl_dc_option
  type tgl_dc_option (line 1366) | struct tgl_dc_option
  type tgl_dc_option (line 1375) | struct tgl_dc_option
  type mtproto_methods (line 1385) | struct mtproto_methods
  function tglmp_dc_create_session (line 1391) | void tglmp_dc_create_session (struct tgl_state *TLS, struct tgl_dc *DC) {
  function tgl_do_send_ping (line 1403) | void tgl_do_send_ping (struct tgl_state *TLS, struct connection *c) {
  function tgl_dc_iterator (line 1410) | void tgl_dc_iterator (struct tgl_state *TLS, void (*iterator)(struct tgl...
  function tgl_dc_iterator_ex (line 1417) | void tgl_dc_iterator_ex (struct tgl_state *TLS, void (*iterator)(struct ...
  function tglmp_regenerate_temp_auth_key (line 1425) | void tglmp_regenerate_temp_auth_key (struct tgl_state *TLS, struct tgl_d...
  function tgls_free_session (line 1456) | void tgls_free_session (struct tgl_state *TLS, struct tgl_session *S) {
  function tgls_free_dc (line 1465) | void tgls_free_dc (struct tgl_state *TLS, struct tgl_dc *DC) {
  function tgls_free_pubkey (line 1486) | void tgls_free_pubkey (struct tgl_state *TLS) {

FILE: mtproto-client.h
  type connection (line 37) | struct connection
  type tgl_dc (line 38) | struct tgl_dc
  type connection (line 46) | struct connection
  type tgl_state (line 48) | struct tgl_state
  type connection (line 48) | struct connection
  type tgl_state (line 49) | struct tgl_state
  type tgl_dc (line 49) | struct tgl_dc
  type tgl_dc (line 52) | struct tgl_dc
  type tgl_state (line 52) | struct tgl_state
  type tgl_state (line 53) | struct tgl_state
  type tgl_dc (line 53) | struct tgl_dc
  type tgl_state (line 55) | struct tgl_state
  type tgl_session (line 55) | struct tgl_session
  type tgl_state (line 56) | struct tgl_state
  type tgl_state (line 57) | struct tgl_state
  type tgl_dc (line 57) | struct tgl_dc
  type tgl_state (line 58) | struct tgl_state
  type tgl_dc (line 58) | struct tgl_dc
  type tgl_state (line 59) | struct tgl_state
  type tgl_state (line 60) | struct tgl_state
  type connection (line 60) | struct connection

FILE: mtproto-common.c
  function get_random_bytes (line 68) | static int get_random_bytes (struct tgl_state *TLS, unsigned char *buf, ...
  function get_random_bytes (line 101) | static int get_random_bytes (struct tgl_state *TLS, unsigned char *buf, ...
  function rdtsc (line 120) | static __inline__ unsigned long long rdtsc (void) {
  function rdtsc (line 127) | static __inline__ unsigned long long rdtsc (void) {
  function tgl_prng_seed (line 134) | void tgl_prng_seed (struct tgl_state *TLS, const char *password_filename...
  function tgl_serialize_bignum (line 175) | int tgl_serialize_bignum (TGLC_bn *b, char *buffer, int maxlen) {
  function tgl_do_compute_rsa_key_fingerprint (line 205) | long long tgl_do_compute_rsa_key_fingerprint (TGLC_rsa *key) {
  function tgl_out_cstring (line 217) | void tgl_out_cstring (const char *str, long len) {
  function tgl_out_cstring_careful (line 235) | void tgl_out_cstring_careful (const char *str, long len) {
  function tgl_out_data (line 260) | void tgl_out_data (const void *data, long len) {
  function tgl_fetch_bignum (line 269) | int tgl_fetch_bignum (TGLC_bn *x) {
  function tgl_pad_rsa_encrypt (line 279) | int tgl_pad_rsa_encrypt (struct tgl_state *TLS, char *from, int from_len...
  function tgl_pad_rsa_decrypt (line 307) | int tgl_pad_rsa_decrypt (struct tgl_state *TLS, char *from, int from_len...
  function tgl_init_aes_unauth (line 343) | void tgl_init_aes_unauth (const char server_nonce[16], const char hidden...
  function tgl_init_aes_auth (line 364) | void tgl_init_aes_auth (char auth_key[192], char msg_key[16], int encryp...
  function tgl_pad_aes_encrypt (line 404) | int tgl_pad_aes_encrypt (char *from, int from_len, char *to, int size) {
  function tgl_pad_aes_decrypt (line 414) | int tgl_pad_aes_decrypt (char *from, int from_len, char *to, int size) {

FILE: mtproto-common.h
  type encrypted_message (line 107) | struct encrypted_message {
  type tgl_state (line 126) | struct tgl_state
  function out_ints (line 136) | static inline void out_ints (const int *what, int len) {
  function out_int (line 143) | static inline void out_int (int x) {
  function out_long (line 149) | static inline void out_long (long long x) {
  function out_double (line 155) | static inline void out_double (double x) {
  function clear_packet (line 161) | static inline void clear_packet (void) {
  function out_string (line 173) | static inline void out_string (const char *str) {
  function out_bignum (line 177) | static inline void out_bignum (TGLC_bn *n) {
  function prefetch_strlen (line 192) | static inline int prefetch_strlen (void) {
  function fetch_update_str (line 235) | static inline int fetch_update_str (char **s) {
  function fetch_update_int (line 252) | static inline int fetch_update_int (int *value) {
  function fetch_update_long (line 262) | static inline int fetch_update_long (long long *value) {
  function set_update_int (line 273) | static inline int set_update_int (int *value, int new_value) {
  function fetch_skip (line 282) | static inline void fetch_skip (int n) {
  function fetch_skip_str (line 287) | static inline void fetch_skip_str (void) {
  function have_prefetch_ints (line 293) | static inline long have_prefetch_ints (void) {
  function fetch_int (line 300) | static inline int fetch_int (void) {
  function fetch_bool (line 305) | static inline int fetch_bool (void) {
  function prefetch_int (line 311) | static inline int prefetch_int (void) {
  function prefetch_data (line 316) | static inline void prefetch_data (void *data, int size) {
  function fetch_data (line 321) | static inline void fetch_data (void *data, int size) {
  function fetch_long (line 328) | static inline long long fetch_long (void) {
  function fetch_double (line 335) | static inline double fetch_double (void) {
  function fetch_ints (line 342) | static inline void fetch_ints (void *data, int count) {
  function fetch256 (line 348) | static inline void fetch256 (void *buf) {
  function in_remaining (line 360) | static inline int in_remaining (void) {
  type tgl_state (line 366) | struct tgl_state
  type tgl_state (line 367) | struct tgl_state

FILE: mtproto-key.c
  function tglmp_get_default_key_len (line 51) | unsigned int tglmp_get_default_key_len (void) {
  function tglmp_get_default_e (line 54) | long long tglmp_get_default_e (void) {

FILE: mtproto-utils.c
  function gcd (line 8) | static unsigned long long gcd (unsigned long long a, unsigned long long ...
  function check_prime (line 12) | static int check_prime (struct tgl_state *TLS, TGLC_bn *p) {
  function tglmp_check_DH_params (line 23) | int tglmp_check_DH_params (struct tgl_state *TLS, TGLC_bn *p, int g) {
  function tglmp_check_g_a (line 76) | int tglmp_check_g_a (struct tgl_state *TLS, TGLC_bn *p, TGLC_bn *g_a) {
  function BN2ull (line 97) | static unsigned long long BN2ull (TGLC_bn *b) {
  function ull2BN (line 111) | static void ull2BN (TGLC_bn *b, unsigned long long val) {
  function bn_factorize (line 124) | int bn_factorize (TGLC_bn *pq, TGLC_bn *p, TGLC_bn *q) {

FILE: mtproto-utils.h
  type tgl_state (line 4) | struct tgl_state
  type tgl_state (line 5) | struct tgl_state

FILE: queries-encrypted.c
  type tgl_secret_chat (line 7) | struct tgl_secret_chat
  function encr_start (line 55) | static void encr_start (void) {
  function encr_finish (line 64) | static void encr_finish (struct tgl_secret_chat *E) {
  function tgl_do_send_encr_action (line 83) | void tgl_do_send_encr_action (struct tgl_state *TLS, struct tgl_secret_c...
  function tgl_do_send_encr_chat_layer (line 98) | void tgl_do_send_encr_chat_layer (struct tgl_state *TLS, struct tgl_secr...
  function tgl_do_set_encr_chat_ttl (line 107) | void tgl_do_set_encr_chat_ttl (struct tgl_state *TLS, struct tgl_secret_...
  function msg_send_encr_on_answer (line 117) | static int msg_send_encr_on_answer (struct tgl_state *TLS, struct query ...
  function msg_send_encr_on_error (line 135) | static int msg_send_encr_on_error (struct tgl_state *TLS, struct query *...
  type query_methods (line 152) | struct query_methods
  function tgl_do_send_encr_msg_action (line 161) | void tgl_do_send_encr_msg_action (struct tgl_state *TLS, struct tgl_mess...
  function tgl_do_send_encr_msg (line 227) | void tgl_do_send_encr_msg (struct tgl_state *TLS, struct tgl_message *M,...
  function mark_read_encr_on_receive (line 276) | static int mark_read_encr_on_receive (struct tgl_state *TLS, struct quer...
  function mark_read_encr_on_error (line 283) | static int mark_read_encr_on_error (struct tgl_state *TLS, struct query ...
  type query_methods (line 293) | struct query_methods
  function tgl_do_messages_mark_read_encr (line 301) | void tgl_do_messages_mark_read_encr (struct tgl_state *TLS, tgl_peer_id_...
  function send_encr_file_on_answer (line 311) | static int send_encr_file_on_answer (struct tgl_state *TLS, struct query...
  type query_methods (line 327) | struct query_methods
  function send_file_encrypted_end (line 335) | static void send_file_encrypted_end (struct tgl_state *TLS, struct send_...
  function tgl_do_send_location_encr (line 449) | void tgl_do_send_location_encr (struct tgl_state *TLS, tgl_peer_id_t pee...
  function send_encr_accept_on_answer (line 475) | static int send_encr_accept_on_answer (struct tgl_state *TLS, struct que...
  function send_encr_request_on_answer (line 487) | static int send_encr_request_on_answer (struct tgl_state *TLS, struct qu...
  function encr_accept_on_error (line 496) | static int encr_accept_on_error (struct tgl_state *TLS, struct query *q,...
  type query_methods (line 509) | struct query_methods
  type query_methods (line 517) | struct query_methods
  function tgl_do_send_accept_encr_chat (line 530) | void tgl_do_send_accept_encr_chat (struct tgl_state *TLS, struct tgl_sec...
  function tgl_do_create_keys_end (line 608) | void tgl_do_create_keys_end (struct tgl_state *TLS, struct tgl_secret_ch...
  function tgl_do_send_create_encr_chat (line 644) | void tgl_do_send_create_encr_chat (struct tgl_state *TLS, void *x, unsig...
  function send_encr_discard_on_answer (line 710) | static int send_encr_discard_on_answer (struct tgl_state *TLS, struct qu...
  type query_methods (line 721) | struct query_methods
  function tgl_do_discard_secret_chat (line 729) | void tgl_do_discard_secret_chat (struct tgl_state *TLS, struct tgl_secre...
  function get_dh_config_on_answer (line 747) | static int get_dh_config_on_answer (struct tgl_state *TLS, struct query ...
  type query_methods (line 771) | struct query_methods
  function tgl_do_accept_encr_chat_request (line 779) | void tgl_do_accept_encr_chat_request (struct tgl_state *TLS, struct tgl_...
  function tgl_do_create_encr_chat_request (line 798) | void tgl_do_create_encr_chat_request (struct tgl_state *TLS, int user_id...

FILE: queries.c
  type tgl_state (line 82) | struct tgl_state
  type query_methods (line 83) | struct query_methods
  type messages_send_extra (line 85) | struct messages_send_extra {
  type send_file (line 93) | struct send_file {
  function mystreq1 (line 121) | static int mystreq1 (const char *a, const char *b, int l) {
  type query (line 128) | struct query
  type tgl_state (line 128) | struct tgl_state
  function alarm_query (line 132) | static int alarm_query (struct tgl_state *TLS, struct query *q) {
  function tglq_regen_query (line 166) | void tglq_regen_query (struct tgl_state *TLS, long long id) {
  type regen_tmp_struct (line 182) | struct regen_tmp_struct {
  function tglq_regen_query_from_old_session (line 188) | void tglq_regen_query_from_old_session (struct query *q, void *ex) {
  function tglq_regen_queries_from_old_session (line 200) | void tglq_regen_queries_from_old_session (struct tgl_state *TLS, struct ...
  function tglq_query_restart (line 208) | void tglq_query_restart (struct tgl_state *TLS, long long id) {
  function alarm_query_gateway (line 217) | static void alarm_query_gateway (struct tgl_state *TLS, void *arg) {
  type query (line 222) | struct query
  type tgl_state (line 222) | struct tgl_state
  type tgl_dc (line 222) | struct tgl_dc
  type query_methods (line 222) | struct query_methods
  type query (line 229) | struct query
  type query (line 261) | struct query
  type tgl_state (line 261) | struct tgl_state
  type tgl_dc (line 261) | struct tgl_dc
  type query_methods (line 261) | struct query_methods
  function fail_on_error (line 265) | static int fail_on_error (struct tgl_state *TLS, struct query *q, int er...
  function tglq_query_ack (line 271) | void tglq_query_ack (struct tgl_state *TLS, long long id) {
  function tglq_query_delete (line 280) | void tglq_query_delete (struct tgl_state *TLS, long long id) {
  type tgl_state (line 294) | struct tgl_state
  function tglq_free_query (line 296) | void tglq_free_query (struct query *q, void *extra) {
  function tglq_query_free_all (line 305) | void tglq_query_free_all (struct tgl_state *TLS) {
  function tglq_query_error (line 310) | int tglq_query_error (struct tgl_state *TLS, long long id) {
  function tglq_query_result (line 438) | int tglq_query_result (struct tgl_state *TLS, long long id) {
  function out_random (line 497) | static void out_random (int n) {
  function tgl_do_insert_header (line 505) | void tgl_do_insert_header (struct tgl_state *TLS) {
  type tgl_state (line 539) | struct tgl_state
  function tgl_set_query_error (line 540) | void tgl_set_query_error (struct tgl_state *TLS, int error_code, const c...
  function q_void_on_error (line 558) | static int q_void_on_error (struct tgl_state *TLS, struct query *q, int ...
  function q_ptr_on_error (line 566) | static int q_ptr_on_error (struct tgl_state *TLS, struct query *q, int e...
  function q_list_on_error (line 574) | static int q_list_on_error (struct tgl_state *TLS, struct query *q, int ...
  function increase_ent (line 585) | static void increase_ent (int *ent_size, int **ent, int s) {
  function utf8_len (line 590) | int utf8_len (const char *s, int len) {
  type tgl_state (line 601) | struct tgl_state
  function fetch_dc_option (line 800) | static void fetch_dc_option (struct tgl_state *TLS, struct tl_ds_dc_opti...
  function help_get_config_on_answer (line 804) | static int help_get_config_on_answer (struct tgl_state *TLS, struct quer...
  type query_methods (line 822) | struct query_methods
  function tgl_do_help_get_config (line 830) | void tgl_do_help_get_config (struct tgl_state *TLS, void (*callback)(str...
  function tgl_do_help_get_config_dc (line 837) | void tgl_do_help_get_config_dc (struct tgl_state *TLS, struct tgl_dc *D,...
  function send_code_on_answer (line 846) | static int send_code_on_answer (struct tgl_state *TLS, struct query *q, ...
  type query_methods (line 859) | struct query_methods
  function tgl_do_send_code (line 866) | void tgl_do_send_code (struct tgl_state *TLS, const char *phone, int pho...
  function phone_call_on_answer (line 882) | static int phone_call_on_answer (struct tgl_state *TLS, struct query *q,...
  type query_methods (line 889) | struct query_methods
  function tgl_do_phone_call (line 896) | void tgl_do_phone_call (struct tgl_state *TLS, const char *phone, int ph...
  function sign_in_on_answer (line 910) | static int sign_in_on_answer (struct tgl_state *TLS, struct query *q, vo...
  function sign_in_on_error (line 925) | static int sign_in_on_error (struct tgl_state *TLS, struct query *q, int...
  type query_methods (line 933) | struct query_methods
  function tgl_do_send_code_result (line 940) | int tgl_do_send_code_result (struct tgl_state *TLS, const char *phone, i...
  function tgl_do_send_code_result_auth (line 950) | int tgl_do_send_code_result_auth (struct tgl_state *TLS, const char *pho...
  function tgl_do_send_bot_auth (line 962) | int tgl_do_send_bot_auth (struct tgl_state *TLS, const char *code, int c...
  function get_contacts_on_answer (line 975) | static int get_contacts_on_answer (struct tgl_state *TLS, struct query *...
  type query_methods (line 992) | struct query_methods
  function tgl_do_update_contact_list (line 1000) | void tgl_do_update_contact_list (struct tgl_state *TLS, void (*callback)...
  function msg_send_on_answer (line 1009) | static int msg_send_on_answer (struct tgl_state *TLS, struct query *q, v...
  function msg_send_on_error (line 1035) | static int msg_send_on_error (struct tgl_state *TLS, struct query *q, in...
  type query_methods (line 1052) | struct query_methods
  function tgl_do_send_msg (line 1059) | void tgl_do_send_msg (struct tgl_state *TLS, struct tgl_message *M, void...
  function tgl_do_send_message (line 1140) | void tgl_do_send_message (struct tgl_state *TLS, tgl_peer_id_t peer_id, ...
  function tgl_do_reply_message (line 1230) | void tgl_do_reply_message (struct tgl_state *TLS, tgl_message_id_t *_rep...
  function tgl_do_send_text (line 1257) | void tgl_do_send_text (struct tgl_state *TLS, tgl_peer_id_t id, const ch...
  function tgl_do_reply_text (line 1289) | void tgl_do_reply_text (struct tgl_state *TLS, tgl_message_id_t *_reply_...
  type mark_read_extra (line 1317) | struct mark_read_extra {
  type tgl_state (line 1322) | struct tgl_state
  type tgl_state (line 1322) | struct tgl_state
  function mark_read_channels_on_receive (line 1324) | static int mark_read_channels_on_receive (struct tgl_state *TLS, struct ...
  function mark_read_on_receive (line 1337) | static int mark_read_on_receive (struct tgl_state *TLS, struct query *q,...
  function mark_read_on_error (line 1362) | static int mark_read_on_error (struct tgl_state *TLS, struct query *q, i...
  type query_methods (line 1373) | struct query_methods
  type query_methods (line 1380) | struct query_methods
  function tgl_do_messages_mark_read (line 1387) | void tgl_do_messages_mark_read (struct tgl_state *TLS, tgl_peer_id_t id,...
  function tgl_do_mark_read (line 1422) | void tgl_do_mark_read (struct tgl_state *TLS, tgl_peer_id_t id, void (*c...
  type get_history_extra (line 1445) | struct get_history_extra {
  type tgl_state (line 1455) | struct tgl_state
  type get_history_extra (line 1455) | struct get_history_extra
  type tgl_state (line 1455) | struct tgl_state
  type tgl_message (line 1455) | struct tgl_message
  function get_history_on_answer (line 1458) | static int get_history_on_answer (struct tgl_state *TLS, struct query *q...
  function get_history_on_error (line 1517) | static int get_history_on_error (struct tgl_state *TLS, struct query *q,...
  type query_methods (line 1530) | struct query_methods
  function tgl_do_get_local_history (line 1537) | void tgl_do_get_local_history (struct tgl_state *TLS, tgl_peer_id_t id, ...
  function _tgl_do_get_history (line 1577) | static void _tgl_do_get_history (struct tgl_state *TLS, struct get_histo...
  function tgl_do_get_history (line 1598) | void tgl_do_get_history (struct tgl_state *TLS, tgl_peer_id_t id, int of...
  type get_dialogs_extra (line 1613) | struct get_dialogs_extra {
  type tgl_state (line 1631) | struct tgl_state
  type get_dialogs_extra (line 1631) | struct get_dialogs_extra
  type tgl_state (line 1631) | struct tgl_state
  function get_dialogs_on_answer (line 1633) | static int get_dialogs_on_answer (struct tgl_state *TLS, struct query *q...
  function get_dialogs_on_error (line 1722) | static int get_dialogs_on_error (struct tgl_state *TLS, struct query *q,...
  type query_methods (line 1738) | struct query_methods
  function _tgl_do_get_dialog_list (line 1745) | static void _tgl_do_get_dialog_list (struct tgl_state *TLS, struct get_d...
  function tgl_do_get_dialog_list (line 1767) | void tgl_do_get_dialog_list (struct tgl_state *TLS, int limit, int offse...
  function tgl_do_get_channels_dialog_list (line 1775) | void tgl_do_get_channels_dialog_list (struct tgl_state *TLS, int limit, ...
  function out_peer_id (line 1790) | static void out_peer_id (struct tgl_state *TLS, tgl_peer_id_t id) {
  type tgl_state (line 1811) | struct tgl_state
  type send_file (line 1811) | struct send_file
  function send_file_part_on_answer (line 1812) | static int send_file_part_on_answer (struct tgl_state *TLS, struct query...
  function set_photo_on_answer (line 1817) | static int set_photo_on_answer (struct tgl_state *TLS, struct query *q, ...
  function send_file_part_on_error (line 1824) | static int send_file_part_on_error (struct tgl_state *TLS, struct query ...
  type query_methods (line 1843) | struct query_methods
  type query_methods (line 1850) | struct query_methods
  function send_avatar_end (line 1857) | static void send_avatar_end (struct tgl_state *TLS, struct send_file *f,...
  function send_file_unencrypted_end (line 1906) | static void send_file_unencrypted_end (struct tgl_state *TLS, struct sen...
  function send_file_end (line 2004) | static void send_file_end (struct tgl_state *TLS, struct send_file *f, v...
  function send_part (line 2021) | static void send_part (struct tgl_state *TLS, struct send_file *f, void ...
  function send_file_thumb (line 2070) | static void send_file_thumb (struct tgl_state *TLS, struct send_file *f,...
  function _tgl_do_send_photo (line 2081) | static void _tgl_do_send_photo (struct tgl_state *TLS, tgl_peer_id_t to_...
  function tgl_do_send_document (line 2173) | void tgl_do_send_document (struct tgl_state *TLS, tgl_peer_id_t to_id, c...
  function tgl_do_reply_document (line 2191) | void tgl_do_reply_document (struct tgl_state *TLS, tgl_message_id_t *_re...
  function tgl_do_set_chat_photo (line 2216) | void tgl_do_set_chat_photo (struct tgl_state *TLS, tgl_peer_id_t chat_id...
  function tgl_do_set_channel_photo (line 2221) | void tgl_do_set_channel_photo (struct tgl_state *TLS, tgl_peer_id_t chat...
  function tgl_do_set_profile_photo (line 2226) | void tgl_do_set_profile_photo (struct tgl_state *TLS, const char *file_n...
  function set_profile_name_on_answer (line 2233) | int set_profile_name_on_answer (struct tgl_state *TLS, struct query *q, ...
  type query_methods (line 2242) | struct query_methods
  function tgl_do_set_profile_name (line 2249) | void tgl_do_set_profile_name (struct tgl_state *TLS, const char *first_n...
  function tgl_do_set_username (line 2258) | void tgl_do_set_username (struct tgl_state *TLS, const char *username, i...
  function contact_search_on_answer (line 2269) | int contact_search_on_answer (struct tgl_state *TLS, struct query *q, vo...
  type query_methods (line 2292) | struct query_methods
  function tgl_do_contact_search (line 2299) | void tgl_do_contact_search (struct tgl_state *TLS, const char *name, int...
  function send_msgs_on_answer (line 2310) | static int send_msgs_on_answer (struct tgl_state *TLS, struct query *q, ...
  function send_msgs_on_error (line 2350) | static int send_msgs_on_error (struct tgl_state *TLS, struct query *q, i...
  type query_methods (line 2374) | struct query_methods
  function tgl_do_forward_messages (line 2381) | void tgl_do_forward_messages (struct tgl_state *TLS, tgl_peer_id_t id, i...
  function tgl_do_forward_message (line 2468) | void tgl_do_forward_message (struct tgl_state *TLS, tgl_peer_id_t peer_i...
  function tgl_do_send_contact (line 2509) | void tgl_do_send_contact (struct tgl_state *TLS, tgl_peer_id_t id, const...
  function tgl_do_reply_contact (line 2538) | void tgl_do_reply_contact (struct tgl_state *TLS, tgl_message_id_t *_rep...
  function tgl_do_forward_media (line 2563) | void tgl_do_forward_media (struct tgl_state *TLS, tgl_peer_id_t peer_id,...
  function tgl_do_send_location (line 2649) | void tgl_do_send_location (struct tgl_state *TLS, tgl_peer_id_t peer_id,...
  function tgl_do_reply_location (line 2676) | void tgl_do_reply_location (struct tgl_state *TLS, tgl_message_id_t *_re...
  function tgl_do_rename_chat (line 2704) | void tgl_do_rename_chat (struct tgl_state *TLS, tgl_peer_id_t id, const ...
  function tgl_do_rename_channel (line 2716) | void tgl_do_rename_channel (struct tgl_state *TLS, tgl_peer_id_t id, con...
  function tgl_do_join_channel (line 2730) | void tgl_do_join_channel (struct tgl_state *TLS, tgl_peer_id_t id, void ...
  function tgl_do_leave_channel (line 2743) | void tgl_do_leave_channel (struct tgl_state *TLS, tgl_peer_id_t id, void...
  function channels_set_about_on_answer (line 2756) | static int channels_set_about_on_answer (struct tgl_state *TLS, struct q...
  type query_methods (line 2763) | struct query_methods
  function tgl_do_channel_set_about (line 2770) | void tgl_do_channel_set_about (struct tgl_state *TLS, tgl_peer_id_t id, ...
  function tgl_do_channel_set_username (line 2783) | void tgl_do_channel_set_username (struct tgl_state *TLS, tgl_peer_id_t i...
  function tgl_do_channel_set_admin (line 2796) | void tgl_do_channel_set_admin (struct tgl_state *TLS, tgl_peer_id_t chan...
  type channel_get_members_extra (line 2823) | struct channel_get_members_extra {
  type tgl_state (line 2833) | struct tgl_state
  type channel_get_members_extra (line 2833) | struct channel_get_members_extra
  type tgl_state (line 2833) | struct tgl_state
  type tgl_user (line 2833) | struct tgl_user
  function channels_get_members_on_answer (line 2835) | static int channels_get_members_on_answer (struct tgl_state *TLS, struct...
  function channels_get_members_on_error (line 2866) | static int channels_get_members_on_error (struct tgl_state *TLS, struct ...
  type query_methods (line 2879) | struct query_methods
  function _tgl_do_channel_get_members (line 2886) | void _tgl_do_channel_get_members  (struct tgl_state *TLS, struct channel...
  function tgl_do_channel_get_members (line 2912) | void tgl_do_channel_get_members  (struct tgl_state *TLS, tgl_peer_id_t c...
  function chat_info_on_answer (line 2924) | static int chat_info_on_answer (struct tgl_state *TLS, struct query *q, ...
  type query_methods (line 2933) | struct query_methods
  function tgl_do_get_chat_info (line 2940) | void tgl_do_get_chat_info (struct tgl_state *TLS, tgl_peer_id_t id, int ...
  function channel_info_on_answer (line 2965) | static int channel_info_on_answer (struct tgl_state *TLS, struct query *...
  type query_methods (line 2974) | struct query_methods
  function tgl_do_get_channel_info (line 2981) | void tgl_do_get_channel_info (struct tgl_state *TLS, tgl_peer_id_t id, i...
  function user_info_on_answer (line 3008) | static int user_info_on_answer (struct tgl_state *TLS, struct query *q, ...
  type query_methods (line 3016) | struct query_methods
  function tgl_do_get_user_info (line 3023) | void tgl_do_get_user_info (struct tgl_state *TLS, tgl_peer_id_t id, int ...
  function resend_query_cb (line 3054) | static void resend_query_cb (struct tgl_state *TLS, void *_q, int succes...
  type download (line 3073) | struct download {
  function end_load (line 3093) | static void end_load (struct tgl_state *TLS, struct download *D, void *c...
  type tgl_state (line 3112) | struct tgl_state
  type download (line 3112) | struct download
  function download_on_answer (line 3113) | static int download_on_answer (struct tgl_state *TLS, struct query *q, v...
  function download_on_error (line 3170) | static int download_on_error (struct tgl_state *TLS, struct query *q, in...
  type query_methods (line 3193) | struct query_methods
  function load_next_part (line 3200) | static void load_next_part (struct tgl_state *TLS, struct download *D, v...
  function tgl_do_load_photo_size (line 3257) | void tgl_do_load_photo_size (struct tgl_state *TLS, struct tgl_photo_siz...
  function tgl_do_load_file_location (line 3280) | void tgl_do_load_file_location (struct tgl_state *TLS, struct tgl_file_l...
  function tgl_do_load_photo (line 3303) | void tgl_do_load_photo (struct tgl_state *TLS, struct tgl_photo *photo, ...
  function tgl_do_load_document_thumb (line 3323) | void tgl_do_load_document_thumb (struct tgl_state *TLS, struct tgl_docum...
  function _tgl_do_load_document (line 3327) | static void _tgl_do_load_document (struct tgl_state *TLS, struct tgl_doc...
  function tgl_do_load_document (line 3346) | void tgl_do_load_document (struct tgl_state *TLS, struct tgl_document *V...
  function tgl_do_load_video (line 3354) | void tgl_do_load_video (struct tgl_state *TLS, struct tgl_document *V, v...
  function tgl_do_load_audio (line 3362) | void tgl_do_load_audio (struct tgl_state *TLS, struct tgl_document *V, v...
  function tgl_do_load_encr_document (line 3370) | void tgl_do_load_encr_document (struct tgl_state *TLS, struct tgl_encr_d...
  function import_auth_on_answer (line 3402) | static int import_auth_on_answer (struct tgl_state *TLS, struct query *q...
  type query_methods (line 3414) | struct query_methods
  function export_auth_on_answer (line 3421) | static int export_auth_on_answer (struct tgl_state *TLS, struct query *q...
  type query_methods (line 3436) | struct query_methods
  function tgl_do_export_auth (line 3443) | void tgl_do_export_auth (struct tgl_state *TLS, int num, void (*callback...
  function add_contact_on_answer (line 3452) | static int add_contact_on_answer (struct tgl_state *TLS, struct query *q...
  type query_methods (line 3476) | struct query_methods
  function tgl_do_add_contact (line 3483) | void tgl_do_add_contact (struct tgl_state *TLS, const char *phone, int p...
  function del_contact_on_answer (line 3501) | static int del_contact_on_answer (struct tgl_state *TLS, struct query *q...
  type query_methods (line 3508) | struct query_methods
  function tgl_do_del_contact (line 3515) | void tgl_do_del_contact (struct tgl_state *TLS, tgl_peer_id_t id, void (...
  type msg_search_extra (line 3535) | struct msg_search_extra {
  type tgl_state (line 3548) | struct tgl_state
  type msg_search_extra (line 3548) | struct msg_search_extra
  type tgl_state (line 3548) | struct tgl_state
  type tgl_message (line 3548) | struct tgl_message
  function msg_search_on_answer (line 3550) | static int msg_search_on_answer (struct tgl_state *TLS, struct query *q,...
  function msg_search_on_error (line 3603) | static int msg_search_on_error (struct tgl_state *TLS, struct query *q, ...
  type query_methods (line 3616) | struct query_methods
  function _tgl_do_msg_search (line 3623) | static void _tgl_do_msg_search (struct tgl_state *TLS, struct msg_search...
  function tgl_do_msg_search (line 3648) | void tgl_do_msg_search (struct tgl_state *TLS, tgl_peer_id_t id, int fro...
  function get_state_on_answer (line 3670) | static int get_state_on_answer (struct tgl_state *TLS, struct query *q, ...
  function lookup_state_on_answer (line 3687) | static int lookup_state_on_answer (struct tgl_state *TLS, struct query *...
  function get_difference_on_answer (line 3701) | static int get_difference_on_answer (struct tgl_state *TLS, struct query...
  type query_methods (line 3778) | struct query_methods
  type query_methods (line 3785) | struct query_methods
  type query_methods (line 3792) | struct query_methods
  function tgl_do_lookup_state (line 3799) | void tgl_do_lookup_state (struct tgl_state *TLS) {
  function tgl_do_get_difference (line 3809) | void tgl_do_get_difference (struct tgl_state *TLS, int sync_from_start, ...
  type tgl_state (line 3838) | struct tgl_state
  type tgl_state (line 3838) | struct tgl_state
  function get_channel_difference_on_answer (line 3840) | static int get_channel_difference_on_answer (struct tgl_state *TLS, stru...
  type query_methods (line 3897) | struct query_methods
  function tgl_do_get_channel_difference (line 3904) | void tgl_do_get_channel_difference (struct tgl_state *TLS, int id, void ...
  function tgl_do_visualize_key (line 3940) | int tgl_do_visualize_key (struct tgl_state *TLS, tgl_peer_id_t id, unsig...
  function tgl_do_add_user_to_chat (line 3955) | void tgl_do_add_user_to_chat (struct tgl_state *TLS, tgl_peer_id_t chat_...
  function tgl_do_del_user_from_chat (line 3969) | void tgl_do_del_user_from_chat (struct tgl_state *TLS, tgl_peer_id_t cha...
  function tgl_do_channel_invite_user (line 3985) | void tgl_do_channel_invite_user (struct tgl_state *TLS, tgl_peer_id_t ch...
  function tgl_do_channel_kick_user (line 4001) | void tgl_do_channel_kick_user (struct tgl_state *TLS, tgl_peer_id_t chan...
  function tgl_do_create_secret_chat (line 4020) | void tgl_do_create_secret_chat (struct tgl_state *TLS, tgl_peer_id_t id,...
  function tgl_do_create_group_chat (line 4037) | void tgl_do_create_group_chat (struct tgl_state *TLS, int users_num, tgl...
  function tgl_do_create_channel (line 4063) | void tgl_do_create_channel (struct tgl_state *TLS, int users_num, tgl_pe...
  function delete_msg_on_answer (line 4091) | static int delete_msg_on_answer (struct tgl_state *TLS, struct query *q,...
  function delete_msg_on_error (line 4115) | static int delete_msg_on_error (struct tgl_state *TLS, struct query *q, ...
  type query_methods (line 4125) | struct query_methods
  function tgl_do_delete_msg (line 4132) | void tgl_do_delete_msg (struct tgl_state *TLS, tgl_message_id_t *_msg_id...
  function export_card_on_answer (line 4169) | static int export_card_on_answer (struct tgl_state *TLS, struct query *q...
  type query_methods (line 4187) | struct query_methods
  function tgl_do_export_card (line 4194) | void tgl_do_export_card (struct tgl_state *TLS, void (*callback)(struct ...
  function import_card_on_answer (line 4203) | static int import_card_on_answer (struct tgl_state *TLS, struct query *q...
  type query_methods (line 4212) | struct query_methods
  function tgl_do_import_card (line 4219) | void tgl_do_import_card (struct tgl_state *TLS, int size, int *card, voi...
  function tgl_do_start_bot (line 4229) | void tgl_do_start_bot (struct tgl_state *TLS, tgl_peer_id_t bot, tgl_pee...
  function send_typing_on_answer (line 4244) | static int send_typing_on_answer (struct tgl_state *TLS, struct query *q...
  type query_methods (line 4251) | struct query_methods
  function tgl_do_send_typing (line 4258) | void tgl_do_send_typing (struct tgl_state *TLS, tgl_peer_id_t id, enum t...
  type tgl_state (line 4307) | struct tgl_state
  type paramed_type (line 4307) | struct paramed_type
  function ext_query_on_answer (line 4309) | static int ext_query_on_answer (struct tgl_state *TLS, struct query *q, ...
  type query_methods (line 4318) | struct query_methods
  function tgl_do_send_extf (line 4324) | void tgl_do_send_extf (struct tgl_state *TLS, const char *data, int data...
  function tgl_do_send_extf (line 4334) | void tgl_do_send_extf (struct tgl_state *TLS, const char *data, int data...
  function get_messages_on_answer (line 4342) | static int get_messages_on_answer (struct tgl_state *TLS, struct query *...
  type query_methods (line 4383) | struct query_methods
  function tgl_do_get_message (line 4390) | void tgl_do_get_message (struct tgl_state *TLS, tgl_message_id_t *_msg_i...
  function export_chat_link_on_answer (line 4425) | static int export_chat_link_on_answer (struct tgl_state *TLS, struct que...
  type query_methods (line 4438) | struct query_methods
  function tgl_do_export_chat_link (line 4445) | void tgl_do_export_chat_link (struct tgl_state *TLS, tgl_peer_id_t id, v...
  function tgl_do_import_chat_link (line 4461) | void tgl_do_import_chat_link (struct tgl_state *TLS, const char *link, i...
  function tgl_do_export_channel_link (line 4479) | void tgl_do_export_channel_link (struct tgl_state *TLS, tgl_peer_id_t id...
  function set_password_on_answer (line 4500) | static int set_password_on_answer (struct tgl_state *TLS, struct query *...
  function set_password_on_error (line 4507) | static int set_password_on_error (struct tgl_state *TLS, struct query *q...
  type query_methods (line 4538) | struct query_methods
  function tgl_do_act_set_password (line 4545) | static void tgl_do_act_set_password (struct tgl_state *TLS, const char *...
  type change_password_extra (line 4596) | struct change_password_extra {
  type tgl_state (line 4611) | struct tgl_state
  function tgl_on_new2_pwd (line 4612) | void tgl_on_new2_pwd (struct tgl_state *TLS, const char *pwd, void *_T) {
  function tgl_on_new_pwd (line 4637) | void tgl_on_new_pwd (struct tgl_state *TLS, const char *pwd[], void *_T) {
  function tgl_on_old_pwd (line 4644) | void tgl_on_old_pwd (struct tgl_state *TLS, const char *pwd[], void *_T) {
  function set_get_password_on_answer (line 4651) | static int set_get_password_on_answer (struct tgl_state *TLS, struct que...
  type query_methods (line 4685) | struct query_methods
  function tgl_do_set_password (line 4692) | void tgl_do_set_password (struct tgl_state *TLS, const char *hint, int h...
  function check_password_on_error (line 4701) | static int check_password_on_error (struct tgl_state *TLS, struct query ...
  function check_password_on_answer (line 4715) | static int check_password_on_answer (struct tgl_state *TLS, struct query...
  type query_methods (line 4723) | struct query_methods
  type check_password_extra (line 4731) | struct check_password_extra {
  function tgl_pwd_got (line 4738) | static void tgl_pwd_got (struct tgl_state *TLS, const char *pwd[], void ...
  function check_get_password_on_error (line 4771) | static int check_get_password_on_error (struct tgl_state *TLS, struct qu...
  function check_get_password_on_answer (line 4780) | static int check_get_password_on_answer (struct tgl_state *TLS, struct q...
  type query_methods (line 4804) | struct query_methods
  function tgl_do_check_password (line 4811) | void tgl_do_check_password (struct tgl_state *TLS, void (*callback)(stru...
  function tgl_do_send_broadcast (line 4820) | void tgl_do_send_broadcast (struct tgl_state *TLS, int num, tgl_peer_id_...
  function block_user_on_answer (line 4878) | static int block_user_on_answer (struct tgl_state *TLS, struct query *q,...
  type query_methods (line 4885) | struct query_methods
  function tgl_do_block_user (line 4892) | void tgl_do_block_user (struct tgl_state *TLS, tgl_peer_id_t id, void (*...
  function tgl_do_unblock_user (line 4910) | void tgl_do_unblock_user (struct tgl_state *TLS, tgl_peer_id_t id, void ...
  function get_tos_on_answer (line 4931) | static int get_tos_on_answer (struct tgl_state *TLS, struct query *q, vo...
  type query_methods (line 4972) | struct query_methods
  function tgl_do_get_terms_of_service (line 4979) | void tgl_do_get_terms_of_service (struct tgl_state *TLS, void (*callback...
  function tgl_do_upgrade_group (line 4988) | void tgl_do_upgrade_group (struct tgl_state *TLS, tgl_peer_id_t id, void...
  function set_flag_4 (line 4997) | static void set_flag_4 (struct tgl_state *TLS, void *_D, int success) {
  function send_bind_temp_on_answer (line 5005) | static int send_bind_temp_on_answer (struct tgl_state *TLS, struct query...
  function send_bind_on_error (line 5013) | static int send_bind_on_error (struct tgl_state *TLS, struct query *q, i...
  type query_methods (line 5021) | struct query_methods
  function tgl_do_send_bind_temp_key (line 5028) | void tgl_do_send_bind_temp_key (struct tgl_state *TLS, struct tgl_dc *D,...
  function update_status_on_answer (line 5039) | static int update_status_on_answer (struct tgl_state *TLS, struct query ...
  type query_methods (line 5046) | struct query_methods
  function tgl_do_update_status (line 5053) | void tgl_do_update_status (struct tgl_state *TLS, int online, void (*cal...
  function tgl_do_request_exchange (line 5061) | void tgl_do_request_exchange (struct tgl_state *TLS, struct tgl_secret_c...
  function tgl_do_accept_exchange (line 5066) | void tgl_do_accept_exchange (struct tgl_state *TLS, struct tgl_secret_ch...
  function tgl_do_confirm_exchange (line 5071) | void tgl_do_confirm_exchange (struct tgl_state *TLS, struct tgl_secret_c...
  function tgl_do_commit_exchange (line 5076) | void tgl_do_commit_exchange (struct tgl_state *TLS, struct tgl_secret_ch...
  function tgl_do_abort_exchange (line 5081) | void tgl_do_abort_exchange (struct tgl_state *TLS, struct tgl_secret_cha...
  function tgl_started_cb (line 5086) | void tgl_started_cb (struct tgl_state *TLS, void *arg, int success) {
  function tgl_export_auth_callback (line 5102) | void tgl_export_auth_callback (struct tgl_state *TLS, void *arg, int suc...
  function tgl_export_all_auth (line 5124) | void tgl_export_all_auth (struct tgl_state *TLS) {
  type sign_up_extra (line 5141) | struct sign_up_extra {
  type tgl_state (line 5152) | struct tgl_state
  function tgl_sign_in_result (line 5153) | void tgl_sign_in_result (struct tgl_state *TLS, void *_T, int success, s...
  function tgl_sign_in_code (line 5167) | void tgl_sign_in_code (struct tgl_state *TLS, const char *code[], void *...
  type tgl_state (line 5178) | struct tgl_state
  function tgl_sign_up_result (line 5179) | void tgl_sign_up_result (struct tgl_state *TLS, void *_T, int success, s...
  function tgl_sign_up_code (line 5195) | void tgl_sign_up_code (struct tgl_state *TLS, const char *code[], void *...
  function tgl_set_last_name (line 5207) | void tgl_set_last_name (struct tgl_state *TLS, const char *last_name, st...
  function tgl_set_first_name (line 5212) | int tgl_set_first_name (struct tgl_state *TLS, const char *first_name, s...
  function tgl_register_cb (line 5222) | void tgl_register_cb (struct tgl_state *TLS, const char *rinfo[], void *...
  type tgl_state (line 5246) | struct tgl_state
  function tgl_sign_in_phone_cb (line 5247) | void tgl_sign_in_phone_cb (struct tgl_state *TLS, void *extra, int succe...
  function tgl_sign_in_phone (line 5268) | void tgl_sign_in_phone (struct tgl_state *TLS, const char *phone[], void...
  type tgl_state (line 5276) | struct tgl_state
  function tgl_sign_in_bot_cb (line 5278) | void tgl_sign_in_bot_cb (struct tgl_state *TLS, void *_T, int success, s...
  function tgl_bot_hash_cb (line 5287) | void tgl_bot_hash_cb (struct tgl_state *TLS, const char *code[], void *a...
  function tgl_sign_in (line 5291) | void tgl_sign_in (struct tgl_state *TLS) {
  function check_authorized (line 5303) | static void check_authorized (struct tgl_state *TLS, void *arg) {
  function tgl_login (line 5327) | void tgl_login (struct tgl_state *TLS) {
  function callback (line 5346) | static int callback (struct tgl_state *TLS, struct query *q, void *D) {
  function send_change_code_on_answer (line 5353) | static int send_change_code_on_answer (struct tgl_state *TLS, struct que...
  type change_phone_extra (line 5366) | struct change_phone_extra {
  type query_methods (line 5380) | struct query_methods
  type query_methods (line 5387) | struct query_methods
  type tgl_state (line 5394) | struct tgl_state
  function tgl_set_number_result (line 5395) | void tgl_set_number_result (struct tgl_state *TLS, void *_T, int success...
  function tgl_set_number_code (line 5410) | void tgl_set_number_code (struct tgl_state *TLS, const char *code[], voi...
  function tgl_set_phone_number_cb (line 5422) | void tgl_set_phone_number_cb (struct tgl_state *TLS, void *extra, int su...
  function tgl_do_set_phone_number (line 5440) | void tgl_do_set_phone_number (struct tgl_state *TLS, const char *phonenu...

FILE: queries.h
  type query (line 30) | struct query
  type query_methods (line 31) | struct query_methods {
  type query (line 40) | struct query {
  type query (line 58) | struct query
  type tgl_state (line 58) | struct tgl_state
  type tgl_dc (line 58) | struct tgl_dc
  type query_methods (line 58) | struct query_methods
  type tgl_state (line 59) | struct tgl_state
  type tgl_state (line 60) | struct tgl_state
  type tgl_state (line 61) | struct tgl_state
  type tgl_state (line 62) | struct tgl_state
  type tgl_state (line 71) | struct tgl_state
  type tgl_dc (line 71) | struct tgl_dc
  type tgl_state (line 73) | struct tgl_state
  type tgl_secret_chat (line 73) | struct tgl_secret_chat
  type tgl_state (line 74) | struct tgl_state
  type tgl_secret_chat (line 74) | struct tgl_secret_chat
  type tgl_state (line 75) | struct tgl_state
  type tgl_secret_chat (line 75) | struct tgl_secret_chat
  type tgl_state (line 76) | struct tgl_state
  type tgl_secret_chat (line 76) | struct tgl_secret_chat
  type tgl_state (line 77) | struct tgl_state
  type tgl_secret_chat (line 77) | struct tgl_secret_chat
  type tgl_state (line 79) | struct tgl_state
  type tgl_state (line 80) | struct tgl_state
  type tgl_state (line 81) | struct tgl_state
  type tgl_state (line 82) | struct tgl_state
  type tgl_dc (line 82) | struct tgl_dc
  type tgl_session (line 82) | struct tgl_session

FILE: structures.c
  type tgl_message (line 48) | struct tgl_message
  type tgl_message (line 48) | struct tgl_message
  function random_id_cmp (line 52) | static int random_id_cmp (struct tgl_message *L, struct tgl_message *R) {
  function temp_id_cmp (line 58) | static int temp_id_cmp (struct tgl_message *L, struct tgl_message *R) {
  function photo_id_cmp (line 64) | static int photo_id_cmp (struct tgl_photo *L, struct tgl_photo *R) {
  function document_id_cmp (line 70) | static int document_id_cmp (struct tgl_document *L, struct tgl_document ...
  function webpage_id_cmp (line 76) | static int webpage_id_cmp (struct tgl_webpage *L, struct tgl_webpage *R) {
  type tgl_state (line 92) | struct tgl_state
  type tgl_state (line 94) | struct tgl_state
  function tglf_fetch_typing (line 130) | enum tgl_typing_status tglf_fetch_typing (struct tl_ds_send_message_acti...
  function tgl_peer_id_t (line 168) | tgl_peer_id_t tglf_fetch_peer_id (struct tgl_state *TLS, struct tl_ds_pe...
  function tglf_fetch_file_location (line 183) | int tglf_fetch_file_location (struct tgl_state *TLS, struct tgl_file_loc...
  function tglf_fetch_user_status (line 192) | int tglf_fetch_user_status (struct tgl_state *TLS, struct tgl_user_statu...
  type tgl_user (line 274) | struct tgl_user
  type tgl_state (line 274) | struct tgl_state
  type tl_ds_user (line 274) | struct tl_ds_user
  type tgl_user (line 283) | struct tgl_user
  type tgl_user (line 283) | struct tgl_user
  type tgl_user (line 365) | struct tgl_user
  type tgl_state (line 365) | struct tgl_state
  type tl_ds_user_full (line 365) | struct tl_ds_user_full
  type tgl_user (line 368) | struct tgl_user
  function str_to_256 (line 395) | void str_to_256 (unsigned char *dst, char *src, int src_len) {
  function str_to_32 (line 404) | void str_to_32 (unsigned char *dst, char *src, int src_len) {
  type tgl_secret_chat (line 413) | struct tgl_secret_chat
  type tgl_state (line 413) | struct tgl_state
  type tl_ds_encrypted_chat (line 413) | struct tl_ds_encrypted_chat
  type tgl_secret_chat (line 422) | struct tgl_secret_chat
  type tgl_chat (line 512) | struct tgl_chat
  type tgl_state (line 512) | struct tgl_state
  type tl_ds_chat (line 512) | struct tl_ds_chat
  type tgl_chat (line 523) | struct tgl_chat
  type tgl_chat (line 591) | struct tgl_chat
  type tgl_state (line 591) | struct tgl_state
  type tl_ds_messages_chat_full (line 591) | struct tl_ds_messages_chat_full
  type tl_ds_chat_full (line 611) | struct tl_ds_chat_full
  type tl_ds_bot_info (line 617) | struct tl_ds_bot_info
  type tgl_chat (line 638) | struct tgl_chat
  type tl_ds_vector (line 646) | struct tl_ds_vector
  type tgl_channel (line 658) | struct tgl_channel
  type tgl_state (line 658) | struct tgl_state
  type tl_ds_chat (line 658) | struct tl_ds_chat
  type tgl_channel (line 664) | struct tgl_channel
  type tgl_channel (line 745) | struct tgl_channel
  type tgl_state (line 745) | struct tgl_state
  type tl_ds_messages_chat_full (line 745) | struct tl_ds_messages_chat_full
  type tl_ds_chat_full (line 761) | struct tl_ds_chat_full
  type tgl_channel (line 765) | struct tgl_channel
  function tglf_fetch_photo_size (line 787) | void tglf_fetch_photo_size (struct tgl_state *TLS, struct tgl_photo_size...
  function tglf_fetch_geo (line 801) | void tglf_fetch_geo (struct tgl_state *TLS, struct tgl_geo *G, struct tl...
  type tgl_photo (line 806) | struct tgl_photo
  type tgl_state (line 806) | struct tgl_state
  type tl_ds_photo (line 806) | struct tl_ds_photo
  type tgl_photo (line 810) | struct tgl_photo
  type tgl_photo_size (line 832) | struct tgl_photo_size
  type tgl_document (line 841) | struct tgl_document
  type tgl_state (line 841) | struct tgl_state
  type tl_ds_video (line 841) | struct tl_ds_video
  type tgl_document (line 846) | struct tgl_document
  type tgl_document (line 876) | struct tgl_document
  type tgl_state (line 876) | struct tgl_state
  type tl_ds_audio (line 876) | struct tl_ds_audio
  type tgl_document (line 881) | struct tgl_document
  function tglf_fetch_document_attribute (line 907) | void tglf_fetch_document_attribute (struct tgl_state *TLS, struct tgl_do...
  type tgl_document (line 938) | struct tgl_document
  type tgl_state (line 938) | struct tgl_state
  type tl_ds_document (line 938) | struct tl_ds_document
  type tgl_document (line 943) | struct tgl_document
  type tgl_webpage (line 975) | struct tgl_webpage
  type tgl_state (line 975) | struct tgl_state
  type tl_ds_web_page (line 975) | struct tl_ds_web_page
  type tgl_webpage (line 978) | struct tgl_webpage
  function tglf_fetch_message_action (line 1037) | void tglf_fetch_message_action (struct tgl_state *TLS, struct tgl_messag...
  type tgl_message (line 1113) | struct tgl_message
  type tgl_state (line 1113) | struct tgl_state
  type tl_ds_updates (line 1113) | struct tl_ds_updates
  type tgl_message (line 1121) | struct tgl_message
  type tl_ds_message_media (line 1153) | struct tl_ds_message_media
  type tgl_message (line 1183) | struct tgl_message
  type tgl_state (line 1183) | struct tgl_state
  type tl_ds_updates (line 1183) | struct tl_ds_updates
  type tgl_message (line 1196) | struct tgl_message
  type tl_ds_message_media (line 1226) | struct tl_ds_message_media
  function tglf_fetch_message_media (line 1256) | void tglf_fetch_message_media (struct tgl_state *TLS, struct tgl_message...
  function tglf_fetch_message_media_encrypted (line 1316) | void tglf_fetch_message_media_encrypted (struct tgl_state *TLS, struct t...
  function tglf_fetch_message_action_encrypted (line 1379) | void tglf_fetch_message_action_encrypted (struct tgl_state *TLS, struct ...
  function tglf_fetch_message_entity (line 1463) | void tglf_fetch_message_entity (struct tgl_state *TLS, struct tgl_messag...
  function tglf_fetch_message_entities (line 1506) | void tglf_fetch_message_entities (struct tgl_state *TLS, struct tgl_mess...
  type tgl_message (line 1516) | struct tgl_message
  type tgl_state (line 1516) | struct tgl_state
  type tl_ds_message (line 1516) | struct tl_ds_message
  type tgl_message (line 1561) | struct tgl_message
  function decrypt_encrypted_message (line 1625) | static int decrypt_encrypted_message (struct tgl_secret_chat *E) {
  type tgl_message (line 1684) | struct tgl_message
  type tgl_state (line 1684) | struct tgl_state
  type tl_ds_encrypted_message (line 1684) | struct tl_ds_encrypted_message
  type tgl_message (line 1694) | struct tgl_message
  type tl_ds_decrypted_message_layer (line 1747) | struct tl_ds_decrypted_message_layer
  type tl_ds_decrypted_message (line 1788) | struct tl_ds_decrypted_message
  function tglf_fetch_encrypted_message_file (line 1816) | void tglf_fetch_encrypted_message_file (struct tgl_state *TLS, struct tg...
  function id_cmp (line 1833) | static int id_cmp (struct tgl_message *M1, struct tgl_message *M2) {
  function increase_peer_size (line 1843) | static void increase_peer_size (struct tgl_state *TLS) {
  type tgl_message (line 1856) | struct tgl_message
  type tgl_state (line 1856) | struct tgl_state
  type tl_ds_encrypted_message (line 1856) | struct tl_ds_encrypted_message
  type tgl_message (line 1857) | struct tgl_message
  type tgl_secret_chat (line 1863) | struct tgl_secret_chat
  type tgl_bot_info (line 1915) | struct tgl_bot_info
  type tgl_state (line 1915) | struct tgl_state
  type tl_ds_bot_info (line 1915) | struct tl_ds_bot_info
  type tgl_bot_info (line 1917) | struct tgl_bot_info
  type tgl_bot_command (line 1923) | struct tgl_bot_command
  type tl_ds_bot_command (line 1926) | struct tl_ds_bot_command
  type tgl_message_reply_markup (line 1933) | struct tgl_message_reply_markup
  type tgl_state (line 1933) | struct tgl_state
  type tgl_message (line 1933) | struct tgl_message
  type tl_ds_reply_markup (line 1933) | struct tl_ds_reply_markup
  type tgl_message_reply_markup (line 1936) | struct tgl_message_reply_markup
  type tl_ds_keyboard_button_row (line 1947) | struct tl_ds_keyboard_button_row
  type tl_ds_keyboard_button_row (line 1954) | struct tl_ds_keyboard_button_row
  type tl_ds_keyboard_button (line 1957) | struct tl_ds_keyboard_button
  function tglp_insert_encrypted_chat (line 1966) | void tglp_insert_encrypted_chat (struct tgl_state *TLS, tgl_peer_t *P) {
  function tglp_insert_user (line 1973) | void tglp_insert_user (struct tgl_state *TLS, tgl_peer_t *P) {
  function tglp_insert_chat (line 1980) | void tglp_insert_chat (struct tgl_state *TLS, tgl_peer_t *P) {
  function tglp_insert_channel (line 1987) | void tglp_insert_channel (struct tgl_state *TLS, tgl_peer_t *P) {
  function tgl_insert_empty_user (line 1994) | void tgl_insert_empty_user (struct tgl_state *TLS, int uid) {
  function tgl_insert_empty_chat (line 2002) | void tgl_insert_empty_chat (struct tgl_state *TLS, int cid) {
  function tgls_free_photo_size (line 2012) | void tgls_free_photo_size (struct tgl_state *TLS, struct tgl_photo_size ...
  function tgls_free_photo (line 2019) | void tgls_free_photo (struct tgl_state *TLS, struct tgl_photo *P) {
  function tgls_free_document (line 2036) | void tgls_free_document (struct tgl_state *TLS, struct tgl_document *D) {
  function tgls_free_webpage (line 2049) | void tgls_free_webpage (struct tgl_state *TLS, struct tgl_webpage *W) {
  function tgls_free_message_media (line 2069) | void tgls_free_message_media (struct tgl_state *TLS, struct tgl_message_...
  function tgls_free_message_action (line 2112) | void tgls_free_message_action (struct tgl_state *TLS, struct tgl_message...
  function tgls_free_message_entity (line 2164) | void tgls_free_message_entity (struct tgl_state *TLS, struct tgl_message...
  function tgls_clear_message (line 2170) | void tgls_clear_message (struct tgl_state *TLS, struct tgl_message *M) {
  function tgls_free_reply_markup (line 2184) | void tgls_free_reply_markup (struct tgl_state *TLS, struct tgl_message_r...
  function tgls_free_message (line 2198) | void tgls_free_message (struct tgl_state *TLS, struct tgl_message *M) {
  function tgls_free_chat (line 2206) | void tgls_free_chat (struct tgl_state *TLS, struct tgl_chat *U) {
  function tgls_free_user (line 2216) | void tgls_free_user (struct tgl_state *TLS, struct tgl_user *U) {
  function tgls_free_encr_chat (line 2230) | void tgls_free_encr_chat (struct tgl_state *TLS, struct tgl_secret_chat ...
  function tgls_free_channel (line 2236) | void tgls_free_channel (struct tgl_state *TLS, struct tgl_channel *U) {
  function tgls_free_peer (line 2245) | void tgls_free_peer (struct tgl_state *TLS, tgl_peer_t *P) {
  function tgls_free_bot_info (line 2259) | void tgls_free_bot_info (struct tgl_state *TLS, struct tgl_bot_info *B) {
  function tglm_message_del_use (line 2275) | void tglm_message_del_use (struct tgl_state *TLS, struct tgl_message *M) {
  function tglm_message_add_use (line 2280) | void tglm_message_add_use (struct tgl_state *TLS, struct tgl_message *M) {
  function tglm_message_add_peer (line 2287) | void tglm_message_add_peer (struct tgl_state *TLS, struct tgl_message *M) {
  function tglm_message_del_peer (line 2347) | void tglm_message_del_peer (struct tgl_state *TLS, struct tgl_message *M) {
  type tgl_message (line 2366) | struct tgl_message
  type tgl_state (line 2366) | struct tgl_state
  type tgl_message (line 2367) | struct tgl_message
  function tglm_message_insert_tree (line 2374) | void tglm_message_insert_tree (struct tgl_state *TLS, struct tgl_message...
  function tglm_message_remove_tree (line 2379) | void tglm_message_remove_tree (struct tgl_state *TLS, struct tgl_message...
  function tglm_message_insert (line 2384) | void tglm_message_insert (struct tgl_state *TLS, struct tgl_message *M) {
  function tglm_message_insert_unsent (line 2389) | void tglm_message_insert_unsent (struct tgl_state *TLS, struct tgl_messa...
  function tglm_message_remove_unsent (line 2393) | void tglm_message_remove_unsent (struct tgl_state *TLS, struct tgl_messa...
  function __send_msg (line 2397) | static void __send_msg (struct tgl_message *M, void *_TLS) {
  function tglm_send_all_unsent (line 2410) | void tglm_send_all_unsent (struct tgl_state *TLS) {
  type tgl_photo (line 2415) | struct tgl_photo
  type tgl_state (line 2415) | struct tgl_state
  type tgl_photo (line 2416) | struct tgl_photo
  function tgl_photo_insert (line 2421) | void tgl_photo_insert (struct tgl_state *TLS, struct tgl_photo *P) {
  type tgl_document (line 2425) | struct tgl_document
  type tgl_state (line 2425) | struct tgl_state
  type tgl_document (line 2426) | struct tgl_document
  function tgl_document_insert (line 2431) | void tgl_document_insert (struct tgl_state *TLS, struct tgl_document *P) {
  type tgl_webpage (line 2435) | struct tgl_webpage
  type tgl_state (line 2435) | struct tgl_state
  type tgl_webpage (line 2436) | struct tgl_webpage
  function tgl_webpage_insert (line 2441) | void tgl_webpage_insert (struct tgl_state *TLS, struct tgl_webpage *P) {
  function tglp_peer_insert_name (line 2445) | void tglp_peer_insert_name (struct tgl_state *TLS, tgl_peer_t *P) {
  function tglp_peer_delete_name (line 2449) | void tglp_peer_delete_name (struct tgl_state *TLS, tgl_peer_t *P) {
  function tgl_peer_t (line 2453) | tgl_peer_t *tgl_peer_get (struct tgl_state *TLS, tgl_peer_id_t id) {
  type tgl_message (line 2459) | struct tgl_message
  type tgl_state (line 2459) | struct tgl_state
  type tgl_message (line 2460) | struct tgl_message
  function tgl_peer_t (line 2473) | tgl_peer_t *tgl_peer_get_by_name (struct tgl_state *TLS, const char *s) {
  function tgl_peer_iterator_ex (line 2480) | void tgl_peer_iterator_ex (struct tgl_state *TLS, void (*it)(tgl_peer_t ...
  function tgl_complete_user_list (line 2484) | int tgl_complete_user_list (struct tgl_state *TLS, int index, const char...
  function tgl_complete_chat_list (line 2498) | int tgl_complete_chat_list (struct tgl_state *TLS, int index, const char...
  function tgl_complete_channel_list (line 2512) | int tgl_complete_channel_list (struct tgl_state *TLS, int index, const c...
  function tgl_complete_encr_chat_list (line 2526) | int tgl_complete_encr_chat_list (struct tgl_state *TLS, int index, const...
  function tgl_complete_peer_list (line 2540) | int tgl_complete_peer_list (struct tgl_state *TLS, int index, const char...
  function tgl_secret_chat_for_user (line 2554) | int tgl_secret_chat_for_user (struct tgl_state *TLS, tgl_peer_id_t user_...
  function tgls_free_peer_gw (line 2566) | void tgls_free_peer_gw (tgl_peer_t *P, void *TLS) {
  function tgls_free_message_gw (line 2570) | void tgls_free_message_gw (struct tgl_message *M, void *TLS) {
  function tgl_free_all (line 2574) | void tgl_free_all (struct tgl_state *TLS) {
  function tgl_print_stat (line 2618) | int tgl_print_stat (struct tgl_state *TLS, char *s, int len) {
  function tglf_fetch_int_array (line 2633) | void tglf_fetch_int_array (int *dst, struct tl_ds_vector *src, int len) {
  function tglf_fetch_int_tuple (line 2641) | void tglf_fetch_int_tuple (int *dst, int **src, int len) {
  function tgls_messages_mark_read (line 2649) | void tgls_messages_mark_read (struct tgl_state *TLS, struct tgl_message ...
  function tgl_message_id_t (line 2707) | tgl_message_id_t *tgls_get_local_by_random (struct tgl_state *TLS, long ...
  function tgl_message_id_t (line 2718) | tgl_message_id_t *tgls_get_local_by_temp (struct tgl_state *TLS, int tem...
  function tgl_message_id_t (line 2729) | tgl_message_id_t tgl_convert_temp_msg_id (struct tgl_state *TLS, tgl_mes...
  function tgls_message_change_temp_id (line 2740) | void tgls_message_change_temp_id (struct tgl_state *TLS, struct tgl_mess...
  function tgls_message_change_random_id (line 2747) | void tgls_message_change_random_id (struct tgl_state *TLS, struct tgl_me...
  function tglm_message_del_temp_id (line 2754) | void tglm_message_del_temp_id (struct tgl_state *TLS, struct tgl_message...
  function tglm_message_del_random_id (line 2760) | void tglm_message_del_random_id (struct tgl_state *TLS, struct tgl_messa...

FILE: tg-mime-types.c
  function mime_init (line 12) | static void mime_init (void) {

FILE: tgl-binlog.h
  type tgl_state (line 31) | struct tgl_state
  type tgl_state (line 33) | struct tgl_state
  type tgl_state (line 34) | struct tgl_state
  type tgl_state (line 35) | struct tgl_state
  type tgl_state (line 36) | struct tgl_state
  type tgl_state (line 38) | struct tgl_state
  type tgl_state (line 39) | struct tgl_state
  type tgl_state (line 40) | struct tgl_state
  type tgl_state (line 41) | struct tgl_state
  type tgl_state (line 42) | struct tgl_state
  type tgl_state (line 44) | struct tgl_state
  type tgl_state (line 46) | struct tgl_state
  type tgl_message_id (line 46) | struct tgl_message_id
  type tgl_message_id (line 46) | struct tgl_message_id
  type tgl_state (line 47) | struct tgl_state
  type tgl_message_id (line 47) | struct tgl_message_id
  type tgl_state (line 49) | struct tgl_state
  type tgl_state (line 51) | struct tgl_state
  type tgl_state (line 52) | struct tgl_state
  type tgl_state (line 54) | struct tgl_state
  type tgl_message_id (line 54) | struct tgl_message_id
  type tgl_state (line 55) | struct tgl_state
  type tgl_state (line 58) | struct tgl_state
  type tgl_message_id (line 58) | struct tgl_message_id
  type tl_ds_message_media (line 58) | struct tl_ds_message_media
  type tl_ds_message_action (line 58) | struct tl_ds_message_action
  type tl_ds_reply_markup (line 58) | struct tl_ds_reply_markup
  type tl_ds_vector (line 58) | struct tl_ds_vector
  type tgl_state (line 59) | struct tgl_state
  type tgl_message_id (line 59) | struct tgl_message_id
  type tl_ds_decrypted_message_media (line 59) | struct tl_ds_decrypted_message_media
  type tl_ds_decrypted_message_action (line 59) | struct tl_ds_decrypted_message_action
  type tl_ds_encrypted_file (line 59) | struct tl_ds_encrypted_file
  type tgl_state (line 60) | struct tgl_state
  type tgl_state (line 61) | struct tgl_state
  type tl_ds_photo (line 61) | struct tl_ds_photo
  type tl_ds_user_profile_photo (line 61) | struct tl_ds_user_profile_photo
  type tl_ds_bot_info (line 61) | struct tl_ds_bot_info
  type tgl_state (line 62) | struct tgl_state
  type tl_ds_vector (line 62) | struct tl_ds_vector
  type tl_ds_chat_photo (line 62) | struct tl_ds_chat_photo
  type tl_ds_photo (line 62) | struct tl_ds_photo
  type tgl_state (line 63) | struct tgl_state
  type tgl_state (line 64) | struct tgl_state
  type tl_ds_chat_photo (line 64) | struct tl_ds_chat_photo
  type tl_ds_photo (line 64) | struct tl_ds_photo
  type tgl_state (line 65) | struct tgl_state

FILE: tgl-fetch.h
  type tgl_user (line 25) | struct tgl_user
  type tgl_state (line 25) | struct tgl_state
  type tl_ds_user (line 25) | struct tl_ds_user
  type tgl_user (line 26) | struct tgl_user
  type tgl_state (line 26) | struct tgl_state
  type tl_ds_user_full (line 26) | struct tl_ds_user_full
  type tgl_chat (line 27) | struct tgl_chat
  type tgl_state (line 27) | struct tgl_state
  type tl_ds_chat (line 27) | struct tl_ds_chat
  type tgl_chat (line 28) | struct tgl_chat
  type tgl_state (line 28) | struct tgl_state
  type tl_ds_messages_chat_full (line 28) | struct tl_ds_messages_chat_full
  type tgl_channel (line 29) | struct tgl_channel
  type tgl_state (line 29) | struct tgl_state
  type tl_ds_chat (line 29) | struct tl_ds_chat
  type tgl_channel (line 30) | struct tgl_channel
  type tgl_state (line 30) | struct tgl_state
  type tl_ds_messages_chat_full (line 30) | struct tl_ds_messages_chat_full
  type tgl_secret_chat (line 31) | struct tgl_secret_chat
  type tgl_state (line 31) | struct tgl_state
  type tl_ds_encrypted_chat (line 31) | struct tl_ds_encrypted_chat
  type tgl_message (line 32) | struct tgl_message
  type tgl_state (line 32) | struct tgl_state
  type tl_ds_message (line 32) | struct tl_ds_message
  type tgl_message (line 33) | struct tgl_message
  type tgl_state (line 33) | struct tgl_state
  type tgl_message (line 34) | struct tgl_message
  type tgl_state (line 34) | struct tgl_state
  type tgl_message (line 35) | struct tgl_message
  type tgl_state (line 35) | struct tgl_state
  type tl_ds_encrypted_message (line 35) | struct tl_ds_encrypted_message
  type tgl_state (line 36) | struct tgl_state
  type tl_ds_peer (line 36) | struct tl_ds_peer
  type tgl_state (line 37) | struct tgl_state
  type tgl_user (line 37) | struct tgl_user
  type tl_ds_user_profile_photo (line 37) | struct tl_ds_user_profile_photo
  type tgl_state (line 39) | struct tgl_state
  type tgl_message_media (line 39) | struct tgl_message_media
  type tl_ds_message_media (line 39) | struct tl_ds_message_media
  type tgl_state (line 40) | struct tgl_state
  type tgl_message_action (line 40) | struct tgl_message_action
  type tl_ds_message_action (line 40) | struct tl_ds_message_action
  type tgl_state (line 43) | struct tgl_state
  type tgl_message_media (line 43) | struct tgl_message_media
  type tl_ds_encrypted_file (line 43) | struct tl_ds_encrypted_file
  type tgl_state (line 44) | struct tgl_state
  type tgl_message_media (line 44) | struct tgl_message_media
  type tl_ds_decrypted_message_media (line 44) | struct tl_ds_decrypted_message_media
  type tgl_state (line 45) | struct tgl_state
  type tgl_message_action (line 45) | struct tgl_message_action
  type tl_ds_decrypted_message_action (line 45) | struct tl_ds_decrypted_message_action
  type tgl_state (line 46) | struct tgl_state
  type tgl_user_status (line 46) | struct tgl_user_status
  type tgl_user (line 46) | struct tgl_user
  type tl_ds_user_status (line 46) | struct tl_ds_user_status
  type tgl_typing_status (line 47) | enum tgl_typing_status
  type tl_ds_send_message_action (line 47) | struct tl_ds_send_message_action
  type tgl_state (line 48) | struct tgl_state
  type tgl_chat (line 48) | struct tgl_chat
  type tl_ds_chat_participants (line 48) | struct tl_ds_chat_participants
  type tl_ds_vector (line 49) | struct tl_ds_vector
  type tgl_state (line 51) | struct tgl_state
  type tgl_file_location (line 51) | struct tgl_file_location
  type tl_ds_file_location (line 51) | struct tl_ds_file_location
  type tgl_state (line 53) | struct tgl_state
  type tgl_message (line 53) | struct tgl_message
  type tl_ds_updates (line 53) | struct tl_ds_updates
  type tgl_state (line 54) | struct tgl_state
  type tgl_message (line 54) | struct tgl_message
  type tl_ds_updates (line 54) | struct tl_ds_updates
  type tgl_message (line 56) | struct tgl_message
  type tgl_state (line 56) | struct tgl_state
  type tl_ds_updates (line 56) | struct tl_ds_updates
  type tgl_message (line 57) | struct tgl_message
  type tgl_state (line 57) | struct tgl_state
  type tl_ds_updates (line 57) | struct tl_ds_updates
  type tgl_photo (line 58) | struct tgl_photo
  type tgl_state (line 58) | struct tgl_state
  type tl_ds_photo (line 58) | struct tl_ds_photo
  type tgl_bot_info (line 59) | struct tgl_bot_info
  type tgl_state (line 59) | struct tgl_state
  type tl_ds_bot_info (line 59) | struct tl_ds_bot_info
  type tgl_message_reply_markup (line 60) | struct tgl_message_reply_markup
  type tgl_state (line 60) | struct tgl_state
  type tgl_message (line 60) | struct tgl_message
  type tl_ds_reply_markup (line 60) | struct tl_ds_reply_markup
  type tgl_state (line 61) | struct tgl_state
  type tgl_message (line 61) | struct tgl_message
  type tl_ds_vector (line 61) | struct tl_ds_vector

FILE: tgl-layout.h
  type tgl_peer_id_t (line 123) | typedef struct {
  type tgl_dc_state (line 129) | enum tgl_dc_state {
  type tgl_session (line 144) | struct tgl_session {
  type tgl_dc_option (line 155) | struct tgl_dc_option {
  type tgl_dc (line 161) | struct tgl_dc {
  type tgl_message_entity_type (line 189) | enum tgl_message_entity_type {
  type tgl_message_entity (line 203) | struct tgl_message_entity {
  type tgl_message_media_type (line 210) | enum tgl_message_media_type {
  type tgl_message_action_type (line 227) | enum tgl_message_action_type {
  type tgl_typing_status (line 256) | enum tgl_typing_status {
  type tgl_file_location (line 270) | struct tgl_file_location {
  type tgl_photo_size (line 277) | struct tgl_photo_size {
  type tgl_geo (line 286) | struct tgl_geo {
  type tgl_photo (line 291) | struct tgl_photo {
  type tgl_encr_document (line 303) | struct tgl_encr_document {
  type tgl_user_status (line 323) | struct tgl_user_status {
  type tgl_bot_command (line 329) | struct tgl_bot_command {
  type tgl_bot_info (line 334) | struct tgl_bot_info {
  type tgl_user (line 342) | struct tgl_user {
  type tgl_channel (line 368) | struct tgl_channel {
  type tgl_chat_user (line 395) | struct tgl_chat_user {
  type tgl_chat (line 401) | struct tgl_chat {
  type tgl_secret_chat_state (line 425) | enum tgl_secret_chat_state {
  type tgl_secret_chat_exchange_state (line 433) | enum tgl_secret_chat_exchange_state {
  type tgl_secret_chat (line 442) | struct tgl_secret_chat {
  type tgl_peer_t (line 478) | typedef union tgl_peer {
  type tgl_document (line 500) | struct tgl_document {
  type tgl_message_action (line 518) | struct tgl_message_action {
  type tgl_webpage (line 548) | struct tgl_webpage {
  type tgl_message_media (line 566) | struct tgl_message_media {
  type tgl_message_reply_markup (line 602) | struct tgl_message_reply_markup {
  type tgl_message_id_t (line 610) | typedef struct tgl_message_id {
  type tgl_message (line 617) | struct tgl_message {

FILE: tgl-methods-in.h
  type tgl_state (line 12) | struct tgl_state
  type tgl_state (line 12) | struct tgl_state
  type tgl_state (line 17) | struct tgl_state
  type tgl_state (line 17) | struct tgl_state
  type tgl_state (line 20) | struct tgl_state
  type tgl_state (line 20) | struct tgl_state
  type tgl_state (line 23) | struct tgl_state
  type tgl_state (line 23) | struct tgl_state
  type tgl_user (line 23) | struct tgl_user
  type tgl_state (line 27) | struct tgl_state
  type tgl_state (line 27) | struct tgl_state
  type tgl_user (line 27) | struct tgl_user
  type tgl_state (line 31) | struct tgl_state
  type tgl_message (line 31) | struct tgl_message
  type tgl_state (line 31) | struct tgl_state
  type tgl_message (line 31) | struct tgl_message
  type tgl_state (line 33) | struct tgl_state
  type tgl_state (line 33) | struct tgl_state
  type tgl_state (line 35) | struct tgl_state
  type tgl_state (line 35) | struct tgl_state
  type tgl_state (line 37) | struct tgl_state
  type tgl_state (line 37) | struct tgl_state
  type tgl_secret_chat (line 37) | struct tgl_secret_chat
  type tgl_state (line 39) | struct tgl_state
  type tgl_state (line 39) | struct tgl_state
  type tgl_state (line 41) | struct tgl_state
  type tgl_state (line 43) | struct tgl_state
  type tgl_dc (line 43) | struct tgl_dc
  type tgl_state (line 43) | struct tgl_state
  type tgl_state (line 45) | struct tgl_state
  type tgl_secret_chat (line 45) | struct tgl_secret_chat
  type tgl_state (line 47) | struct tgl_state
  type tgl_secret_chat (line 47) | struct tgl_secret_chat
  type tgl_state (line 49) | struct tgl_state
  type tgl_secret_chat (line 49) | struct tgl_secret_chat

FILE: tgl-net-inner.h
  type connection_buffer (line 23) | struct connection_buffer {
  type conn_state (line 31) | enum conn_state {
  type connection (line 39) | struct connection {
  type connection (line 70) | struct connection
  type connection (line 71) | struct connection
  type connection (line 72) | struct connection
  type connection (line 73) | struct connection
  type tgl_net_methods (line 77) | struct tgl_net_methods
  type connection (line 84) | struct connection
  type tgl_state (line 84) | struct tgl_state
  type tgl_session (line 84) | struct tgl_session
  type tgl_dc (line 84) | struct tgl_dc
  type mtproto_methods (line 84) | struct mtproto_methods

FILE: tgl-net.c
  type connection (line 68) | struct connection
  type connection (line 72) | struct connection
  function ping_alarm (line 73) | static void ping_alarm (evutil_socket_t fd, short what, void *arg) {
  function stop_ping_timer (line 90) | static void stop_ping_timer (struct connection *c) {
  function start_ping_timer (line 94) | static void start_ping_timer (struct connection *c) {
  type connection (line 99) | struct connection
  function fail_alarm (line 101) | static void fail_alarm (evutil_socket_t fd, short what, void *arg) {
  function start_fail_timer (line 107) | static void start_fail_timer (struct connection *c) {
  type connection_buffer (line 115) | struct connection_buffer
  type connection_buffer (line 116) | struct connection_buffer
  function delete_connection_buffer (line 123) | static void delete_connection_buffer (struct connection_buffer *b) {
  function tgln_write_out (line 128) | int tgln_write_out (struct connection *c, const void *_data, int len) {
  function tgln_read_in (line 165) | int tgln_read_in (struct connection *c, void *_data, int len) {
  function tgln_read_in_lookup (line 197) | int tgln_read_in_lookup (struct connection *c, void *_data, int len) {
  function tgln_flush_out (line 222) | void tgln_flush_out (struct connection *c) {
  type connection (line 226) | struct connection
  function rotate_port (line 229) | static void rotate_port (struct connection *c) {
  type connection (line 243) | struct connection
  type connection (line 244) | struct connection
  function conn_try_read (line 246) | static void conn_try_read (evutil_socket_t fd, short what, void *arg) {
  function conn_try_write (line 252) | static void conn_try_write (evutil_socket_t fd, short what, void *arg) {
  function my_connect (line 265) | static int my_connect (struct connection *c, const char *host) {
  type connection (line 316) | struct connection
  type tgl_state (line 316) | struct tgl_state
  type tgl_session (line 316) | struct tgl_session
  type tgl_dc (line 316) | struct tgl_dc
  type mtproto_methods (line 316) | struct mtproto_methods
  type connection (line 317) | struct connection
  type timeval (line 340) | struct timeval
  function restart_connection (line 357) | static void restart_connection (struct connection *c) {
  function fail_connection (line 393) | static void fail_connection (struct connection *c) {
  function try_write (line 424) | static void try_write (struct connection *c) {
  function try_rpc_read (line 456) | static void try_rpc_read (struct connection *c) {
  function try_read (line 494) | static void try_read (struct connection *c) {
  function incr_out_packet_num (line 538) | static void incr_out_packet_num (struct connection *c) {
  type tgl_dc (line 542) | struct tgl_dc
  type connection (line 542) | struct connection
  type tgl_session (line 546) | struct tgl_session
  type connection (line 546) | struct connection
  function tgln_free (line 550) | static void tgln_free (struct connection *c) {
  type tgl_net_methods (line 574) | struct tgl_net_methods

FILE: tgl-net.h
  type tgl_net_methods (line 23) | struct tgl_net_methods

FILE: tgl-queries.h
  type tgl_state (line 6) | struct tgl_state
  type tgl_state (line 6) | struct tgl_state
  type tgl_state (line 11) | struct tgl_state
  type tgl_state (line 11) | struct tgl_state
  type tgl_state (line 13) | struct tgl_state
  type tgl_state (line 13) | struct tgl_state
  type tl_ds_reply_markup (line 18) | struct tl_ds_reply_markup
  type tgl_state (line 23) | struct tgl_state
  type tl_ds_reply_markup (line 23) | struct tl_ds_reply_markup
  type tgl_state (line 23) | struct tgl_state
  type tgl_message (line 23) | struct tgl_message
  type tgl_state (line 27) | struct tgl_state
  type tgl_state (line 27) | struct tgl_state
  type tgl_message (line 27) | struct tgl_message
  type tgl_state (line 30) | struct tgl_state
  type tgl_state (line 30) | struct tgl_state
  type tgl_message (line 30) | struct tgl_message
  type tgl_state (line 32) | struct tgl_state
  type tgl_state (line 32) | struct tgl_state
  type tgl_message (line 32) | struct tgl_message
  type tgl_state (line 37) | struct tgl_state
  type tgl_state (line 37) | struct tgl_state
  type tgl_message (line 37) | struct tgl_message
  type tgl_state (line 38) | struct tgl_state
  type tgl_state (line 38) | struct tgl_state
  type tgl_message (line 38) | struct tgl_message
  type tgl_state (line 42) | struct tgl_state
  type tgl_state (line 42) | struct tgl_state
  type tgl_message (line 42) | struct tgl_message
  type tgl_state (line 46) | struct tgl_state
  type tgl_state (line 46) | struct tgl_state
  type tgl_message (line 46) | struct tgl_message
  type tgl_state (line 50) | struct tgl_state
  type tgl_state (line 50) | struct tgl_state
  type tgl_message (line 50) | struct tgl_message
  type tgl_state (line 53) | struct tgl_state
  type tgl_state (line 53) | struct tgl_state
  type tgl_message (line 53) | struct tgl_message
  type tgl_state (line 59) | struct tgl_state
  type tgl_state (line 59) | struct tgl_state
  type tgl_message (line 59) | struct tgl_message
  type tgl_state (line 62) | struct tgl_state
  type tgl_state (line 62) | struct tgl_state
  type tgl_message (line 62) | struct tgl_message
  type tgl_state (line 65) | struct tgl_state
  type tgl_state (line 65) | struct tgl_state
  type tgl_message (line 65) | struct tgl_message
  type tgl_state (line 69) | struct tgl_state
  type tgl_state (line 69) | struct tgl_state
  type tgl_message (line 69) | struct tgl_message
  type tgl_state (line 76) | struct tgl_state
  type tgl_state (line 76) | struct tgl_state
  type tgl_state (line 79) | struct tgl_state
  type tgl_state (line 79) | struct tgl_state
  type tgl_user (line 79) | struct tgl_user
  type tgl_state (line 82) | struct tgl_state
  type tgl_state (line 82) | struct tgl_state
  type tgl_user (line 82) | struct tgl_user
  type tgl_state (line 85) | struct tgl_state
  type tgl_state (line 85) | struct tgl_state
  type tgl_state (line 88) | struct tgl_state
  type tgl_state (line 88) | struct tgl_state
  type tgl_state (line 95) | struct tgl_state
  type tgl_state (line 95) | struct tgl_state
  type tgl_state (line 98) | struct tgl_state
  type tgl_state (line 98) | struct tgl_state
  type tgl_state (line 102) | struct tgl_state
  type tgl_state (line 102) | struct tgl_state
  type tgl_chat (line 102) | struct tgl_chat
  type tgl_state (line 106) | struct tgl_state
  type tgl_state (line 106) | struct tgl_state
  type tgl_state (line 110) | struct tgl_state
  type tgl_state (line 110) | struct tgl_state
  type tgl_state (line 114) | struct tgl_state
  type tgl_state (line 114) | struct tgl_state
  type tgl_state (line 119) | struct tgl_state
  type tgl_state (line 119) | struct tgl_state
  type tgl_state (line 122) | struct tgl_state
  type tgl_state (line 122) | struct tgl_state
  type tgl_state (line 125) | struct tgl_state
  type tgl_state (line 125) | struct tgl_state
  type tgl_state (line 132) | struct tgl_state
  type tgl_state (line 132) | struct tgl_state
  type tgl_user (line 132) | struct tgl_user
  type tgl_state (line 137) | struct tgl_state
  type tgl_state (line 137) | struct tgl_state
  type tgl_user (line 137) | struct tgl_user
  type tgl_state (line 140) | struct tgl_state
  type tgl_state (line 140) | struct tgl_state
  type tgl_state (line 143) | struct tgl_state
  type tgl_state (line 143) | struct tgl_state
  type tgl_user (line 143) | struct tgl_user
  type tgl_state (line 146) | struct tgl_state
  type tgl_state (line 146) | struct tgl_state
  type tgl_state (line 149) | struct tgl_state
  type tgl_state (line 149) | struct tgl_state
  type tgl_state (line 159) | struct tgl_state
  type tgl_secret_chat (line 159) | struct tgl_secret_chat
  type tgl_state (line 159) | struct tgl_state
  type tgl_secret_chat (line 159) | struct tgl_secret_chat
  type tgl_state (line 162) | struct tgl_state
  type tgl_secret_chat (line 162) | struct tgl_secret_chat
  type tgl_state (line 162) | struct tgl_state
  type tgl_message (line 162) | struct tgl_message
  type tgl_state (line 165) | struct tgl_state
  type tgl_state (line 168) | struct tgl_state
  type tgl_state (line 168) | struct tgl_state
  type tgl_secret_chat (line 168) | struct tgl_secret_chat
  type tgl_state (line 171) | struct tgl_state
  type tgl_secret_chat (line 171) | struct tgl_secret_chat
  type tgl_state (line 171) | struct tgl_state
  type tgl_secret_chat (line 171) | struct tgl_secret_chat
  type tgl_state (line 176) | struct tgl_state
  type tgl_state (line 176) | struct tgl_state
  type tgl_state (line 178) | struct tgl_state
  type tgl_state (line 178) | struct tgl_state
  type tgl_channel (line 178) | struct tgl_channel
  type tgl_state (line 180) | struct tgl_state
  type tgl_state (line 180) | struct tgl_state
  type tgl_state (line 182) | struct tgl_state
  type tgl_state (line 182) | struct tgl_state
  type tgl_state (line 184) | struct tgl_state
  type tgl_state (line 184) | struct tgl_state
  type tgl_state (line 186) | struct tgl_state
  type tgl_state (line 186) | struct tgl_state
  type tgl_state (line 188) | struct tgl_state
  type tgl_state (line 188) | struct tgl_state
  type tgl_state (line 190) | struct tgl_state
  type tgl_state (line 190) | struct tgl_state
  type tgl_state (line 192) | struct tgl_state
  type tgl_state (line 192) | struct tgl_state
  type tgl_state (line 194) | struct tgl_state
  type tgl_state (line 194) | struct tgl_state
  type tgl_state (line 196) | struct tgl_state
  type tgl_state (line 196) | struct tgl_state
  type tgl_state (line 198) | struct tgl_state
  type tgl_state (line 198) | struct tgl_state
  type tgl_state (line 205) | struct tgl_state
  type tgl_state (line 205) | struct tgl_state
  type tgl_state (line 207) | struct tgl_state
  type tgl_state (line 207) | struct tgl_state
  type tgl_user (line 207) | struct tgl_user
  type tgl_state (line 215) | struct tgl_state
  type tgl_state (line 215) | struct tgl_state
  type tgl_state (line 218) | struct tgl_state
  type tgl_state (line 218) | struct tgl_state
  type tgl_state (line 221) | struct tgl_state
  type tgl_state (line 221) | struct tgl_state
  type tgl_user (line 221) | struct tgl_user
  type tgl_state (line 228) | struct tgl_state
  type tgl_state (line 228) | struct tgl_state
  type tgl_state (line 231) | struct tgl_state
  type tgl_state (line 231) | struct tgl_state
  type tgl_state (line 237) | struct tgl_state
  type tgl_state (line 237) | struct tgl_state
  type tgl_message (line 237) | struct tgl_message
  type tgl_state (line 241) | struct tgl_state
  type tgl_typing_status (line 241) | enum tgl_typing_status
  type tgl_state (line 241) | struct tgl_state
  type tgl_state (line 250) | struct tgl_state
  type tgl_photo (line 250) | struct tgl_photo
  type tgl_state (line 250) | struct tgl_state
  type tgl_state (line 251) | struct tgl_state
  type tgl_encr_document (line 251) | struct tgl_encr_document
  type tgl_state (line 251) | struct tgl_state
  type tgl_state (line 252) | struct tgl_state
  type tgl_document (line 252) | struct tgl_document
  type tgl_state (line 252) | struct tgl_state
  type tgl_state (line 253) | struct tgl_state
  type tgl_document (line 253) | struct tgl_document
  type tgl_state (line 253) | struct tgl_state
  type tgl_state (line 254) | struct tgl_state
  type tgl_document (line 254) | struct tgl_document
  type tgl_state (line 254) | struct tgl_state
  type tgl_state (line 255) | struct tgl_state
  type tgl_document (line 255) | struct tgl_document
  type tgl_state (line 255) | struct tgl_state
  type tgl_state (line 256) | struct tgl_state
  type tgl_document (line 256) | struct tgl_document
  type tgl_state (line 256) | struct tgl_state
  type tgl_state (line 259) | struct tgl_state
  type tgl_file_location (line 259) | struct tgl_file_location
  type tgl_state (line 259) | struct tgl_state
  type tgl_state (line 269) | struct tgl_state
  type tgl_state (line 269) | struct tgl_state
  type tgl_message (line 269) | struct tgl_message
  type tgl_state (line 272) | struct tgl_state
  type tgl_state (line 272) | struct tgl_state
  type tgl_state (line 275) | struct tgl_state
  type tgl_state (line 275) | struct tgl_state
  type tgl_message (line 275) | struct tgl_message
  type tgl_state (line 285) | struct tgl_state
  type tgl_state (line 285) | struct tgl_state
  type tgl_state (line 286) | struct tgl_state
  type paramed_type (line 287) | struct paramed_type
  type tgl_state (line 287) | struct tgl_state
  type tgl_state (line 288) | struct tgl_state
  type paramed_type (line 288) | struct paramed_type
  type tgl_state (line 293) | struct tgl_state
  type tgl_state (line 293) | struct tgl_state

FILE: tgl-structures.h
  type tgl_state (line 28) | struct tgl_state
  type tgl_state (line 31) | struct tgl_state
  type tgl_user (line 31) | struct tgl_user
  type tgl_state (line 32) | struct tgl_state
  type tgl_chat (line 32) | struct tgl_chat
  type tgl_state (line 33) | struct tgl_state
  type tgl_photo (line 33) | struct tgl_photo
  type tgl_state (line 34) | struct tgl_state
  type tgl_message (line 34) | struct tgl_message
  type tgl_state (line 35) | struct tgl_state
  type tgl_bot_info (line 35) | struct tgl_bot_info
  type tgl_state (line 36) | struct tgl_state
  type tgl_message (line 36) | struct tgl_message
  type tgl_message (line 38) | struct tgl_message
  type tgl_state (line 38) | struct tgl_state
  type tgl_state (line 39) | struct tgl_state
  type tgl_message (line 39) | struct tgl_message
  type tgl_state (line 40) | struct tgl_state
  type tgl_message (line 40) | struct tgl_message
  type tgl_state (line 41) | struct tgl_state
  type tgl_message (line 41) | struct tgl_message
  type tgl_state (line 42) | struct tgl_state
  type tgl_message (line 42) | struct tgl_message
  type tgl_state (line 43) | struct tgl_state
  type tgl_message (line 43) | struct tgl_message
  type tgl_state (line 44) | struct tgl_state
  type tgl_state (line 45) | struct tgl_state
  type tgl_message (line 45) | struct tgl_message
  type tgl_state (line 46) | struct tgl_state
  type tgl_message (line 46) | struct tgl_message
  type tgl_state (line 47) | struct tgl_state
  type tgl_message (line 47) | struct tgl_message
  type tgl_state (line 48) | struct tgl_state
  type tgl_message (line 48) | struct tgl_message
  type tgl_state (line 49) | struct tgl_state
  type tgl_message (line 49) | struct tgl_message
  type tgl_state (line 50) | struct tgl_state
  type tgl_message (line 50) | struct tgl_message
  type tgl_state (line 51) | struct tgl_state
  type tgl_message (line 51) | struct tgl_message
  type tgl_state (line 53) | struct tgl_state
  type tgl_state (line 54) | struct tgl_state
  type tgl_state (line 55) | struct tgl_state
  type tgl_state (line 56) | struct tgl_state
  type tgl_state (line 57) | struct tgl_state
  type tgl_state (line 58) | struct tgl_state
  type tgl_state (line 60) | struct tgl_state
  type tgl_message (line 60) | struct tgl_message
  type tgl_state (line 64) | struct tgl_state
  type tgl_state (line 65) | struct tgl_state
  type tgl_state (line 68) | struct tgl_state
  type tgl_message (line 68) | struct tgl_message
  type tgl_state (line 69) | struct tgl_state
  type tgl_message (line 69) | struct tgl_message
  type tgl_state (line 72) | struct tgl_state
  type tgl_photo (line 72) | struct tgl_photo
  type tgl_photo (line 73) | struct tgl_photo
  type tgl_state (line 73) | struct tgl_state
  type tgl_document (line 74) | struct tgl_document
  type tgl_state (line 74) | struct tgl_state
  type tgl_state (line 75) | struct tgl_state
  type tgl_document (line 75) | struct tgl_document
  type tgl_webpage (line 76) | struct tgl_webpage
  type tgl_state (line 76) | struct tgl_state
  type tgl_state (line 77) | struct tgl_state
  type tgl_webpage (line 77) | struct tgl_webpage
  type tgl_state (line 79) | struct tgl_state
  function tgl_peer_id_t (line 81) | static inline tgl_peer_id_t tgl_msg_id_to_peer_id (tgl_message_id_t msg_...
  function tgl_message_id_t (line 89) | static inline tgl_message_id_t tgl_peer_id_to_msg_id (tgl_peer_id_t peer...
  function tgl_message_id_t (line 98) | static inline tgl_message_id_t tgl_peer_id_to_random_msg_id (tgl_peer_id...

FILE: tgl-timers.c
  function timer_alarm (line 33) | static void timer_alarm (evutil_socket_t fd, short what, void *arg) {
  type tgl_timer (line 38) | struct tgl_timer
  type tgl_state (line 38) | struct tgl_state
  type tgl_state (line 38) | struct tgl_state
  function tgl_timer_insert (line 46) | void tgl_timer_insert (struct tgl_timer *t, double p) {
  function tgl_timer_delete (line 54) | void tgl_timer_delete (struct tgl_timer *t) {
  function tgl_timer_free (line 58) | void tgl_timer_free (struct tgl_timer *t) {
  type tgl_timer_methods (line 64) | struct tgl_timer_methods

FILE: tgl-timers.h
  type tgl_timer_methods (line 25) | struct tgl_timer_methods

FILE: tgl.c
  type tgl_state (line 34) | struct tgl_state
  function tgl_set_binlog_mode (line 37) | void tgl_set_binlog_mode (struct tgl_state *TLS, int mode) {
  function tgl_set_binlog_path (line 41) | void tgl_set_binlog_path (struct tgl_state *TLS, const char *path) {
  function tgl_set_auth_file_path (line 45) | void tgl_set_auth_file_path (struct tgl_state *TLS, const char *path) {
  function tgl_set_download_directory (line 49) | void tgl_set_download_directory (struct tgl_state *TLS, const char *path) {
  function tgl_set_callback (line 56) | void tgl_set_callback (struct tgl_state *TLS, struct tgl_update_callback...
  function tgl_set_rsa_key (line 60) | void tgl_set_rsa_key (struct tgl_state *TLS, const char *key) {
  function tgl_set_rsa_key_direct (line 65) | void tgl_set_rsa_key_direct (struct tgl_state *TLS, unsigned long e, int...
  function tgl_init (line 72) | int tgl_init (struct tgl_state *TLS) {
  function tgl_authorized_dc (line 96) | int tgl_authorized_dc (struct tgl_state *TLS, struct tgl_dc *DC) {
  function tgl_signed_dc (line 101) | int tgl_signed_dc (struct tgl_state *TLS, struct tgl_dc *DC) {
  function tgl_register_app_id (line 106) | void tgl_register_app_id (struct tgl_state *TLS, int app_id, const char ...
  type tgl_state (line 111) | struct tgl_state
  type tgl_state (line 112) | struct tgl_state
  type tgl_state (line 112) | struct tgl_state
  function tgl_incr_verbosity (line 115) | void tgl_incr_verbosity (struct tgl_state *TLS) {
  function tgl_set_verbosity (line 119) | void tgl_set_verbosity (struct tgl_state *TLS, int val) {
  function tgl_enable_pfs (line 123) | void tgl_enable_pfs (struct tgl_state *TLS) {
  function tgl_set_test_mode (line 127) | void tgl_set_test_mode (struct tgl_state *TLS) {
  function tgl_set_net_methods (line 131) | void tgl_set_net_methods (struct tgl_state *TLS, struct tgl_net_methods ...
  function tgl_set_timer_methods (line 135) | void tgl_set_timer_methods (struct tgl_state *TLS, struct tgl_timer_meth...
  function tgl_set_ev_base (line 139) | void tgl_set_ev_base (struct tgl_state *TLS, void *ev_base) {
  function tgl_set_app_version (line 143) | void tgl_set_app_version (struct tgl_state *TLS, const char *app_version) {
  function tgl_enable_ipv6 (line 150) | void tgl_enable_ipv6 (struct tgl_state *TLS) {
  function tgl_disable_link_preview (line 154) | void tgl_disable_link_preview (struct tgl_state *TLS) {
  function tgl_enable_bot (line 158) | void tgl_enable_bot (struct tgl_state *TLS) {

FILE: tgl.h
  type connection (line 54) | struct connection
  type mtproto_methods (line 55) | struct mtproto_methods
  type tgl_session (line 56) | struct tgl_session
  type tgl_dc (line 57) | struct tgl_dc
  type tgl_allocator (line 83) | struct tgl_allocator
  type tgl_allocator (line 84) | struct tgl_allocator
  type tgl_allocator (line 85) | struct tgl_allocator
  type tgl_state (line 86) | struct tgl_state
  type tgl_value_type (line 88) | enum tgl_value_type {
  type tgl_update_callback (line 98) | struct tgl_update_callback {
  type tgl_net_methods (line 125) | struct tgl_net_methods {
  type mtproto_methods (line 138) | struct mtproto_methods {
  type tgl_timer (line 144) | struct tgl_timer
  type tree_random_id (line 145) | struct tree_random_id
  type tree_temp_id (line 146) | struct tree_temp_id
  type tgl_timer_methods (line 148) | struct tgl_timer_methods {
  type tgl_state (line 167) | struct tgl_state {
  type tgl_state (line 275) | struct tgl_state
  type tgl_state (line 276) | struct tgl_state
  type tgl_state (line 278) | struct tgl_state
  type tgl_state (line 279) | struct tgl_state
  type tgl_state (line 280) | struct tgl_state
  type tgl_message (line 282) | struct tgl_message
  type tgl_state (line 282) | struct tgl_state
  type tgl_state (line 283) | struct tgl_state
  type tgl_state (line 285) | struct tgl_state
  type tgl_state (line 286) | struct tgl_state
  type tgl_state (line 287) | struct tgl_state
  type tgl_state (line 288) | struct tgl_state
  type tgl_state (line 289) | struct tgl_state
  type tgl_state (line 290) | struct tgl_state
  type tgl_state (line 291) | struct tgl_state
  type tgl_state (line 291) | struct tgl_state
  type tgl_user (line 291) | struct tgl_user
  type tgl_state (line 308) | struct tgl_state
  type tgl_state (line 309) | struct tgl_state
  type tgl_state (line 310) | struct tgl_state
  type tgl_state (line 311) | struct tgl_state
  type tgl_state (line 312) | struct tgl_state
  type tgl_update_callback (line 312) | struct tgl_update_callback
  type tgl_state (line 313) | struct tgl_state
  type tgl_state (line 314) | struct tgl_state
  type tgl_state (line 315) | struct tgl_state
  function tgl_get_peer_type (line 317) | static inline int tgl_get_peer_type (tgl_peer_id_t id) {
  function tgl_get_peer_id (line 321) | static inline int tgl_get_peer_id (tgl_peer_id_t id) {
  function tgl_peer_id_t (line 325) | static inline tgl_peer_id_t tgl_set_peer_id (int type, int id) {
  function tgl_cmp_peer_id (line 333) | static inline int tgl_cmp_peer_id (tgl_peer_id_t a, tgl_peer_id_t b) {
  type tgl_state (line 337) | struct tgl_state
  type tgl_state (line 338) | struct tgl_state
  type tgl_state (line 339) | struct tgl_state
  type tgl_state (line 340) | struct tgl_state
  type tgl_state (line 341) | struct tgl_state
  type tgl_net_methods (line 341) | struct tgl_net_methods
  type tgl_state (line 342) | struct tgl_state
  type tgl_timer_methods (line 342) | struct tgl_timer_methods
  type tgl_state (line 343) | struct tgl_state
  type tgl_state (line 345) | struct tgl_state
  type tgl_dc (line 345) | struct tgl_dc
  type tgl_state (line 346) | struct tgl_state
  type tgl_dc (line 346) | struct tgl_dc
  type tgl_state (line 348) | struct tgl_state
  type tgl_state (line 349) | struct tgl_state
  type tgl_dc (line 349) | struct tgl_dc
  type tgl_state (line 351) | struct tgl_state
  type tgl_dc (line 351) | struct tgl_dc
  type tgl_state (line 352) | struct tgl_state
  type tgl_dc (line 352) | struct tgl_dc
  type tgl_peer_id_t (line 367) | typedef tgl_peer_id_t tgl_user_id_t;
  type tgl_peer_id_t (line 368) | typedef tgl_peer_id_t tgl_chat_id_t;
  type tgl_peer_id_t (line 369) | typedef tgl_peer_id_t tgl_secret_chat_id_t;
  type tgl_peer_id_t (line 370) | typedef tgl_peer_id_t tgl_user_or_chat_id_t;
  type tgl_state (line 372) | struct tgl_state
  type tgl_state (line 373) | struct tgl_state
  type tgl_state (line 376) | struct tgl_state
  type tgl_state (line 377) | struct tgl_state
  type tgl_state (line 379) | struct tgl_state
  type tgl_state (line 380) | struct tgl_state
  type tgl_state (line 381) | struct tgl_state
  type tgl_state (line 383) | struct tgl_state
  type tgl_state (line 385) | struct tgl_state
  type tgl_state (line 386) | struct tgl_state

FILE: tools.c
  function vasprintf (line 52) | int vasprintf(char ** __restrict__ ret,
  function clock_gettime (line 70) | int clock_gettime(int ignored, struct timespec *spec)
  function logprintf (line 96) | void logprintf (const char *format, ...) {
  function tgl_snprintf (line 107) | int tgl_snprintf (char *buf, int len, const char *format, ...) {
  function tgl_asprintf (line 116) | int tgl_asprintf (char **res, const char *format, ...) {
  function tgl_free_debug (line 129) | void tgl_free_debug (void *ptr, int size __attribute__ ((unused))) {
  function tgl_free_release (line 159) | void tgl_free_release (void *ptr, int size) {
  function tgl_inflate (line 235) | int tgl_inflate (void *input, int ilen, void *output, int olen) {
  function tgl_check_debug (line 255) | void tgl_check_debug (void) {
  function tgl_exists_debug (line 282) | void tgl_exists_debug (void *ptr, int size) {
  function tgl_exists_release (line 297) | void tgl_exists_release (void *ptr, int size) {}
  function tgl_check_release (line 298) | void tgl_check_release (void) {}
  function tgl_my_clock_gettime (line 300) | void tgl_my_clock_gettime (int clock_id, struct timespec *T) {
  function tglt_get_double_time (line 315) | double tglt_get_double_time (void) {
  function tglt_secure_random (line 321) | void tglt_secure_random (void *s, int l) {
  type tgl_allocator (line 336) | struct tgl_allocator
  type tgl_allocator (line 344) | struct tgl_allocator
  function tgl_get_allocated_bytes (line 352) | long long tgl_get_allocated_bytes (void) {
  type tgl_allocator (line 355) | struct tgl_allocator

FILE: tools.h
  type tgl_allocator (line 32) | struct tgl_allocator {
  type tgl_allocator (line 55) | struct tgl_allocator
  function out_of_memory (line 62) | static inline void out_of_memory (void) {
  function ensure (line 67) | static inline void ensure (int r) {
  function ensure_ptr (line 75) | static inline void ensure_ptr (void *p) {
  type timespec (line 107) | struct timespec
  function tgl_free_str (line 109) | static inline void tgl_free_str (void *ptr) {
  function tgl_free_secure (line 114) | static inline void tgl_free_secure (void *ptr, int size) {
  function hexdump (line 119) | static inline void hexdump (void *ptr, void *end_ptr) {

FILE: updates.c
  type tgl_state (line 35) | struct tgl_state
  type tgl_state (line 35) | struct tgl_state
  function fetch_dc_option (line 37) | static void fetch_dc_option (struct tgl_state *TLS, struct tl_ds_dc_opti...
  function tgl_check_pts_diff (line 43) | int tgl_check_pts_diff (struct tgl_state *TLS, int pts, int pts_count) {
  function tgl_check_qts_diff (line 66) | int tgl_check_qts_diff (struct tgl_state *TLS, int qts, int qts_count) {
  function tgl_check_channel_pts_diff (line 85) | int tgl_check_channel_pts_diff (struct tgl_state *TLS, tgl_peer_t *_E, i...
  function do_skip_seq (line 109) | static int do_skip_seq (struct tgl_state *TLS, int seq) {
  function tglu_work_update (line 136) | void tglu_work_update (struct tgl_state *TLS, int check_only, struct tl_...
  function tglu_work_updates (line 576) | void tglu_work_updates (struct tgl_state *TLS, int check_only, struct tl...
  function tglu_work_updates_combined (line 606) | void tglu_work_updates_combined (struct tgl_state *TLS, int check_only, ...
  function tglu_work_update_short_message (line 631) | void tglu_work_update_short_message (struct tgl_state *TLS, int check_on...
  function tglu_work_update_short_chat_message (line 660) | void tglu_work_update_short_chat_message (struct tgl_state *TLS, int che...
  function tglu_work_updates_too_long (line 690) | void tglu_work_updates_too_long (struct tgl_state *TLS, int check_only, ...
  function tglu_work_update_short (line 699) | void tglu_work_update_short (struct tgl_state *TLS, int check_only, stru...
  function tglu_work_update_short_sent_message (line 706) | void tglu_work_update_short_sent_message (struct tgl_state *TLS, int che...
  function tglu_work_any_updates (line 759) | void tglu_work_any_updates (struct tgl_state *TLS, int check_only, struc...
  function tglu_work_any_updates_buf (line 790) | void tglu_work_any_updates_buf (struct tgl_state *TLS) {
  function notify_status (line 801) | static void notify_status (struct tgl_user *U, void *ex) {
  function status_notify (line 808) | static void status_notify (struct tgl_state *TLS, void *arg) {
  function tgl_insert_status_update (line 816) | void tgl_insert_status_update (struct tgl_state *TLS, struct tgl_user *U) {
  function user_expire (line 826) | static void user_expire (struct tgl_state *TLS, void *arg) {
  function tgl_insert_status_expire (line 835) | void tgl_insert_status_expire (struct tgl_state *TLS, struct tgl_user *U) {
  function tgl_remove_status_expire (line 841) | void tgl_remove_status_expire (struct tgl_state *TLS, struct tgl_user *U) {

FILE: updates.h
  type tl_ds_updates (line 23) | struct tl_ds_updates
  type tl_ds_update (line 24) | struct tl_ds_update
  type tgl_state (line 25) | struct tgl_state
  type tgl_user (line 25) | struct tgl_user
  type tgl_state (line 26) | struct tgl_state
  type tgl_user (line 26) | struct tgl_user
  type tgl_state (line 27) | struct tgl_state
  type tgl_user (line 27) | struct tgl_user
  type tgl_state (line 29) | struct tgl_state
  type tgl_state (line 30) | struct tgl_state
  type tl_ds_update (line 30) | struct tl_ds_update
  type tgl_state (line 31) | struct tgl_state
  type tl_ds_updates (line 31) | struct tl_ds_updates
  type tgl_state (line 32) | struct tgl_state
  type tgl_state (line 33) | struct tgl_state
  type tl_ds_updates (line 33) | struct tl_ds_updates
Condensed preview — 88 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,440K chars).
[
  {
    "path": ".gitignore",
    "chars": 104,
    "preview": "Makefile\nautom4te.cache\nconfig.h\nconfig.log\nconfig.status\n.idea/\nnbproject/\nbin/\nobjs/\ndep/\nauto/\nlibs/\n"
  },
  {
    "path": ".gitmodules",
    "chars": 86,
    "preview": "[submodule \"tl-parser\"]\n\tpath = tl-parser\n\turl = https://github.com/vysheng/tl-parser\n"
  },
  {
    "path": "CHANGELOG",
    "chars": 581,
    "preview": "2.0.3\n* updated to layer 31 (bot support)\n* changed signature of contact_search method\n2.0.2\n* fixed small bugs\n* added "
  },
  {
    "path": "LICENSE",
    "chars": 25877,
    "preview": "GNU LESSER GENERAL PUBLIC LICENSE\n\nVersion 2.1, February 1999\n\nCopyright (C) 1991, 1999 Free Software Foundation, Inc.\n5"
  },
  {
    "path": "Makefile.in",
    "chars": 4409,
    "preview": "srcdir=@srcdir@\n\nCFLAGS=@CFLAGS@\nLDFLAGS=@LDFLAGS@ @OPENSSL_LDFLAGS@\nCPPFLAGS=@CPPFLAGS@ @OPENSSL_INCLUDES@\nDEFS=@DEFS@\n"
  },
  {
    "path": "Makefile.tl-parser",
    "chars": 308,
    "preview": "TL_PARSER_OBJECTS=${OBJ}/tl-parser.o ${OBJ}/tlc.o\n\n${TL_PARSER_OBJECTS}: ${OBJ}/%.o: ${srcdir}/tl-parser/%.c | create_di"
  },
  {
    "path": "README.md",
    "chars": 1030,
    "preview": "This is library that handles telegram api and protocol.\n\nCurrent versions:\n\n- scheme.tl: Layer 38\n- encrypted_scheme.tl:"
  },
  {
    "path": "append.tl",
    "chars": 592,
    "preview": "---types---\ndecryptedMessageMediaVideoL12#4cee6ef3 str_thumb:bytes thumb_w:int thumb_h:int duration:int w:int h:int size"
  },
  {
    "path": "auto-static-autocomplete.c",
    "chars": 1827,
    "preview": "#include <assert.h>\n\n#include \"config.h\"\n\n#define IN_AUTOCOMPLETE_H\n#include \"auto-static-store.c\"\n#undef IN_AUTOCOMPLET"
  },
  {
    "path": "auto-static-fetch.c",
    "chars": 2371,
    "preview": "#include <assert.h>\n\n#include \"config.h\"\n\nstatic int multiline_output = 1;\nstatic int multiline_offset;\nstatic int multi"
  },
  {
    "path": "auto-static-print-ds.c",
    "chars": 2410,
    "preview": "#include \"config.h\"\n#ifdef DISABLE_EXTF\n#error \"EXTF disabled, so nothing uses auto-print anymore.\"\n#endif\n\nstatic int m"
  },
  {
    "path": "auto-static-skip.c",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "auto-static-store.c",
    "chars": 6827,
    "preview": "#include <assert.h>\n\n#include \"config.h\"\n\nstatic int cur_token_len;\nstatic char *cur_token;\nstatic int cur_token_real_le"
  },
  {
    "path": "auto-static.c",
    "chars": 8684,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "auto.h",
    "chars": 2026,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "binlog.c",
    "chars": 29405,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "binlog.tl",
    "chars": 3508,
    "preview": "---types---\n\nbinlog.encrKey key:64*[int] = binlog.EncrKey;\n\nbinlog.peerUser = binlog.PeerType;\nbinlog.peerChat = binlog."
  },
  {
    "path": "config.h.in",
    "chars": 4392,
    "preview": "/* config.h.in.  Generated from configure.ac by autoheader.  */\n\n/* disable extf queries */\n#undef DISABLE_EXTF\n\n/* Use "
  },
  {
    "path": "configure",
    "chars": 167842,
    "preview": "#! /bin/sh\n# Guess values for system-dependent variables and create Makefiles.\n# Generated by GNU Autoconf 2.69 for tele"
  },
  {
    "path": "configure.ac",
    "chars": 3078,
    "preview": "AC_PREREQ([2.68])\nAC_INIT([telegram-cli], [1.0])\nAC_CONFIG_SRCDIR([config.h.in])\nAC_CONFIG_HEADERS([config.h])\n\nm4_inclu"
  },
  {
    "path": "crypto/aes.h",
    "chars": 1449,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "crypto/aes_altern.c",
    "chars": 5394,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "crypto/aes_openssl.c",
    "chars": 1692,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "crypto/bn.h",
    "chars": 1998,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "crypto/bn_altern.c",
    "chars": 4468,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "crypto/bn_openssl.c",
    "chars": 2792,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "crypto/err.h",
    "chars": 958,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "crypto/err_altern.c",
    "chars": 1032,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "crypto/err_openssl.c",
    "chars": 1005,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "crypto/md5.h",
    "chars": 999,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "crypto/md5_altern.c",
    "chars": 1193,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "crypto/md5_openssl.c",
    "chars": 1020,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "crypto/meta.h",
    "chars": 2986,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "crypto/rand.h",
    "chars": 1070,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "crypto/rand_altern.c",
    "chars": 1543,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "crypto/rand_openssl.c",
    "chars": 1220,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "crypto/rsa_pem.h",
    "chars": 1211,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "crypto/rsa_pem_altern.c",
    "chars": 2339,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "crypto/rsa_pem_openssl.c",
    "chars": 1965,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "crypto/sha.h",
    "chars": 1072,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "crypto/sha_altern.c",
    "chars": 1320,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "crypto/sha_openssl.c",
    "chars": 1120,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "encrypted_scheme.tl",
    "chars": 2629,
    "preview": "---types---\ndecryptedMessageMediaEmpty#89f5c4a = DecryptedMessageMedia;\ndecryptedMessageMediaPhoto#32798a8c str_thumb:by"
  },
  {
    "path": "errors",
    "chars": 700,
    "preview": "type of errors that tgl can set:\n\nEPROTO: server returned error for query. Some kinds of error (such as FLOOD_WAIT) tgl "
  },
  {
    "path": "event-old.h",
    "chars": 1721,
    "preview": "#ifndef __EVENT_OLD_H__\n#define __EVENT_OLD_H__\n\n#include <assert.h>\n#include <stdlib.h>\n\n#define BEV_EVENT_READ EVBUFFE"
  },
  {
    "path": "gen_constants_h.awk",
    "chars": 1386,
    "preview": "BEGIN {\n  print \"/*\";\n  print \"    This file is part of telegram-client.\";\n  print \"\";\n  print \"    Telegram-client is f"
  },
  {
    "path": "generate.c",
    "chars": 105297,
    "preview": "/*\n    This file is part of tgl-libary/generate\n\n    Tgl-library/generate is free software: you can redistribute it and/"
  },
  {
    "path": "generate.h",
    "chars": 4234,
    "preview": "/*\n    This file is part of tgl-libary/generate\n\n    Tgl-library/generate is free software: you can redistribute it and/"
  },
  {
    "path": "m4_ax_check_openssl.m4",
    "chars": 4186,
    "preview": "# ===========================================================================\n#     http://www.gnu.org/software/autoconf"
  },
  {
    "path": "m4_ax_check_zlib.m4",
    "chars": 5416,
    "preview": "# ===========================================================================\n#       http://www.gnu.org/software/autoco"
  },
  {
    "path": "mime-types.c",
    "chars": 327218,
    "preview": "unsigned char mime_types[] = {\n  0x23, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20,\n  0x6d, 0x61, 0"
  },
  {
    "path": "mime.types",
    "chars": 53051,
    "preview": "# This file maps Internet media types to unique file extension(s).\n# Although created for httpd, this file is used by ma"
  },
  {
    "path": "mtproto-client.c",
    "chars": 46882,
    "preview": "/*\n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify it"
  },
  {
    "path": "mtproto-client.h",
    "chars": 2529,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "mtproto-common.c",
    "chars": 12097,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "mtproto-common.h",
    "chars": 10523,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "mtproto-key.c",
    "chars": 2793,
    "preview": "/*\n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify it"
  },
  {
    "path": "mtproto-key.h",
    "chars": 1025,
    "preview": "/*\n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify it"
  },
  {
    "path": "mtproto-utils.c",
    "chars": 4210,
    "preview": "#include \"config.h\"\n#include \"crypto/bn.h\"\n#include \"tl-parser/portable_endian.h\"\n#include \"tgl.h\"\n#include \"tools.h\"\n#i"
  },
  {
    "path": "mtproto-utils.h",
    "chars": 283,
    "preview": "#ifndef __MTPROTO_UTILS_H__\n#define __MTPROTO_UTILS_H__\n#include \"crypto/bn.h\"\nint tglmp_check_DH_params (struct tgl_sta"
  },
  {
    "path": "mtproto.tl",
    "chars": 1485,
    "preview": "---types---\nresPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:(Vector long) = Res"
  },
  {
    "path": "no-preview.h",
    "chars": 6808,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "queries-encrypted.c",
    "chars": 27009,
    "preview": "\n/* {{{ Encrypt decrypted */\nstatic int *encr_extra;\nstatic int *encr_ptr;\nstatic int *encr_end;\n\nstatic char *encrypt_d"
  },
  {
    "path": "queries.c",
    "chars": 183135,
    "preview": "/*\n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify it"
  },
  {
    "path": "queries.h",
    "chars": 3254,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "scheme.tl",
    "chars": 47630,
    "preview": "int ?= Int;\nlong ?= Long;\ndouble ?= Double;\nstring ?= String;\n\nbytes string = Bytes;\n\nint128 long long = Int128;\nint256 "
  },
  {
    "path": "structures.c",
    "chars": 80743,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "tg-mime-types.c",
    "chars": 2391,
    "preview": "#include <string.h>\n#include <assert.h>\n#define MAX_MIME_TYPES_NUM 10000\n\n#include \"mime-types.c\"\n  \nstatic int mime_ini"
  },
  {
    "path": "tg-mime-types.h",
    "chars": 103,
    "preview": "char *tg_mime_by_filename (const char *filename);\nchar *tg_extension_by_mime (const char *mime_type);\n\n"
  },
  {
    "path": "tgl-binlog.h",
    "chars": 4638,
    "preview": "/*\n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify it"
  },
  {
    "path": "tgl-fetch.h",
    "chars": 4438,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "tgl-inner.h",
    "chars": 1084,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "tgl-layout.h",
    "chars": 13979,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "tgl-methods-in.h",
    "chars": 3236,
    "preview": "// normally you should not use these methods \n// use them with caution\n\n\n#ifndef __TGL_METHODS_IN_H__\n#define __TGL_METH"
  },
  {
    "path": "tgl-net-inner.h",
    "chars": 2712,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "tgl-net.c",
    "chars": 15530,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "tgl-net.h",
    "chars": 925,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "tgl-queries.h",
    "chars": 21854,
    "preview": "#ifndef __TGL_QUERIES_H__\n#define __TGL_QUERIES_H__\n\n#include \"tgl.h\"\n\nvoid tgl_do_get_terms_of_service (struct tgl_stat"
  },
  {
    "path": "tgl-structures.h",
    "chars": 4919,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "tgl-timers.c",
    "chars": 2053,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "tgl-timers.h",
    "chars": 963,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "tgl.c",
    "chars": 4333,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "tgl.h",
    "chars": 13905,
    "preview": "/*\n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify it"
  },
  {
    "path": "tools.c",
    "chars": 9454,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "tools.h",
    "chars": 3816,
    "preview": "/*\n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify it"
  },
  {
    "path": "tree.h",
    "chars": 5955,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "updates.c",
    "chars": 27100,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  },
  {
    "path": "updates.h",
    "chars": 1575,
    "preview": "/* \n    This file is part of tgl-library\n\n    This library is free software; you can redistribute it and/or\n    modify i"
  }
]

About this extraction

This page contains the full source code of the vysheng/tgl GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 88 files (1.3 MB), approximately 615.4k tokens, and a symbol index with 1773 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!