Showing preview only (777K chars total). Download the full file or copy to clipboard to get everything.
Repository: vysheng/tg
Branch: master
Commit: 6547c0b21b97
Files: 69
Total size: 748.8 KB
Directory structure:
gitextract_jznprqyy/
├── .gitignore
├── .gitmodules
├── .travis.yml
├── CHANGELOG
├── LICENSE
├── LICENSE.h
├── Makefile.in
├── Makefile.tgl
├── Makefile.tl-parser
├── README-Cygwin.md
├── README-LUA
├── README-PY.md
├── README.es
├── README.md
├── ax_lua.m4
├── ax_python.m4
├── bootstrap
├── config.h.in
├── config.sample
├── configure
├── configure.ac
├── debian/
│ ├── changelog
│ ├── clean
│ ├── compat
│ ├── control
│ ├── copyright
│ ├── docs
│ ├── install
│ ├── rules
│ ├── source/
│ │ └── format
│ ├── telegram-cli.8
│ ├── telegram-cli.logrotate
│ ├── telegram-cli.manpages
│ ├── telegram-cli.postinst.debhelper
│ ├── telegram-cli.preinst
│ ├── telegram-cli.preinst.debhelper
│ ├── telegram-cli.prerm
│ ├── telegram-cli.prerm.debhelper
│ ├── telegram-cli.upstart
│ └── watch
├── event-old.h
├── gentoo/
│ └── net-im/
│ └── telegram-cli/
│ ├── Manifest
│ └── telegram-cli-9999.ebuild
├── interface.c
├── interface.h
├── json-tg.c
├── json-tg.h
├── loop.c
├── loop.h
├── lua-tg.c
├── lua-tg.h
├── m4-ax_gcc_builtin.m4
├── m4_ax_check_openssl.m4
├── m4_ax_check_zlib.m4
├── main.c
├── python-tg.c
├── python-tg.h
├── python-types.c
├── python-types.h
├── rpm/
│ └── telegram-cli-Beta-2.fc20.x86_64.rpm
├── server.pub
├── start-telegram-daemon
├── telegram-cli-cygwin.patch
├── telegram-cli.spec
├── telegram-daemon
├── telegram.h
├── test.lua
├── tg-server.pub
└── tg-test.py
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
telegram
*.o
Makefile
aclocal.m4
autom4te.cache
config.h
config.log
config.status
.idea/
nbproject/
bin/
objs/
dep/
auto/
libs/
debian/telegram-cli.[a-z]
debian/files
debian/telegram-cli/*
debian/telegram-cli.debhelper.log
debian/telegram-cli.substvars
__pycache__
================================================
FILE: .gitmodules
================================================
[submodule "tgl"]
path = tgl
url = https://github.com/vysheng/tgl.git
================================================
FILE: .travis.yml
================================================
language: c
compiler:
- gcc
- clang
install:
- sudo apt-get update
- sudo apt-get install libconfig8-dev
- sudo apt-get install libreadline6-dev
- sudo apt-get install libssl-dev
- sudo apt-get install liblua5.2-dev lua5.2
- sudo apt-get install python-dev python
- sudo apt-get install libevent-dev
- sudo apt-get install libjansson-dev
script:
- git submodule update --init --recursive
- ./configure
- make
================================================
FILE: CHANGELOG
================================================
1.3.3
* support for sending custom keyboard
* fixed contact_search
* TGL-2.0.3
1.3.2
* use TGL-2.0.2
* add block/unblock user methods
* support for autocomplete for bot's commands
1.3.1
* added error codes
1.3.0
* layer 28 support (passwords, replies, webpages, other changes)
* output in json format
* support for lua functions in CLI mode (register_interface_function)
* bugfixes
* output error codes to socket
* allow [reply=<num>], [disable_preview] and [enable_preview] prefixes to query
1.2.1
* fixed registration/login problem
* added extension to downloads
1.2.0
* layer 22 support
* new authorization code
* fixed time-related problems
* fixed crash after hibernation
1.0.6
* layer 18 support
1.0.5
* listening socket (tcp and unix) for commands
1.0.4
* changed create_group_chat format
* changed search query
* rewritten interface code. Support for escaped characters in quotes
1.0.3
* options to help to run telegram-cli as daemon
1.0.2
* Bug fixes
1.0.1
* Added pfs support. To use it you should add 'pfs_enabled=true' line to config.
* Added export_card/import_card methods
================================================
FILE: LICENSE
================================================
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
================================================
FILE: LICENSE.h
================================================
" GNU GENERAL PUBLIC LICENSE\n"
" Version 2, June 1991\n"
"\n"
" Copyright (C) 1989, 1991 Free Software Foundation, Inc.,\n"
" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n"
" Everyone is permitted to copy and distribute verbatim copies\n"
" of this license document, but changing it is not allowed.\n"
"\n"
" Preamble\n"
"\n"
" The licenses for most software are designed to take away your\n"
"freedom to share and change it. By contrast, the GNU General Public\n"
"License is intended to guarantee your freedom to share and change free\n"
"software--to make sure the software is free for all its users. This\n"
"General Public License applies to most of the Free Software\n"
"Foundation's software and to any other program whose authors commit to\n"
"using it. (Some other Free Software Foundation software is covered by\n"
"the GNU Lesser General Public License instead.) You can apply it to\n"
"your programs, too.\n"
"\n"
" When we speak of free software, we are referring to freedom, not\n"
"price. Our General Public Licenses are designed to make sure that you\n"
"have the freedom to distribute copies of free software (and charge for\n"
"this service if you wish), that you receive source code or can get it\n"
"if you want it, that you can change the software or use pieces of it\n"
"in new free programs; and that you know you can do these things.\n"
"\n"
" To protect your rights, we need to make restrictions that forbid\n"
"anyone to deny you these rights or to ask you to surrender the rights.\n"
"These restrictions translate to certain responsibilities for you if you\n"
"distribute copies of the software, or if you modify it.\n"
"\n"
" For example, if you distribute copies of such a program, whether\n"
"gratis or for a fee, you must give the recipients all the rights that\n"
"you have. You must make sure that they, too, receive or can get the\n"
"source code. And you must show them these terms so they know their\n"
"rights.\n"
"\n"
" We protect your rights with two steps: (1) copyright the software, and\n"
"(2) offer you this license which gives you legal permission to copy,\n"
"distribute and/or modify the software.\n"
"\n"
" Also, for each author's protection and ours, we want to make certain\n"
"that everyone understands that there is no warranty for this free\n"
"software. If the software is modified by someone else and passed on, we\n"
"want its recipients to know that what they have is not the original, so\n"
"that any problems introduced by others will not reflect on the original\n"
"authors' reputations.\n"
"\n"
" Finally, any free program is threatened constantly by software\n"
"patents. We wish to avoid the danger that redistributors of a free\n"
"program will individually obtain patent licenses, in effect making the\n"
"program proprietary. To prevent this, we have made it clear that any\n"
"patent must be licensed for everyone's free use or not licensed at all.\n"
"\n"
" The precise terms and conditions for copying, distribution and\n"
"modification follow.\n"
"\n"
" GNU GENERAL PUBLIC LICENSE\n"
" TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n"
"\n"
" 0. This License applies to any program or other work which contains\n"
"a notice placed by the copyright holder saying it may be distributed\n"
"under the terms of this General Public License. The \"Program\", below,\n"
"refers to any such program or work, and a \"work based on the Program\"\n"
"means either the Program or any derivative work under copyright law:\n"
"that is to say, a work containing the Program or a portion of it,\n"
"either verbatim or with modifications and/or translated into another\n"
"language. (Hereinafter, translation is included without limitation in\n"
"the term \"modification\".) Each licensee is addressed as \"you\".\n"
"\n"
"Activities other than copying, distribution and modification are not\n"
"covered by this License; they are outside its scope. The act of\n"
"running the Program is not restricted, and the output from the Program\n"
"is covered only if its contents constitute a work based on the\n"
"Program (independent of having been made by running the Program).\n"
"Whether that is true depends on what the Program does.\n"
"\n"
" 1. You may copy and distribute verbatim copies of the Program's\n"
"source code as you receive it, in any medium, provided that you\n"
"conspicuously and appropriately publish on each copy an appropriate\n"
"copyright notice and disclaimer of warranty; keep intact all the\n"
"notices that refer to this License and to the absence of any warranty;\n"
"and give any other recipients of the Program a copy of this License\n"
"along with the Program.\n"
"\n"
"You may charge a fee for the physical act of transferring a copy, and\n"
"you may at your option offer warranty protection in exchange for a fee.\n"
"\n"
" 2. You may modify your copy or copies of the Program or any portion\n"
"of it, thus forming a work based on the Program, and copy and\n"
"distribute such modifications or work under the terms of Section 1\n"
"above, provided that you also meet all of these conditions:\n"
"\n"
" a) You must cause the modified files to carry prominent notices\n"
" stating that you changed the files and the date of any change.\n"
"\n"
" b) You must cause any work that you distribute or publish, that in\n"
" whole or in part contains or is derived from the Program or any\n"
" part thereof, to be licensed as a whole at no charge to all third\n"
" parties under the terms of this License.\n"
"\n"
" c) If the modified program normally reads commands interactively\n"
" when run, you must cause it, when started running for such\n"
" interactive use in the most ordinary way, to print or display an\n"
" announcement including an appropriate copyright notice and a\n"
" notice that there is no warranty (or else, saying that you provide\n"
" a warranty) and that users may redistribute the program under\n"
" these conditions, and telling the user how to view a copy of this\n"
" License. (Exception: if the Program itself is interactive but\n"
" does not normally print such an announcement, your work based on\n"
" the Program is not required to print an announcement.)\n"
"\n"
"These requirements apply to the modified work as a whole. If\n"
"identifiable sections of that work are not derived from the Program,\n"
"and can be reasonably considered independent and separate works in\n"
"themselves, then this License, and its terms, do not apply to those\n"
"sections when you distribute them as separate works. But when you\n"
"distribute the same sections as part of a whole which is a work based\n"
"on the Program, the distribution of the whole must be on the terms of\n"
"this License, whose permissions for other licensees extend to the\n"
"entire whole, and thus to each and every part regardless of who wrote it.\n"
"\n"
"Thus, it is not the intent of this section to claim rights or contest\n"
"your rights to work written entirely by you; rather, the intent is to\n"
"exercise the right to control the distribution of derivative or\n"
"collective works based on the Program.\n"
"\n"
"In addition, mere aggregation of another work not based on the Program\n"
"with the Program (or with a work based on the Program) on a volume of\n"
"a storage or distribution medium does not bring the other work under\n"
"the scope of this License.\n"
"\n"
" 3. You may copy and distribute the Program (or a work based on it,\n"
"under Section 2) in object code or executable form under the terms of\n"
"Sections 1 and 2 above provided that you also do one of the following:\n"
"\n"
" a) Accompany it with the complete corresponding machine-readable\n"
" source code, which must be distributed under the terms of Sections\n"
" 1 and 2 above on a medium customarily used for software interchange; or,\n"
"\n"
" b) Accompany it with a written offer, valid for at least three\n"
" years, to give any third party, for a charge no more than your\n"
" cost of physically performing source distribution, a complete\n"
" machine-readable copy of the corresponding source code, to be\n"
" distributed under the terms of Sections 1 and 2 above on a medium\n"
" customarily used for software interchange; or,\n"
"\n"
" c) Accompany it with the information you received as to the offer\n"
" to distribute corresponding source code. (This alternative is\n"
" allowed only for noncommercial distribution and only if you\n"
" received the program in object code or executable form with such\n"
" an offer, in accord with Subsection b above.)\n"
"\n"
"The source code for a work means the preferred form of the work for\n"
"making modifications to it. For an executable work, complete source\n"
"code means all the source code for all modules it contains, plus any\n"
"associated interface definition files, plus the scripts used to\n"
"control compilation and installation of the executable. However, as a\n"
"special exception, the source code distributed need not include\n"
"anything that is normally distributed (in either source or binary\n"
"form) with the major components (compiler, kernel, and so on) of the\n"
"operating system on which the executable runs, unless that component\n"
"itself accompanies the executable.\n"
"\n"
"If distribution of executable or object code is made by offering\n"
"access to copy from a designated place, then offering equivalent\n"
"access to copy the source code from the same place counts as\n"
"distribution of the source code, even though third parties are not\n"
"compelled to copy the source along with the object code.\n"
"\n"
" 4. You may not copy, modify, sublicense, or distribute the Program\n"
"except as expressly provided under this License. Any attempt\n"
"otherwise to copy, modify, sublicense or distribute the Program is\n"
"void, and will automatically terminate your rights under this License.\n"
"However, parties who have received copies, or rights, from you under\n"
"this License will not have their licenses terminated so long as such\n"
"parties remain in full compliance.\n"
"\n"
" 5. You are not required to accept this License, since you have not\n"
"signed it. However, nothing else grants you permission to modify or\n"
"distribute the Program or its derivative works. These actions are\n"
"prohibited by law if you do not accept this License. Therefore, by\n"
"modifying or distributing the Program (or any work based on the\n"
"Program), you indicate your acceptance of this License to do so, and\n"
"all its terms and conditions for copying, distributing or modifying\n"
"the Program or works based on it.\n"
"\n"
" 6. Each time you redistribute the Program (or any work based on the\n"
"Program), the recipient automatically receives a license from the\n"
"original licensor to copy, distribute or modify the Program subject to\n"
"these terms and conditions. You may not impose any further\n"
"restrictions on the recipients' exercise of the rights granted herein.\n"
"You are not responsible for enforcing compliance by third parties to\n"
"this License.\n"
"\n"
" 7. If, as a consequence of a court judgment or allegation of patent\n"
"infringement or for any other reason (not limited to patent issues),\n"
"conditions are imposed on you (whether by court order, agreement or\n"
"otherwise) that contradict the conditions of this License, they do not\n"
"excuse you from the conditions of this License. If you cannot\n"
"distribute so as to satisfy simultaneously your obligations under this\n"
"License and any other pertinent obligations, then as a consequence you\n"
"may not distribute the Program at all. For example, if a patent\n"
"license would not permit royalty-free redistribution of the Program by\n"
"all those who receive copies directly or indirectly through you, then\n"
"the only way you could satisfy both it and this License would be to\n"
"refrain entirely from distribution of the Program.\n"
"\n"
"If any portion of this section is held invalid or unenforceable under\n"
"any particular circumstance, the balance of the section is intended to\n"
"apply and the section as a whole is intended to apply in other\n"
"circumstances.\n"
"\n"
"It is not the purpose of this section to induce you to infringe any\n"
"patents or other property right claims or to contest validity of any\n"
"such claims; this section has the sole purpose of protecting the\n"
"integrity of the free software distribution system, which is\n"
"implemented by public license practices. Many people have made\n"
"generous contributions to the wide range of software distributed\n"
"through that system in reliance on consistent application of that\n"
"system; it is up to the author/donor to decide if he or she is willing\n"
"to distribute software through any other system and a licensee cannot\n"
"impose that choice.\n"
"\n"
"This section is intended to make thoroughly clear what is believed to\n"
"be a consequence of the rest of this License.\n"
"\n"
" 8. If the distribution and/or use of the Program is restricted in\n"
"certain countries either by patents or by copyrighted interfaces, the\n"
"original copyright holder who places the Program under this License\n"
"may add an explicit geographical distribution limitation excluding\n"
"those countries, so that distribution is permitted only in or among\n"
"countries not thus excluded. In such case, this License incorporates\n"
"the limitation as if written in the body of this License.\n"
"\n"
" 9. The Free Software Foundation may publish revised and/or new versions\n"
"of the General Public License from time to time. Such new versions will\n"
"be similar in spirit to the present version, but may differ in detail to\n"
"address new problems or concerns.\n"
"\n"
"Each version is given a distinguishing version number. If the Program\n"
"specifies a version number of this License which applies to it and \"any\n"
"later version\", you have the option of following the terms and conditions\n"
"either of that version or of any later version published by the Free\n"
"Software Foundation. If the Program does not specify a version number of\n"
"this License, you may choose any version ever published by the Free Software\n"
"Foundation.\n"
"\n"
" 10. If you wish to incorporate parts of the Program into other free\n"
"programs whose distribution conditions are different, write to the author\n"
"to ask for permission. For software which is copyrighted by the Free\n"
"Software Foundation, write to the Free Software Foundation; we sometimes\n"
"make exceptions for this. Our decision will be guided by the two goals\n"
"of preserving the free status of all derivatives of our free software and\n"
"of promoting the sharing and reuse of software generally.\n"
"\n"
" NO WARRANTY\n"
"\n"
" 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\n"
"FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN\n"
"OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\n"
"PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\n"
"OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n"
"MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS\n"
"TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE\n"
"PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\n"
"REPAIR OR CORRECTION.\n"
"\n"
" 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\n"
"WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\n"
"REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\n"
"INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\n"
"OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\n"
"TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\n"
"YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\n"
"PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\n"
"POSSIBILITY OF SUCH DAMAGES.\n"
"\n"
" END OF TERMS AND CONDITIONS\n"
"\n"
" How to Apply These Terms to Your New Programs\n"
"\n"
" If you develop a new program, and you want it to be of the greatest\n"
"possible use to the public, the best way to achieve this is to make it\n"
"free software which everyone can redistribute and change under these terms.\n"
"\n"
" To do so, attach the following notices to the program. It is safest\n"
"to attach them to the start of each source file to most effectively\n"
"convey the exclusion of warranty; and each file should have at least\n"
"the \"copyright\" line and a pointer to where the full notice is found.\n"
"\n"
" <one line to give the program's name and a brief idea of what it does.>\n"
" Copyright (C) <year> <name of author>\n"
"\n"
" This program is free software; you can redistribute it and/or modify\n"
" it under the terms of the GNU General Public License as published by\n"
" the Free Software Foundation; either version 2 of the License, or\n"
" (at your option) any later version.\n"
"\n"
" This program is distributed in the hope that it will be useful,\n"
" but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
" GNU General Public License for more details.\n"
"\n"
" You should have received a copy of the GNU General Public License along\n"
" with this program; if not, write to the Free Software Foundation, Inc.,\n"
" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n"
"\n"
"Also add information on how to contact you by electronic and paper mail.\n"
"\n"
"If the program is interactive, make it output a short notice like this\n"
"when it starts in an interactive mode:\n"
"\n"
" Gnomovision version 69, Copyright (C) year name of author\n"
" Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n"
" This is free software, and you are welcome to redistribute it\n"
" under certain conditions; type `show c' for details.\n"
"\n"
"The hypothetical commands `show w' and `show c' should show the appropriate\n"
"parts of the General Public License. Of course, the commands you use may\n"
"be called something other than `show w' and `show c'; they could even be\n"
"mouse-clicks or menu items--whatever suits your program.\n"
"\n"
"You should also get your employer (if you work as a programmer) or your\n"
"school, if any, to sign a \"copyright disclaimer\" for the program, if\n"
"necessary. Here is a sample; alter the names:\n"
"\n"
" Yoyodyne, Inc., hereby disclaims all copyright interest in the program\n"
" `Gnomovision' (which makes passes at compilers) written by James Hacker.\n"
"\n"
" <signature of Ty Coon>, 1 April 1989\n"
" Ty Coon, President of Vice\n"
"\n"
"This General Public License does not permit incorporating your program into\n"
"proprietary programs. If your program is a subroutine library, you may\n"
"consider it more useful to permit linking proprietary applications with the\n"
"library. If this is what you want to do, use the GNU Lesser General\n"
"Public License instead of this License.\n"
================================================
FILE: Makefile.in
================================================
srcdir=@srcdir@
CFLAGS=@CFLAGS@
LDFLAGS=@LDFLAGS@ @OPENSSL_LDFLAGS@
CPPFLAGS=@CPPFLAGS@ @OPENSSL_INCLUDES@
DEFS=@DEFS@
COMPILE_FLAGS=${CFLAGS} ${CPFLAGS} ${CPPFLAGS} ${DEFS} -Wall -Werror -Wextra -Wno-missing-field-initializers -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 -levent ${EXTRA_LIBS} -ldl -lpthread -lutil
LINK_FLAGS=${LDFLAGS} ${LOCAL_LDFLAGS}
DEP=dep
AUTO=auto
EXE=bin
OBJ=objs
LIB=libs
DIR_LIST=${DEP} ${AUTO} ${EXE} ${OBJ} ${LIB} ${DEP}/auto ${OBJ}/auto ${OBJ}/crypto ${DEP}/crypto
EXE_LIST=${EXE}/telegram-cli
TG_OBJECTS=${OBJ}/main.o ${OBJ}/loop.o ${OBJ}/interface.o ${OBJ}/lua-tg.o ${OBJ}/json-tg.o ${OBJ}/python-tg.o ${OBJ}/python-types.o
INCLUDE=-I. -I${srcdir} -I${srcdir}/tgl
CC=@CC@
.SUFFIXES:
.SUFFIXES: .c .h .o
all: ${EXE_LIST} ${DIR_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 ${AUTO}/constants.h ${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
create_dirs: ${DIR_LIST}
dump-tl: ${EXE}/dump-tl-file
include ${srcdir}/Makefile.tl-parser
include ${srcdir}/Makefile.tgl
${DIR_LIST}:
@test -d $@ || mkdir -p $@
OBJ_LIST=${TG_OBJECTS} ${TGL_OBJECTS} ${TGL_COMMON_OBJECTS} ${GENERATE_OBJECTS} ${TL_PARSER_OBJECTS} ${TGL_OBJECTS_AUTO}
DEPENDENCE=$(subst ${OBJ}/,${DEP}/,$(patsubst %.o,%.d,${OBJ_LIST}))
DEPENDENCE_LIST=${DEPENDENCE}
-include ${DEPENDENCE_LIST}
${TG_OBJECTS}: ${OBJ}/%.o: ${srcdir}/%.c | create_dirs_and_headers
${CC} ${INCLUDE} ${COMPILE_FLAGS} -c -MP -MD -MF ${DEP}/$*.d -MQ ${OBJ}/$*.o -o $@ $<
${EXE}/telegram-cli: ${TG_OBJECTS} ${LIB}/libtgl.a
${CC} $^ ${LINK_FLAGS} -o $@
clean:
rm -rf ${DIR_LIST}
distclean:
rm -rf ${DIR_LIST} config.h config.log config.status
================================================
FILE: Makefile.tgl
================================================
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}/tgl-net.o ${OBJ}/tgl-timers.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
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
TGL_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
TGL_OBJ_C=${GENERATE_OBJECTS} ${TGL_COMMON_OBJECTS} ${TGL_OBJECTS} ${TLD_OBJECTS}
.SUFFIXES:
.SUFFIXES: .c .h .o
dump-tl: ${EXE}/dump-tl-file
${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
${TGL_OBJ_C}: ${OBJ}/%.o: ${srcdir}/tgl/%.c | create_dirs
${CC} ${INCLUDE} ${COMPILE_FLAGS} -iquote ${srcdir}/tgl -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 $@ $<
#${OBJ}/auto/auto.o: ${AUTO}/auto.c
# ${CC} ${INCLUDE} ${COMPILE_FLAGS} -iquote ${srcdir}/tgl -c -MP -MD -MF ${DEP}/auto/auto.d -MQ ${OBJ}/auto/auto.o -o $@ $<
${LIB}/libtgl.a: ${TGL_OBJECTS} ${TGL_COMMON_OBJECTS} ${TGL_OBJECTS_AUTO}
rm -f $@ && ar ruv $@ $^
${EXE}/generate: ${GENERATE_OBJECTS} ${TGL_COMMON_OBJECTS}
${CC} ${GENERATE_OBJECTS} ${TGL_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}/tgl/scheme.tl ${srcdir}/tgl/encrypted_scheme.tl ${srcdir}/tgl/binlog.tl ${srcdir}/tgl/append.tl ${srcdir}/tgl/mtproto.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 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}/tgl/gen_constants_h.awk
awk -f ${srcdir}/tgl/gen_constants_h.awk < $< > $@
${EXE}/dump-tl-file: ${OBJ}/auto/auto.o ${TLD_OBJECTS}
${CC} ${OBJ}/auto/auto.o ${TLD_OBJECTS} ${LINK_FLAGS} -o $@
================================================
FILE: Makefile.tl-parser
================================================
TL_PARSER_OBJECTS=${OBJ}/tl-parser.o ${OBJ}/tlc.o
${TL_PARSER_OBJECTS}: ${OBJ}/%.o: ${srcdir}/tgl/tl-parser/%.c | create_dirs
${CC} ${INCLUDE} ${COMPILE_FLAGS} -iquote ${srcdir}/tgl/tl-parser -c -MP -MD -MF ${DEP}/$*.d -MQ ${OBJ}/$*.o -o $@ $<
${EXE}/tl-parser: ${TL_PARSER_OBJECTS}
${CC} $^ ${LINK_FLAGS} -o $@
================================================
FILE: README-Cygwin.md
================================================
### Installation on Windows
To use telegram-cli in Windows, you should compile with Cygwin which has POSIX API functionality.
Install [Cygwin](https://www.cygwin.com/) and cygwin's package manager, [apt-cyg](https://github.com/transcode-open/apt-cyg).
In Cygwin Terminal, install compiler and tools :
apt-cyg install cygwin32-gcc-core cygwin32-gcc-g++ gcc-core gcc-g++ make wget patch diffutils grep tar gzip
Now you have a compiler, but no libraries. You need readline, openssl, libconfig, liblua, python and libjansson to use telegram-cli's full functionality.
Then Clone GitHub Repository in Cygwin Terminal
git clone --recursive https://github.com/vysheng/tg.git
In Cygwin Terminal, type:
apt-cyg install libevent-devel openssl-devel libreadline-devel lua-devel python3
(Install package 'python' to use Python 2.7, or install package 'python3' to use Python 3)
libconfig and libjansson is not in cygwin's package, so you should compile yourself.
Compile libconfig
wget http://www.hyperrealm.com/libconfig/libconfig-1.5.tar.gz
tar xvf libconfig-1.5.tar.gz && cd libconfig-1.5
./configure
make && make install && cd ..
Compile libjansson
wget http://www.digip.org/jansson/releases/jansson-2.7.tar.gz
tar xvf jansson-2.7.tar.gz && cd jansson-2.7
./configure
make && make install && cd ..
Then, go to tg directory then generate Makefile.
cd tg
./configure
We need to patch Makefile and loop.c to compile in cygwin. Download this [patch](https://gist.github.com/ied206/d774a445f36004d263ab) then untar. Then, patch in tg directory.
patch -p1 < telegram-cli-cygwin.patch
Then
make
After compile is done, **telegram-cli.exe** will be generated in **bin** directory.
To run telegram-cli, type
bin/telegram-cli -k tg-server.pub
**Caution**: A binary compiled with Cygwin should be run in Cygwin Terminal.
================================================
FILE: README-LUA
================================================
To use lua with client you should write lua script. You can specify it from config ("lua_script" option) or from command_line [-s].
It should have several functions:
on_binlog_replay_end() - it is called when replay of old events end. Any updates prior this call were already received by this client
some time ago.
on_get_difference_end() - it is called after first get_difference call. So we received all updates after last client execute.
on_our_id(our_id) - Informs about id of currently logged in user.
on_msg_receive(msg) - it is called when we receive new msg (!! may be called before on_binlog_replay_end, than it is old msg).
on_user_update(user,what_changed) - updated info about user. what_changed is array of strings.
on_chat_update(user,what_changed) - updated info about user. what_changed is array of strings.
on_secret_chat_update(user,what_changed) - updated info about user. what_changed is array of strings.
Also, you can call several functions. Each this function last two arguments, are cb_function and cb_extra.
These functions may return false immidiately if something is bad with args, or return true and call cb_function in future.
cb_function would have two or three arguments: first cb_extra, second success (1 or 0), third result (if applicable).
If you want to pass msg to function, you should pass it's id.
If you want to pass peer to function, you should pass it's print_name.
Or, you can pass string user#id<id> chat#id<id> and secret_chat#id<id> as peer. It is in some cases better. For example if you want to postpone and you are afraid, that print_name would be changed in the meantime.
Function_list (arguments are listed aside from cb_function and cb_extra, :
get_contact_list ()
get_dialog_list ()
rename_chat (chat, new_name)
chat_set_photo (chat, file)
send_typing (peer)
send_typing_abort (peer)
send_msg (peer, text)
fwd_msg (peer, msg)
send_photo (peer, file)
send_video (peer, file)
send_audio (peer, file)
send_document (peer, file)
send_text (peer, file)
load_photo(msg)
load_video(msg)
load_video_thumb(msg)
load_audio(msg)
load_document(msg)
load_document_thumb(msg)
chat_info (chat)
channel_info (channel)
user_info (user)
get_history (peer, limit)
chat_add_user (chat, user)
chat_del_user (chat, user)
add_contact (phone, first_name, last_name)
rename_contact (phone, first_name, last_name)
msg_search (peer, text)
msg_global_search (text)
mark_read (peer)
set_profile_photo (file)
create_secret_chat (user)
create_group_chat (user, name)
delete_msg (msg)
restore_msg (number)
status_online ()
status_offline ()
send_location (peer, latitude, longitude)
Also, you have function
postpone (cb_function, cb_extra, timeout). It will call your cb_function in specified number of seconds (number of seconds may be double).
register_interface_function (name, cb_function, cb_arg, description, arg1_type, arg2_type, ...) adds function to CLI interface
================================================
FILE: README-PY.md
================================================
Python Bindings
====================
All of the functions and methods are executed in the network loop of tg, ***NOT IMMEDIATELY***. What this means is all calls should be considered async, and so there is an optional callback parameter for every function/method as the last parameter. For many uses, you won't care about the return value, so you can leave out the callback. Note there are a few cases where the callback is considered mandatory when the function is considered an information query and has no functionality without returned data. These will explicitly have the callback in the parameter list and will be noted in the description.
You can specify the python script from config ("python_script" option) or from command_line [-Z].
Version Notes
=====================
The python integration is written with Python 2/3 in mind, however, there is a bias to Python 3. Because of this, there are a few caveats:
- I am only testing against Python 2.7, and have no intention to support/test < 2.7 but am more than happy to accept PRs for fixes as long as it does not break 2.7/3
- repr/print of native types is dumbed down for < 2.7.9, I highly recommend using this version or newer. (This is due to a [bug](http://bugs.python.org/issue22023) in python)
TGL Callbacks
=============
Assign python fuctions to the following tgl attributes to set callbacks from TG.
| Callback | Description |
|--------- | ---------------------|
|`tgl.on_binlog_replay_end()` | This is called when replay of old events end. Any updates prior this call were already received by this client some time ago.|
|`tgl.on_get_difference_end()`| This is called after first get_difference call. So we received all updates after last client execute.|
|`tgl.on_our_id(our_id)`|Informs about id of currently logged in user.|
|`tgl.on_msg_receive(msg)`| This is called when we receive new `tgl.Msg` object (*may be called before on_binlog_replay_end, than it is old msg*).|
|`tgl.on_user_update(peer, what_changed)`|updated info about user. peer is a `tgl.Peer` object representing the user, and what_changed is array of strings.|
|`tgl.on_chat_update(peer, what_changed)`|updated info about chat. peer is a `tgl.Peer` object representing the chat, and what_changed is array of strings.|
|`tgl.on_secret_chat_update(peer, what_changed)`|updated info about secret chat. peer is a `tgl.Peer` object representing the secret chat, and what_changed is array of strings.|
Python Callback Signatures
=========================
As mentioned, all methods and functions have callbacks. The following are the different signatures that may be required (*The description of the method will mention which is used*)
| Type | Signature | Description |
|----- | ------------------ | ------------|
|empty_cb|`(success)`|This just indicated the success of the call. All other callback types have this as well.|
|contact_list_cb|`(success, peer_list)`|`peer_list` is a list of `tgl.Peer` objects|
|dialog_list_cb|`(success, dialog_list)`|`dialog_list` is a list of dicts, with keys: 'peer': `tgl.Peer`, 'message': `tgl.Msg`|
|msg_cb|`(success, msg)`|`msg` is a `tgl.Msg`|
|msg_list_cb|`(success, msg_list)`|`msg_list` is a list of `tgl.Msg` objects|
|file_cb|`(success, file_path)`|`file_path` is a string with an absolute path|
|chat_cb|`(success, peer)`|`peer` is a `tgl.Peer` that will have the type of `tgl.PEER_CHAT`|
|peer_cb|`(success, peer)`|`peer` is a `tgl.Peer`|
|secret_chat_cb|`(success, peer)`|`peer` is a `tgl.Peer` that will have the type of `tgl.PEER_ENCR_CHAT`|
|user_cb|`(success, peer)`|`peer` is a `tgl.Peer` that will have the type of `tgl.PEER_USER`|
|str_cb|`(success, string)`|`string` is a simple string|
TGL Module Level Fuctions
=========================
All of these functions are accessed by importing the `tgl` module.
| Function | Description | Callback Type |
|--------- | ---------------------| ------------- |
|`tgl.get_contact_list (callback)`|Retrieve peers stored in the contact list. *requires callback*|`contact_list_cb`|
|`tgl.get_dialog_list (callback)`|Get a list of current conversations with the `tgl.Peer` and the most recent `tgl.Msg`. *requires callback*|`dialog_list_cb`|
|`tgl.add_contact (phone, first_name, last_name)`|Adds contact to contact list, last name is optional|`contact_list_cb`|
|`tgl.del_contact (peer)`|Removes contact from contact list|`empty_cb`|
|`tgl.rename_contact (phone, first_name, last_name) `|Renaming a contact means sending the first/last name with the same phone number of an existing contact|`contact_list_cb`|
|`tgl.msg_global_search (text, callback)`|Get all messages that match the search text. *requires callback*|`msg_list_cb`|
|`tgl.set_profile_photo (file_path)`|Sets avatar to image found at `file_path`, no checking on the file.|`empty_cb`|
|`tgl.create_secret_chat (user)`|Creates secret chat with user, callback recommended to get new peer for the secret chat.|`secret_chat_cb`|
|`tgl.create_group_chat (peer_list, name)`|`peer_list` contains users to create group with, must be more than 1 peer.|`empty_cb`|
|`tgl.restore_msg (msg_id)`|Restore a deleted message by message id.|`empty_cb`|
|`tgl.status_online ()`|Sets status as online|`empty_cb`|
|`tgl.status_offline ()`|Sets status as offline|`empty_cb`|
|`tgl.import_chat_link (link)`|Join channel using the `link`.|`empty_cb`|
|`tgl.safe_exit (exit_status)`|Exception to the rule about callbacks, no callback parameter is accepted. Causes the bot to quit after cleaning up. `exit_status` is an optional parameter with the exit status (On glibc, this must be 0-255)|NONE|
Peer
====
## Attributes
| Attribute | Type | Description |
|---------- | ---- | ----------------------|
|`id`|`int`|Telegram peer id|
|`type`|`int`|Peer type, you can compare this with `tgl.PEER_CHAT`, `tgl.PEER_USER`, or `tgl.PEER_ENCR_CHAT`|
|`type_name`|`string`|Text representation of the type of the peer, `'chat'`, `'user'`, or `'secret_chat'`|
|`name`|`string`|Returns the tg print version of the name. Usually `FirstName_LastName` for user, and the chatname with spaces replaced with `_`|
|`user_id`|`int`|Used in secret chats, since a secret chat has it's own id, this is the id of the user at the endpoint.|
|`user_list`|`peer_list`|Only used in `tgl.PEER_CHAT` peers, contains list of users. This currently does not work, it is not populating properly.|
|`user_status`|`dict`|Only used in `tgl.PEER_USER` peers. Dictionary with the current status, keys: 'online': `bool`, 'when': `datetime`|
|`phone`|`string`|Only used in `tgl.PEER_USER` peers. Phone number, only available if user is on contact list.|
|`username`|`string`|Only used in `tgl.PEER_USER` peers. Will be `None` if username is not set.|
|`first_name`|`string`|Only used in `tgl.PEER_USER` peers.|
|`last_name`|`string`|Only used in `tgl.PEER_USER` peers.|
## Methods
| Method | Description | Callback Type |
|------- | ---------------------| ------------- |
|`peer.rename_chat (new_name)`||`empty_cb`|
|`peer.chat_set_photo (file)`|Sets avatar for the group to image found at `file_path`, no checking on the file. The calling peer must be of type `tgl.PEER_CHAT`.|`msg_cb`|
|`peer.send_typing ()`|Tell peer that you are typing.|`empty_cb`|
|`peer.send_typing_abort ()`|Tell peer you are done typing.|`empty_cb`|
|`peer.send_msg (text, reply=msg_id, preview=bool)`|Sends message to peer. Optional keyword arguments: reply is the message id we are replying to, preview is a boolean that forces URL preview on or off.|`msg_cb`|
|`peer.fwd_msg (msg_id)`|Forwards msg with message id to peer.|`msg_cb`|
|`peer.fwd_media (msg_id)`|Forwards media with message id to peer.|`msg_cb`|
|`peer.send_photo (file)`|Send media to peer using `file`. No checking is done on the contents of the file.|`msg_cb`|
|`peer.send_video (file)`|Send media to peer using `file`. No checking is done on the contents of the file.|`msg_cb`|
|`peer.send_audio (file)`|Send media to peer using `file`. No checking is done on the contents of the file.|`msg_cb`|
|`peer.send_document (file)`|Send media to peer using `file`. No checking is done on the contents of the file.|`msg_cb`|
|`peer.send_text (file)`|Send media to peer using `file`. No checking is done on the contents of the file.|`msg_cb`|
|`peer.send_location (latitude, longitude)`|Sends location media message to peer, `longitude` and `latitude` should be specified as double.|`msg_cb`|
|`peer.chat_add_user (user)`|Adds `user`(`tgl.Peer`) to the group. The calling peer must be of type `tgl.PEER_CHAT`|`empty_cb`|
|`peer.chat_del_user (user)`|Removes `user`(`tgl.Peer`) from the group. The calling peer must be of type `tgl.PEER_CHAT`|`empty_cb`|
|`peer.mark_read ()`|Marks the dialog with the peer as read. This cannot be done on message level.|`empty_cb`|
|`peer.msg_search (text, callback)`|Get all messages that match the search text with the peer. *requires callback*|`msg_list_cb`|
|`peer.get_history (offset, limit, callback)`|Get all messages with the peer. `offset` specifies what message to start at, and `limit` specifies how many messages to retrieve. See example below for one method to get the entire history. *requires callback*|`msg_list_cb`|
|`peer.info ()`|Gets peer info.|`peer_cb`|
Example usage for `peer.get_history`:
```
from functools import partial
history = []
# Get all the history, 100 msgs at a time
peer.get_history(0, 100, partial(history_callback, 100, peer))
def history_callback(msg_count, peer, success, msgs)
history.extend(msgs)
if len(msgs) == msg_count:
peer.get_history(len(history), msg_count, partial(history_callback, msg_count, peer))
```
Msg
====
## Attributes
| Attribute | Type | Description |
|---------- | ---- | ----------------------|
|`id`|`int`|Message id|
|`flags`|`int`|tgl flags, see source code for tgl for various possible flags. This is a bitfield in an int.|
|`mention`|`bool`|`True` if you are @mentioned.|
|`out`|`bool`|`True` if you sent this message.|
|`unread`|`bool`|`True` if you have not marked this as read.|
|`service`|`bool`|`True` if the message is a service messages, see tgl.Msg.action for the type.|
|`src`|`tgl.Peer`|Peer who sent the message|
|`dest`|`tgl.Peer`|Peer who the message was sent too. In a group, this will be the chat peer. Otherwise it will be you.|
|`text`|`string`|Text contents of the message. This may be `None` if it's media without caption.|
|`media`|`dict`|Dictionary that varies based on the media type.|
|`date`|`datetime`|When the message was sent.|
|`fwd_src`|`tgl.Peer`|The user that sent the forwarded message.|
|`fwd_date`|`datetime`|When the forwarded message was originally sent.|
|`reply`|`tgl.Msg`|Message that this message is replying to.|
|`reply_id`|`int`|Message id that this message is replying to.|
|`action`|`int`|Action enum for the message if `msg.service == True`. See all the possible values below|
## Action Type Constants
- tgl.ACTION_NONE
- tgl.ACTION_GEO_CHAT_CREATE
- tgl.ACTION_GEO_CHAT_CHECKIN
- tgl.ACTION_CHAT_CREATE
- tgl.ACTION_CHAT_EDIT_TITLE
- tgl.ACTION_CHAT_EDIT_PHOTO
- tgl.ACTION_CHAT_DELETE_PHOTO
- tgl.ACTION_CHAT_ADD_USER
- tgl.ACTION_CHAT_ADD_USER_BY_LINK
- tgl.ACTION_CHAT_DELETE_USER
- tgl.ACTION_SET_MESSAGE_TTL
- tgl.ACTION_READ_MESSAGES
- tgl.ACTION_DELETE_MESSAGES
- tgl.ACTION_SCREENSHOT_MESSAGES
- tgl.ACTION_FLUSH_HISTORY
- tgl.ACTION_RESEND
- tgl.ACTION_NOTIFY_LAYER
- tgl.ACTION_TYPING
- tgl.ACTION_NOOP
- tgl.ACTION_COMMIT_KEY
- tgl.ACTION_ABORT_KEY
- tgl.ACTION_REQUEST_KEY
- tgl.ACTION_ACCEPT_KEY
## Methods
| Method | Description | Callback Type |
|------- | ---------------------| ------------- |
|`msg.load_photo(callback)`|Saves the media and returns the path to the file in the callback. *requires callback*|`file_cb`|
|`msg.load_video(callback)`|Saves the media and returns the path to the file in the callback. *requires callback*|`file_cb`|
|`msg.load_video_thumb(callback)`|Saves the media and returns the path to the file in the callback. *requires callback*|`file_cb`|
|`msg.load_audio(callback)`|Saves the media and returns the path to the file in the callback. *requires callback*|`file_cb`|
|`msg.load_document(callback)`|Saves the media and returns the path to the file in the callback. *requires callback*|`file_cb`|
|`msg.load_document_thumb(callback)`|Saves the media and returns the path to the file in the callback. *requires callback*|`file_cb`|
|`msg.delete_msg ()`|Deletes the message from the local history|`empty_cb`|
================================================
FILE: README.es
================================================
## Telegram messenger CLI [](https://travis-ci.org/vysheng/tg)
!!!! May be outdated. Please refer to english README as more actual.
Interfaz de línea de comandos para: [Telegram](http://telegram.org). Usa interfaz readline.
### Documentación del API y el protocolo
La documentación del APi de Telegram está disponible aquí: http://core.telegram.org/api
La documentación del protocolo MTproto está disponible aquí: http://core.telegram.org/mtproto
### Instalación
Clona el Repositorio GitHub
$ git clone https://github.com/vysheng/tg.git && cd tg
o descarga y descomprime el zip
$ wget https://github.com/vysheng/tg/archive/master.zip -O tg-master.zip
$ unzip tg-master.zip && cd tg-master
#### Linux
Librerías requeridas: readline openssl y (si desea usar config) libconfig y liblua.
Si no deseas usarlo, pasa las siguientes opciones --disable-libconfig y --disable-liblua respectivamente.
En Ubuntu usa:
$ sudo apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev
En gentoo:
$ sudo emerge -av sys-libs/readline dev-libs/libconfig dev-libs/openssl dev-lang/lua
En Fedora:
$ sudo yum install lua-devel openssl-devel libconfig-devel readline-devel
Por defecto Makefile utiliza liblua5.2 de ubuntu. Si utilizas una versión diferente de liblua o linux, tienes que ejecutar el script ./configure o recibirás un error de compilación extraño.
Entonces
$ ./configure
$ make
#### Mac OS X
El cliente depende de [librería readline](http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html) y [libconfig](http://www.hyperrealm.com/libconfig/), las cuales no están incluídas en OS X por defecto. Debes instalar estas librerías de forma manual, usando por ejemplo [Homebrew](http://brew.sh/).
$ brew install libconfig
$ brew install readline
$ brew install lua
$ export CFLAGS="-I/usr/local/include -I/usr/local/Cellar/readline/6.2.4/include"
$ export LDFLAGS="-L/usr/local/lib -L/usr/local/Cellar/readline/6.2.4/lib"
$ ./configure && make
Gracias a [@jfontan](https://github.com/vysheng/tg/issues/3#issuecomment-28293731) por esta solución.
#### FreeBSD
Instalar estos puertos:
* devel/libconfig
* devel/libexecinfo
Entonces construir:
$ env CC=clang CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./configure
$ make
#### Otros UNIX
Si logras ejecutarlo en otros UNIX, por favor házmelo saber.
### Uso
./telegram -k <clave-servidor-público>
Por defecto la clave pública se almacena en la misma carpeta con el nombre tg-server.pub o en /etc/telegram/server.pub, si no lo es, indica dónde encontrarlo:
./telegram -k tg-server.pub
El Cliente soporta completamiento con TAB e historial de comandos.
Peer se refiere al nombre del contacto o de diálogo y se puede acceder por completamiento con Tab.
Para los contactos de usuario el peer es el Nombre <guión bajo> Apellido con todos los espacios cambiados a guiones bajos.
Para los chats es su título con todos los espacios cambiados a guiones bajos.
Para los chats encriptados es <marca de exclamación> <guión bajo> Nombre <guión bajo> Apellido con todos los espacios cambiados a guiones bajos.
Si dos o más peers tienen el mismo nombre, una almohadilla y un número es añadido al nombre. (por ejemplo A_B,A_B#1,A_B#2 y así sucesivamente).
### Comandos soportados
#### Mensajería
* **msg** \<peer\> texto - envía el mensaje a este usuario.
* **fwd** \<usuario\> \<numero-mensaje\> - reenviar un mensaje al usuario. Puedes ver los número de mensajes iniciando el Cliente con -N.
* **chat_with_peer** \<peer\> - inicia un chat con este usuario. /exit o /quit para salir de este modo.
* **add_contact** \<numero-teléfono\> \<nombre\> \<apellido\> - intenta añadir este contacto a la lista de contactos.
* **rename_contact** \<usuario\> \<nombre\> \<apellido\> - intenta renombrar el contacto. Si tienes otro dispositivo será una pelea.
* **mark_read** \<peer\> - marca todos los mensajes como recibidos de ese usuario.
#### Multimedia
* **send_photo** \<peer\> \<nombre-archivo-foto\> - manda una foto al usuario.
* **send_video** \<peer\> \<nombre-archivo-video\> - envia un video al usuario.
* **send_text** \<peer\> \<nombre-archivo-texto> - envia un archivo de texto como un mensaje en plano.
* **load_photo**/load_video/load_video_thumb \<numero-mensaje\> - carga foto/video indicado del directorio de descarga.
* **view_photo**/view_video/view_video_thumb \<numero-mensaje\> - carga foto/video indicado del directorio de descarga y lo abre con el visor por defecto del sistema.
#### Opciones de chat de grupo
* **chat_info** \<chat\> - imprime información del chat.
* **chat_add_user** \<chat\> \<usuario\> - agrega un usuario al chat.
* **chat_del_user** \<chat\> \<usuario\> - elimina un usuario del chat.
* **rename_chat** \<chat\> \<nuevo-nombre\> - cambia el nombre al chat.
#### Search
* **search** \<peer\> patrón - busca el patrón indicado en los mensajes con ese usuario.
* **global_search** patrón - busca el patrón indicado en todos los mensajes.
#### Chat secreto
* **create_secret_chat** \<user\> - crea un chat secreto con el usuario indicado.
* **visualize_key** \<secret_chat\> - Muestra la clave de cifrado. Debes compararla con la del otro usuario.
#### Estadísticas e información varia.
* **user_info** \<user\> - muestra información sobre el usuario.
* **history** \<peer\> [limit] - muestra el historial (y la marca como leído). Limite por defecto = 40.
* **dialog_list** - muestra información acerca del dialogo
* **contact_list** - muestra información acerca de tu lista de contactos.
* **suggested_contacts** - muestra información sobre sus contactos, tiene un máximo de amigos comunes.
* **stats** - solo para depuración.
* **show_license** - muestra la licencia GPLv2.
* **help** - imprime esta ayuda.
================================================
FILE: README.md
================================================
## Telegram messenger CLI [](https://travis-ci.org/vysheng/tg)
Command-line interface for [Telegram](http://telegram.org). Uses readline interface.
### API, Protocol documentation
Documentation for Telegram API is available here: http://core.telegram.org/api
Documentation for MTproto protocol is available here: http://core.telegram.org/mtproto
### Upgrading to version 1.0
First of all, the binary is now in ./bin folder and is named telegram-cli. So be careful, not to use old binary.
Second, config folder is now ${HOME}/.telegram-cli
Third, database is not compatible with older versions, so you'll have to login again.
Fourth, in peer_name '#' are substitued to '@'. (Not applied to appending of '#%d' in case of two peers having same name).
### Installation
Clone GitHub Repository
git clone --recursive https://github.com/vysheng/tg.git && cd tg
### Python Support
Python support is currently limited to Python 2.7 or Python 3.1+. Other versions may work but are not tested.
#### Linux and BSDs
Install libs: readline, openssl and (if you want to use config) libconfig, liblua, python and libjansson.
If you do not want to use them pass options --disable-libconfig, --disable-liblua, --disable-python and --disable-json respectively.
On Ubuntu/Debian use:
sudo apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev libjansson-dev libpython-dev make
On gentoo:
sudo emerge -av sys-libs/readline dev-libs/libconfig dev-libs/openssl dev-lang/lua dev-libs/libevent dev-libs/jansson dev-lang/python
On Fedora:
sudo dnf install lua-devel openssl-devel libconfig-devel readline-devel libevent-devel libjansson-devel python-devel
On Archlinux:
yaourt -S telegram-cli-git
On FreeBSD:
pkg install libconfig libexecinfo lua52 python
On OpenBSD:
pkg_add libconfig libexecinfo lua python
On openSUSE:
sudo zypper in lua-devel libconfig-devel readline-devel libevent-devel libjansson-devel python-devel libopenssl-devel
Then,
./configure
make
#### Other methods to install on linux
On Gentoo: use ebuild provided.
On Arch: https://aur.archlinux.org/packages/telegram-cli-git
#### Mac OS X
The client depends on [readline library](http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html) and [libconfig](http://www.hyperrealm.com/libconfig/), which are not included in OS X by default. You have to install these libraries manually.
If using [Homebrew](http://brew.sh/):
brew install libconfig readline lua python libevent jansson
export CFLAGS="-I/usr/local/include -I/usr/local/Cellar/readline/6.3.8/include"
export LDFLAGS="-L/usr/local/lib -L/usr/local/Cellar/readline/6.3.8/lib"
./configure && make
Thanks to [@jfontan](https://github.com/vysheng/tg/issues/3#issuecomment-28293731) for this solution.
If using [MacPorts](https://www.macports.org):
sudo port install libconfig-hr
sudo port install readline
sudo port install lua51
sudo port install python34
sudo port install libevent
export CFLAGS="-I/usr/local/include -I/opt/local/include -I/opt/local/include/lua-5.1"
export LDFLAGS="-L/usr/local/lib -L/opt/local/lib -L/opt/local/lib/lua-5.1"
./configure && make
Install these ports:
* devel/libconfig
* devel/libexecinfo
* lang/lua52
Then build:
env CC=clang CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib LUA=/usr/local/bin/lua52 LUA_INCLUDE=-I/usr/local/include/lua52 LUA_LIB=-llua-5.2 ./configure
make
#### Other UNIX
If you manage to launch it on other UNIX, please let me know.
### 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
### Usage
bin/telegram-cli -k <public-server-key>
By default, the public key is stored in tg-server.pub in the same folder or in /etc/telegram-cli/server.pub. If not, specify where to find it:
bin/telegram-cli -k tg-server.pub
Client support TAB completion and command history.
Peer refers to the name of the contact or dialog and can be accessed by TAB completion.
For user contacts peer name is Name <underscore> Lastname with all spaces changed to underscores.
For chats it is it's title with all spaces changed to underscores
For encrypted chats it is <Exсlamation mark> <underscore> Name <underscore> Lastname with all spaces changed to underscores.
If two or more peers have same name, <sharp>number is appended to the name. (for example A_B, A_B#1, A_B#2 and so on)
### Supported commands
#### Messaging
* **msg** \<peer\> Text - sends message to this peer
* **fwd** \<user\> \<msg-seqno\> - forward message to user. You can see message numbers starting client with -N
* **chat_with_peer** \<peer\> starts one on one chat session with this peer. /exit or /quit to end this mode.
* **add_contact** \<phone-number\> \<first-name\> \<last-name\> - tries to add contact to contact-list by phone
* **rename_contact** \<user\> \<first-name\> \<last-name\> - tries to rename contact. If you have another device it will be a fight
* **mark_read** \<peer\> - mark read all received messages with peer
* **delete_msg** \<msg-seqno\> - deletes message (not completly, though)
* **restore_msg** \<msg-seqno\> - restores delete message. Impossible for secret chats. Only possible short time (one hour, I think) after deletion
#### Multimedia
* **send_photo** \<peer\> \<photo-file-name\> - sends photo to peer
* **send_video** \<peer\> \<video-file-name\> - sends video to peer
* **send_text** \<peer\> \<text-file-name> - sends text file as plain messages
* **load_photo**/load_video/load_video_thumb/load_audio/load_document/load_document_thumb \<msg-seqno\> - loads photo/video/audio/document to download dir
* **view_photo**/view_video/view_video_thumb/view_audio/view_document/view_document_thumb \<msg-seqno\> - loads photo/video to download dir and starts system default viewer
* **fwd_media** \<msg-seqno\> send media in your message. Use this to prevent sharing info about author of media (though, it is possible to determine user_id from media itself, it is not possible get access_hash of this user)
* **set_profile_photo** \<photo-file-name\> - sets userpic. Photo should be square, or server will cut biggest central square part
#### Group chat options
* **chat_info** \<chat\> - prints info about chat
* **chat_add_user** \<chat\> \<user\> - add user to chat
* **chat_del_user** \<chat\> \<user\> - remove user from chat
* **rename_chat** \<chat\> \<new-name\>
* **create_group_chat** \<chat topic\> \<user1\> \<user2\> \<user3\> ... - creates a groupchat with users, use chat_add_user to add more users
* **chat_set_photo** \<chat\> \<photo-file-name\> - sets group chat photo. Same limits as for profile photos.
#### Search
* **search** \<peer\> pattern - searches pattern in messages with peer
* **global_search** pattern - searches pattern in all messages
#### Secret chat
* **create_secret_chat** \<user\> - creates secret chat with this user
* **visualize_key** \<secret_chat\> - prints visualization of encryption key. You should compare it to your partner's one
* **set_ttl** \<secret_chat\> \<ttl\> - sets ttl to secret chat. Though client does ignore it, client on other end can make use of it
* **accept_secret_chat** \<secret_chat\> - manually accept secret chat (only useful when starting with -E key)
#### Stats and various info
* **user_info** \<user\> - prints info about user
* **history** \<peer\> [limit] - prints history (and marks it as read). Default limit = 40
* **dialog_list** - prints info about your dialogs
* **contact_list** - prints info about users in your contact list
* **suggested_contacts** - print info about contacts, you have max common friends
* **stats** - just for debugging
* **show_license** - prints contents of GPLv2
* **help** - prints this help
* **get_self** - get our user info
#### Card
* **export_card** - print your 'card' that anyone can later use to import your contact
* **import_card** \<card\> - gets user by card. You can write messages to him after that.
#### Other
* **quit** - quit
* **safe_quit** - wait for all queries to end then quit
================================================
FILE: ax_lua.m4
================================================
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_lua.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_PROG_LUA[([MINIMUM-VERSION], [TOO-BIG-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])]
# AX_LUA_HEADERS[([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])]
# AX_LUA_LIBS[([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])]
# AX_LUA_READLINE[([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])]
#
# DESCRIPTION
#
# Detect a Lua interpreter, optionally specifying a minimum and maximum
# version number. Set up important Lua paths, such as the directories in
# which to install scripts and modules (shared libraries).
#
# Also detect Lua headers and libraries. The Lua version contained in the
# header is checked to match the Lua interpreter version exactly. When
# searching for Lua libraries, the version number is used as a suffix.
# This is done with the goal of supporting multiple Lua installs (5.1 and
# 5.2 side-by-side).
#
# A note on compatibility with previous versions: This file has been
# mostly rewritten for serial 18. Most developers should be able to use
# these macros without needing to modify configure.ac. Care has been taken
# to preserve each macro's behavior, but there are some differences:
#
# 1) AX_WITH_LUA is deprecated; it now expands to the exact same thing as
# AX_PROG_LUA with no arguments.
#
# 2) AX_LUA_HEADERS now checks that the version number defined in lua.h
# matches the interpreter version. AX_LUA_HEADERS_VERSION is therefore
# unnecessary, so it is deprecated and does not expand to anything.
#
# 3) The configure flag --with-lua-suffix no longer exists; the user
# should instead specify the LUA precious variable on the command line.
# See the AX_PROG_LUA description for details.
#
# Please read the macro descriptions below for more information.
#
# This file was inspired by Andrew Dalke's and James Henstridge's
# python.m4 and Tom Payne's, Matthieu Moy's, and Reuben Thomas's ax_lua.m4
# (serial 17). Basically, this file is a mash-up of those two files. I
# like to think it combines the best of the two!
#
# AX_PROG_LUA: Search for the Lua interpreter, and set up important Lua
# paths. Adds precious variable LUA, which may contain the path of the Lua
# interpreter. If LUA is blank, the user's path is searched for an
# suitable interpreter.
#
# If MINIMUM-VERSION is supplied, then only Lua interpreters with a
# version number greater or equal to MINIMUM-VERSION will be accepted. If
# TOO-BIG- VERSION is also supplied, then only Lua interpreters with a
# version number greater or equal to MINIMUM-VERSION and less than
# TOO-BIG-VERSION will be accepted.
#
# Version comparisons require the AX_COMPARE_VERSION macro, which is
# provided by ax_compare_version.m4 from the Autoconf Archive.
#
# The Lua version number, LUA_VERSION, is found from the interpreter, and
# substituted. LUA_PLATFORM is also found, but not currently supported (no
# standard representation).
#
# Finally, the macro finds four paths:
#
# luadir Directory to install Lua scripts.
# pkgluadir $luadir/$PACKAGE
# luaexecdir Directory to install Lua modules.
# pkgluaexecdir $luaexecdir/$PACKAGE
#
# These paths a found based on $prefix, $exec_prefix, Lua's package.path,
# and package.cpath. The first path of package.path beginning with $prefix
# is selected as luadir. The first path of package.cpath beginning with
# $exec_prefix is used as luaexecdir. This should work on all reasonable
# Lua installations. If a path cannot be determined, a default path is
# used. Of course, the user can override these later when invoking make.
#
# luadir Default: $prefix/share/lua/$LUA_VERSION
# luaexecdir Default: $exec_prefix/lib/lua/$LUA_VERSION
#
# These directories can be used by Automake as install destinations. The
# variable name minus 'dir' needs to be used as a prefix to the
# appropriate Automake primary, e.g. lua_SCRIPS or luaexec_LIBRARIES.
#
# If an acceptable Lua interpreter is found, then ACTION-IF-FOUND is
# performed, otherwise ACTION-IF-NOT-FOUND is preformed. If ACTION-IF-NOT-
# FOUND is blank, then it will default to printing an error. To prevent
# the default behavior, give ':' as an action.
#
# AX_LUA_HEADERS: Search for Lua headers. Requires that AX_PROG_LUA be
# expanded before this macro. Adds precious variable LUA_INCLUDE, which
# may contain Lua specific include flags, e.g. -I/usr/include/lua5.1. If
# LUA_INCLUDE is blank, then this macro will attempt to find suitable
# flags.
#
# LUA_INCLUDE can be used by Automake to compile Lua modules or
# executables with embedded interpreters. The *_CPPFLAGS variables should
# be used for this purpose, e.g. myprog_CPPFLAGS = $(LUA_INCLUDE).
#
# This macro searches for the header lua.h (and others). The search is
# performed with a combination of CPPFLAGS, CPATH, etc, and LUA_INCLUDE.
# If the search is unsuccessful, then some common directories are tried.
# If the headers are then found, then LUA_INCLUDE is set accordingly.
#
# The paths automatically searched are:
#
# * /usr/include/luaX.Y
# * /usr/include/lua/X.Y
# * /usr/include/luaXY
# * /usr/local/include/luaX.Y
# * /usr/local/include/lua-X.Y
# * /usr/local/include/lua/X.Y
# * /usr/local/include/luaXY
#
# (Where X.Y is the Lua version number, e.g. 5.1.)
#
# The Lua version number found in the headers is always checked to match
# the Lua interpreter's version number. Lua headers with mismatched
# version numbers are not accepted.
#
# If headers are found, then ACTION-IF-FOUND is performed, otherwise
# ACTION-IF-NOT-FOUND is performed. If ACTION-IF-NOT-FOUND is blank, then
# it will default to printing an error. To prevent the default behavior,
# set the action to ':'.
#
# AX_LUA_LIBS: Search for Lua libraries. Requires that AX_PROG_LUA be
# expanded before this macro. Adds precious variable LUA_LIB, which may
# contain Lua specific linker flags, e.g. -llua5.1. If LUA_LIB is blank,
# then this macro will attempt to find suitable flags.
#
# LUA_LIB can be used by Automake to link Lua modules or executables with
# embedded interpreters. The *_LIBADD and *_LDADD variables should be used
# for this purpose, e.g. mymod_LIBADD = $(LUA_LIB).
#
# This macro searches for the Lua library. More technically, it searches
# for a library containing the function lua_load. The search is performed
# with a combination of LIBS, LIBRARY_PATH, and LUA_LIB.
#
# If the search determines that some linker flags are missing, then those
# flags will be added to LUA_LIB.
#
# If libraries are found, then ACTION-IF-FOUND is performed, otherwise
# ACTION-IF-NOT-FOUND is performed. If ACTION-IF-NOT-FOUND is blank, then
# it will default to printing an error. To prevent the default behavior,
# set the action to ':'.
#
# AX_LUA_READLINE: Search for readline headers and libraries. Requires the
# AX_LIB_READLINE macro, which is provided by ax_lib_readline.m4 from the
# Autoconf Archive.
#
# If a readline compatible library is found, then ACTION-IF-FOUND is
# performed, otherwise ACTION-IF-NOT-FOUND is performed.
#
# LICENSE
#
# Copyright (c) 2013 Tim Perkins <tprk77@gmail.com>
# Copyright (c) 2013 Reuben Thomas <rrt@sc3d.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 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf 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 21
dnl =========================================================================
dnl AX_PROG_LUA([MINIMUM-VERSION], [TOO-BIG-VERSION],
dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl =========================================================================
AC_DEFUN([AX_PROG_LUA],
[
dnl Make LUA a precious variable.
AC_ARG_VAR([LUA], [The Lua interpreter, e.g. /usr/bin/lua5.1])
dnl Find a Lua interpreter.
m4_define_default([_AX_LUA_INTERPRETER_LIST],
[lua lua5.2 lua52 lua5.1 lua51 lua50])
m4_if([$1], [],
[ dnl No version check is needed. Find any Lua interpreter.
AS_IF([test "x$LUA" = 'x'],
[AC_PATH_PROGS([LUA], [_AX_LUA_INTERPRETER_LIST], [:])])
ax_display_LUA='lua'
dnl At least check if this is a Lua interpreter.
AC_MSG_CHECKING([if $LUA is a Lua interpreter])
_AX_LUA_CHK_IS_INTRP([$LUA],
[AC_MSG_RESULT([yes])],
[ AC_MSG_RESULT([no])
AC_MSG_ERROR([not a Lua interpreter])
])
],
[ dnl A version check is needed.
AS_IF([test "x$LUA" != 'x'],
[ dnl Check if this is a Lua interpreter.
AC_MSG_CHECKING([if $LUA is a Lua interpreter])
_AX_LUA_CHK_IS_INTRP([$LUA],
[AC_MSG_RESULT([yes])],
[ AC_MSG_RESULT([no])
AC_MSG_ERROR([not a Lua interpreter])
])
dnl Check the version.
m4_if([$2], [],
[_ax_check_text="whether $LUA version >= $1"],
[_ax_check_text="whether $LUA version >= $1, < $2"])
AC_MSG_CHECKING([$_ax_check_text])
_AX_LUA_CHK_VER([$LUA], [$1], [$2],
[AC_MSG_RESULT([yes])],
[ AC_MSG_RESULT([no])
AC_MSG_ERROR([version is out of range for specified LUA])])
ax_display_LUA=$LUA
],
[ dnl Try each interpreter until we find one that satisfies VERSION.
m4_if([$2], [],
[_ax_check_text="for a Lua interpreter with version >= $1"],
[_ax_check_text="for a Lua interpreter with version >= $1, < $2"])
AC_CACHE_CHECK([$_ax_check_text],
[ax_cv_pathless_LUA],
[ for ax_cv_pathless_LUA in _AX_LUA_INTERPRETER_LIST none; do
test "x$ax_cv_pathless_LUA" = 'xnone' && break
_AX_LUA_CHK_IS_INTRP([$ax_cv_pathless_LUA], [], [continue])
_AX_LUA_CHK_VER([$ax_cv_pathless_LUA], [$1], [$2], [break])
done
])
dnl Set $LUA to the absolute path of $ax_cv_pathless_LUA.
AS_IF([test "x$ax_cv_pathless_LUA" = 'xnone'],
[LUA=':'],
[AC_PATH_PROG([LUA], [$ax_cv_pathless_LUA])])
ax_display_LUA=$ax_cv_pathless_LUA
])
])
AS_IF([test "x$LUA" = 'x:'],
[ dnl Run any user-specified action, or abort.
m4_default([$4], [AC_MSG_ERROR([cannot find suitable Lua interpreter])])
],
[ dnl Query Lua for its version number.
AC_CACHE_CHECK([for $ax_display_LUA version], [ax_cv_lua_version],
[ ax_cv_lua_version=`$LUA -e "print(_VERSION)" | \
sed "s|^Lua \(.*\)|\1|" | \
grep -E -o "^@<:@0-9@:>@+\.@<:@0-9@:>@+"`
])
AS_IF([test "x$ax_cv_lua_version" = 'x'],
[AC_MSG_ERROR([invalid Lua version number])])
AC_SUBST([LUA_VERSION], [$ax_cv_lua_version])
AC_SUBST([LUA_SHORT_VERSION], [`echo "$LUA_VERSION" | sed 's|\.||'`])
dnl The following check is not supported:
dnl At times (like when building shared libraries) you may want to know
dnl which OS platform Lua thinks this is.
AC_CACHE_CHECK([for $ax_display_LUA platform], [ax_cv_lua_platform],
[ax_cv_lua_platform=`$LUA -e "print('unknown')"`])
AC_SUBST([LUA_PLATFORM], [$ax_cv_lua_platform])
dnl Use the values of $prefix and $exec_prefix for the corresponding
dnl values of LUA_PREFIX and LUA_EXEC_PREFIX. These are made distinct
dnl variables so they can be overridden if need be. However, the general
dnl consensus is that you shouldn't need this ability.
AC_SUBST([LUA_PREFIX], ['${prefix}'])
AC_SUBST([LUA_EXEC_PREFIX], ['${exec_prefix}'])
dnl Lua provides no way to query the script directory, and instead
dnl provides LUA_PATH. However, we should be able to make a safe educated
dnl guess. If the built-in search path contains a directory which is
dnl prefixed by $prefix, then we can store scripts there. The first
dnl matching path will be used.
AC_CACHE_CHECK([for $ax_display_LUA script directory],
[ax_cv_lua_luadir],
[ AS_IF([test "x$prefix" = 'xNONE'],
[ax_lua_prefix=$ac_default_prefix],
[ax_lua_prefix=$prefix])
dnl Initialize to the default path.
ax_cv_lua_luadir="$LUA_PREFIX/share/lua/$LUA_VERSION"
dnl Try to find a path with the prefix.
_AX_LUA_FND_PRFX_PTH([$LUA], [$ax_lua_prefix], [package.path])
AS_IF([test "x$ax_lua_prefixed_path" != 'x'],
[ dnl Fix the prefix.
_ax_strip_prefix=`echo "$ax_lua_prefix" | sed 's|.|.|g'`
ax_cv_lua_luadir=`echo "$ax_lua_prefixed_path" | \
sed "s,^$_ax_strip_prefix,$LUA_PREFIX,"`
])
])
AC_SUBST([luadir], [$ax_cv_lua_luadir])
AC_SUBST([pkgluadir], [\${luadir}/$PACKAGE])
dnl Lua provides no way to query the module directory, and instead
dnl provides LUA_PATH. However, we should be able to make a safe educated
dnl guess. If the built-in search path contains a directory which is
dnl prefixed by $exec_prefix, then we can store modules there. The first
dnl matching path will be used.
AC_CACHE_CHECK([for $ax_display_LUA module directory],
[ax_cv_lua_luaexecdir],
[ AS_IF([test "x$exec_prefix" = 'xNONE'],
[ax_lua_exec_prefix=$ax_lua_prefix],
[ax_lua_exec_prefix=$exec_prefix])
dnl Initialize to the default path.
ax_cv_lua_luaexecdir="$LUA_EXEC_PREFIX/lib/lua/$LUA_VERSION"
dnl Try to find a path with the prefix.
_AX_LUA_FND_PRFX_PTH([$LUA],
[$ax_lua_exec_prefix], [package.cpathd])
AS_IF([test "x$ax_lua_prefixed_path" != 'x'],
[ dnl Fix the prefix.
_ax_strip_prefix=`echo "$ax_lua_exec_prefix" | sed 's|.|.|g'`
ax_cv_lua_luaexecdir=`echo "$ax_lua_prefixed_path" | \
sed "s,^$_ax_strip_prefix,$LUA_EXEC_PREFIX,"`
])
])
AC_SUBST([luaexecdir], [$ax_cv_lua_luaexecdir])
AC_SUBST([pkgluaexecdir], [\${luaexecdir}/$PACKAGE])
dnl Run any user specified action.
$3
])
])
dnl AX_WITH_LUA is now the same thing as AX_PROG_LUA.
AC_DEFUN([AX_WITH_LUA],
[
AC_MSG_WARN([[$0 is deprecated, please use AX_PROG_LUA]])
AX_PROG_LUA
])
dnl =========================================================================
dnl _AX_LUA_CHK_IS_INTRP(PROG, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
dnl =========================================================================
AC_DEFUN([_AX_LUA_CHK_IS_INTRP],
[
dnl Just print _VERSION because all Lua interpreters have this global.
AS_IF([$1 -e "print('Hello ' .. _VERSION .. '!')" &>/dev/null],
[$2], [$3])
])
dnl =========================================================================
dnl _AX_LUA_CHK_VER(PROG, MINIMUM-VERSION, [TOO-BIG-VERSION],
dnl [ACTION-IF-TRUE], [ACTION-IF-FALSE])
dnl =========================================================================
AC_DEFUN([_AX_LUA_CHK_VER],
[
_ax_test_ver=`$1 -e "print(_VERSION)" 2>/dev/null | \
sed "s|^Lua \(.*\)|\1|" | grep -E -o "^@<:@0-9@:>@+\.@<:@0-9@:>@+"`
AS_IF([test "x$_ax_test_ver" = 'x'],
[_ax_test_ver='0'])
AX_COMPARE_VERSION([$_ax_test_ver], [ge], [$2])
m4_if([$3], [], [],
[ AS_IF([$ax_compare_version],
[AX_COMPARE_VERSION([$_ax_test_ver], [lt], [$3])])
])
AS_IF([$ax_compare_version], [$4], [$5])
])
dnl =========================================================================
dnl _AX_LUA_FND_PRFX_PTH(PROG, PREFIX, LUA-PATH-VARIABLE)
dnl =========================================================================
AC_DEFUN([_AX_LUA_FND_PRFX_PTH],
[
dnl Invokes the Lua interpreter PROG to print the path variable
dnl LUA-PATH-VARIABLE, usually package.path or package.cpath. Paths are
dnl then matched against PREFIX. The first path to begin with PREFIX is set
dnl to ax_lua_prefixed_path.
ax_lua_prefixed_path=''
_ax_package_paths=`$1 -e 'print($3)' 2>/dev/null | sed 's|;|\n|g'`
dnl Try the paths in order, looking for the prefix.
for _ax_package_path in $_ax_package_paths; do
dnl Copy the path, up to the use of a Lua wildcard.
_ax_path_parts=`echo "$_ax_package_path" | sed 's|/|\n|g'`
_ax_reassembled=''
for _ax_path_part in $_ax_path_parts; do
echo "$_ax_path_part" | grep '\?' >/dev/null && break
_ax_reassembled="$_ax_reassembled/$_ax_path_part"
done
dnl Check the path against the prefix.
_ax_package_path=$_ax_reassembled
if echo "$_ax_package_path" | grep "^$2" >/dev/null; then
dnl Found it.
ax_lua_prefixed_path=$_ax_package_path
break
fi
done
])
dnl =========================================================================
dnl AX_LUA_HEADERS([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl =========================================================================
AC_DEFUN([AX_LUA_HEADERS],
[
dnl Check for LUA_VERSION.
AC_MSG_CHECKING([if LUA_VERSION is defined])
AS_IF([test "x$LUA_VERSION" != 'x'],
[AC_MSG_RESULT([yes])],
[ AC_MSG_RESULT([no])
AC_MSG_ERROR([cannot check Lua headers without knowing LUA_VERSION])
])
dnl Make LUA_INCLUDE a precious variable.
AC_ARG_VAR([LUA_INCLUDE], [The Lua includes, e.g. -I/usr/include/lua5.1])
dnl Some default directories to search.
LUA_SHORT_VERSION=`echo "$LUA_VERSION" | sed 's|\.||'`
m4_define_default([_AX_LUA_INCLUDE_LIST],
[ /usr/include/lua$LUA_VERSION \
/usr/include/lua/$LUA_VERSION \
/usr/include/lua$LUA_SHORT_VERSION \
/usr/local/include/lua$LUA_VERSION \
/usr/local/include/lua-$LUA_VERSION \
/usr/local/include/lua/$LUA_VERSION \
/usr/local/include/lua$LUA_SHORT_VERSION \
])
dnl Try to find the headers.
_ax_lua_saved_cppflags=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $LUA_INCLUDE"
AC_CHECK_HEADERS([lua.h lualib.h lauxlib.h luaconf.h])
CPPFLAGS=$_ax_lua_saved_cppflags
dnl Try some other directories if LUA_INCLUDE was not set.
AS_IF([test "x$LUA_INCLUDE" = 'x' &&
test "x$ac_cv_header_lua_h" != 'xyes'],
[ dnl Try some common include paths.
for _ax_include_path in _AX_LUA_INCLUDE_LIST; do
test ! -d "$_ax_include_path" && continue
AC_MSG_CHECKING([for Lua headers in])
AC_MSG_RESULT([$_ax_include_path])
AS_UNSET([ac_cv_header_lua_h])
AS_UNSET([ac_cv_header_lualib_h])
AS_UNSET([ac_cv_header_lauxlib_h])
AS_UNSET([ac_cv_header_luaconf_h])
_ax_lua_saved_cppflags=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -I$_ax_include_path"
AC_CHECK_HEADERS([lua.h lualib.h lauxlib.h luaconf.h])
CPPFLAGS=$_ax_lua_saved_cppflags
AS_IF([test "x$ac_cv_header_lua_h" = 'xyes'],
[ LUA_INCLUDE="-I$_ax_include_path"
break
])
done
])
AS_IF([test "x$ac_cv_header_lua_h" = 'xyes'],
[ dnl Make a program to print LUA_VERSION defined in the header.
dnl TODO This probably shouldn't be a runtime test.
AC_CACHE_CHECK([for Lua header version],
[ax_cv_lua_header_version],
[ _ax_lua_saved_cppflags=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $LUA_INCLUDE"
AC_RUN_IFELSE(
[ AC_LANG_SOURCE([[
#include <lua.h>
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char ** argv)
{
if(argc > 1) printf("%s", LUA_VERSION);
exit(EXIT_SUCCESS);
}
]])
],
[ ax_cv_lua_header_version=`./conftest$EXEEXT p | \
sed "s|^Lua \(.*\)|\1|" | \
grep -E -o "^@<:@0-9@:>@+\.@<:@0-9@:>@+"`
],
[ax_cv_lua_header_version='unknown'])
CPPFLAGS=$_ax_lua_saved_cppflags
])
dnl Compare this to the previously found LUA_VERSION.
AC_MSG_CHECKING([if Lua header version matches $LUA_VERSION])
AS_IF([test "x$ax_cv_lua_header_version" = "x$LUA_VERSION"],
[ AC_MSG_RESULT([yes])
ax_header_version_match='yes'
],
[ AC_MSG_RESULT([no])
ax_header_version_match='no'
])
])
dnl Was LUA_INCLUDE specified?
AS_IF([test "x$ax_header_version_match" != 'xyes' &&
test "x$LUA_INCLUDE" != 'x'],
[AC_MSG_ERROR([cannot find headers for specified LUA_INCLUDE])])
dnl Test the final result and run user code.
AS_IF([test "x$ax_header_version_match" = 'xyes'], [$1],
[m4_default([$2], [AC_MSG_ERROR([cannot find Lua includes])])])
])
dnl AX_LUA_HEADERS_VERSION no longer exists, use AX_LUA_HEADERS.
AC_DEFUN([AX_LUA_HEADERS_VERSION],
[
AC_MSG_WARN([[$0 is deprecated, please use AX_LUA_HEADERS]])
])
dnl =========================================================================
dnl AX_LUA_LIBS([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl =========================================================================
AC_DEFUN([AX_LUA_LIBS],
[
dnl TODO Should this macro also check various -L flags?
dnl Check for LUA_VERSION.
AC_MSG_CHECKING([if LUA_VERSION is defined])
AS_IF([test "x$LUA_VERSION" != 'x'],
[AC_MSG_RESULT([yes])],
[ AC_MSG_RESULT([no])
AC_MSG_ERROR([cannot check Lua libs without knowing LUA_VERSION])
])
dnl Make LUA_LIB a precious variable.
AC_ARG_VAR([LUA_LIB], [The Lua library, e.g. -llua5.1])
AS_IF([test "x$LUA_LIB" != 'x'],
[ dnl Check that LUA_LIBS works.
_ax_lua_saved_libs=$LIBS
LIBS="$LIBS $LUA_LIB"
AC_SEARCH_LIBS([lua_load], [],
[_ax_found_lua_libs='yes'],
[_ax_found_lua_libs='no'])
LIBS=$_ax_lua_saved_libs
dnl Check the result.
AS_IF([test "x$_ax_found_lua_libs" != 'xyes'],
[AC_MSG_ERROR([cannot find libs for specified LUA_LIB])])
],
[ dnl First search for extra libs.
_ax_lua_extra_libs=''
_ax_lua_saved_libs=$LIBS
LIBS="$LIBS $LUA_LIB"
AC_SEARCH_LIBS([exp], [m])
AC_SEARCH_LIBS([dlopen], [dl])
LIBS=$_ax_lua_saved_libs
AS_IF([test "x$ac_cv_search_exp" != 'xno' &&
test "x$ac_cv_search_exp" != 'xnone required'],
[_ax_lua_extra_libs="$_ax_lua_extra_libs $ac_cv_search_exp"])
AS_IF([test "x$ac_cv_search_dlopen" != 'xno' &&
test "x$ac_cv_search_dlopen" != 'xnone required'],
[_ax_lua_extra_libs="$_ax_lua_extra_libs $ac_cv_search_dlopen"])
dnl Try to find the Lua libs.
_ax_lua_saved_libs=$LIBS
LIBS="$LIBS $LUA_LIB"
AC_SEARCH_LIBS([lua_load],
[ lua$LUA_VERSION \
lua$LUA_SHORT_VERSION \
lua-$LUA_VERSION \
lua-$LUA_SHORT_VERSION \
lua],
[_ax_found_lua_libs='yes'],
[_ax_found_lua_libs='no'],
[$_ax_lua_extra_libs])
LIBS=$_ax_lua_saved_libs
AS_IF([test "x$ac_cv_search_lua_load" != 'xno' &&
test "x$ac_cv_search_lua_load" != 'xnone required'],
[LUA_LIB="$ac_cv_search_lua_load $_ax_lua_extra_libs"])
])
dnl Test the result and run user code.
AS_IF([test "x$_ax_found_lua_libs" = 'xyes'], [$1],
[m4_default([$2], [AC_MSG_ERROR([cannot find Lua libs])])])
])
dnl =========================================================================
dnl AX_LUA_READLINE([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl =========================================================================
AC_DEFUN([AX_LUA_READLINE],
[
AX_LIB_READLINE
AS_IF([test "x$ac_cv_header_readline_readline_h" != 'x' &&
test "x$ac_cv_header_readline_history_h" != 'x'],
[ LUA_LIBS_CFLAGS="-DLUA_USE_READLINE $LUA_LIBS_CFLAGS"
$1
],
[$2])
])
================================================
FILE: ax_python.m4
================================================
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_python.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_PYTHON
#
# DESCRIPTION
#
# This macro does a complete Python development environment check.
#
# It recurses through several python versions (from 2.1 to 2.6 in this
# version), looking for an executable. When it finds an executable, it
# looks to find the header files and library.
#
# It sets PYTHON_BIN to the name of the python executable,
# PYTHON_INCLUDE_DIR to the directory holding the header files, and
# PYTHON_LIB to the name of the Python library.
#
# This macro calls AC_SUBST on PYTHON_BIN (via AC_CHECK_PROG),
# PYTHON_INCLUDE_DIR and PYTHON_LIB.
#
# LICENSE
#
# Copyright (c) 2008 Michael Tindal
#
# 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
AC_DEFUN([AX_PYTHON],
[AC_MSG_CHECKING(for python build information)
AC_MSG_RESULT([])
for python in python3.5 python3.4 python3.3 python3.2 python3.1 python3 python2.7 python2.6 python2 python; do
AC_CHECK_PROGS(PYTHON_BIN, [$python])
ax_python_bin=$PYTHON_BIN
if test x$ax_python_bin != x; then
AC_CHECK_LIB($ax_python_bin, main, ax_python_lib=$ax_python_bin, ax_python_lib=no)
if test x$ax_python_lib == xno; then
AC_CHECK_LIB(${ax_python_bin}m, main, ax_python_lib=${ax_python_bin}m, ax_python_lib=no)
fi
if test x$ax_python_lib == xno; then
AC_CHECK_LIB(${ax_python_bin}mu, main, ax_python_lib=${ax_python_bin}mu, ax_python_lib=no)
fi
if test x$ax_python_lib != xno; then
ax_python_header=`$ax_python_bin -c "from distutils.sysconfig import *; print(get_config_var('CONFINCLUDEPY'))"`
if test x$ax_python_header != x; then
break;
fi
fi
fi
unset ac_cv_prog_PYTHON_BIN
unset PYTHON_BIN
done
if test x$ax_python_bin = x; then
ax_python_bin=no
fi
if test x$ax_python_header = x; then
ax_python_header=no
fi
if test x$ax_python_lib = x; then
ax_python_lib=no
fi
AC_MSG_RESULT([ results of the Python check:])
AC_MSG_RESULT([ Binary: $ax_python_bin])
AC_MSG_RESULT([ Library: $ax_python_lib])
AC_MSG_RESULT([ Include Dir: $ax_python_header])
PYTHON_FOUND=yes
if test x$ax_python_header != xno; then
PYTHON_INCLUDE_DIR=$ax_python_header
AC_SUBST(PYTHON_INCLUDE_DIR)
else
PYTHON_FOUND=no
fi
if test x$ax_python_lib != xno; then
PYTHON_LIB=$ax_python_lib
AC_SUBST(PYTHON_LIB)
else
PYTHON_FOUND=no
fi
AC_SUBST(PYTHON_FOUND)
])dnl
================================================
FILE: bootstrap
================================================
#! /bin/sh
aclocal
autoheader
automake --gnu --add-missing
autoconf
================================================
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 <lauxlib.h> header file. */
#undef HAVE_LAUXLIB_H
/* Define to 1 if you have the `config' library (-lconfig). */
#undef HAVE_LIBCONFIG
/* 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 the `jansson' library (-ljansson). */
#undef HAVE_LIBJANSSON
/* Define to 1 if you have `z' library (-lz) */
#undef HAVE_LIBZ
/* Define to 1 if you have the <luaconf.h> header file. */
#undef HAVE_LUACONF_H
/* Define to 1 if you have the <lualib.h> header file. */
#undef HAVE_LUALIB_H
/* Define to 1 if you have the <lua.h> header file. */
#undef HAVE_LUA_H
/* 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
/* Use custom prog name */
#undef PROG_NAME
/* 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
/* use json */
#undef USE_JSON
/* use lua */
#undef USE_LUA
/* use python */
#undef USE_PYTHON
/* 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: config.sample
================================================
# This is an empty config file
# Feel free to put something here
default_profile = "binlog";
test_dc1 = {
config_directory = ".telegram/test_dc1";
test = true;
msg_num = true;
};
binlog = {
config_directory = ".telegram/binlog";
test = false;
msg_num = true;
log_level = 2;
};
binlog_mts = {
config_directory = ".telegram/binlog_mts";
test = false;
msg_num = true;
log_level = 2;
};
mega = {
config_directory = ".telegram/mega";
test = false;
msg_num = true;
log_level = 2;
};
new = {
config_directory = ".telegram/new";
test = false;
msg_num = true;
};
production = {
config_directory = ".telegram/production";
test = false;
msg_num = true;
};
test = {
config_directory = ".telegram/test";
test = true;
msg_num = true;
};
test1 = {
config_directory = ".telegram/test1";
msg_num = true;
};
test2 = {
config_directory = ".telegram/test2";
msg_num = true;
pfs_enabled = true;
};
================================================
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_LIBS
LIBOBJS
PYTHON_CFLAGS
PYTHON_LIBS
PYTHON_FOUND
PYTHON_LIB
PYTHON_INCLUDE_DIR
PYTHON_BIN
LUA_LIB
LUA_INCLUDE
pkgluaexecdir
luaexecdir
pkgluadir
luadir
LUA_EXEC_PREFIX
LUA_PREFIX
LUA_PLATFORM
LUA_SHORT_VERSION
LUA_VERSION
LUA
OPENSSL_LDFLAGS
OPENSSL_LIBS
OPENSSL_INCLUDES
PKG_CONFIG
EGREP
GREP
CPP
OBJEXT
EXEEXT
ac_ct_CC
CPPFLAGS
LDFLAGS
CFLAGS
CC
target_alias
host_alias
build_alias
LIBS
ECHO_T
ECHO_N
ECHO_C
DEFS
mandir
localedir
libdir
psdir
pdfdir
dvidir
htmldir
infodir
docdir
oldincludedir
includedir
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_libconfig
enable_extf
enable_liblua
enable_python
enable_json
with_progname
enable_valgrind
'
ac_precious_vars='build_alias
host_alias
target_alias
CC
CFLAGS
LDFLAGS
LIBS
CPPFLAGS
CPP
LUA
LUA_INCLUDE
LUA_LIB'
# 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-libconfig/--disable-libconfig
--enable-extf/--disable-extf
--enable-liblua/--disable-liblua
--enable-python/--disable-python
--enable-json/--disable-json
--enable-valgrind/--disable-valgrind
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
--with-progname=<name>
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
LUA The Lua interpreter, e.g. /usr/bin/lua5.1
LUA_INCLUDE The Lua includes, e.g. -I/usr/include/lua5.1
LUA_LIB The Lua library, e.g. -llua5.1
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_lua.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_PROG_LUA[([MINIMUM-VERSION], [TOO-BIG-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])]
# AX_LUA_HEADERS[([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])]
# AX_LUA_LIBS[([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])]
# AX_LUA_READLINE[([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])]
#
# DESCRIPTION
#
# Detect a Lua interpreter, optionally specifying a minimum and maximum
# version number. Set up important Lua paths, such as the directories in
# which to install scripts and modules (shared libraries).
#
# Also detect Lua headers and libraries. The Lua version contained in the
# header is checked to match the Lua interpreter version exactly. When
# searching for Lua libraries, the version number is used as a suffix.
# This is done with the goal of supporting multiple Lua installs (5.1 and
# 5.2 side-by-side).
#
# A note on compatibility with previous versions: This file has been
# mostly rewritten for serial 18. Most developers should be able to use
# these macros without needing to modify configure.ac. Care has been taken
# to preserve each macro's behavior, but there are some differences:
#
# 1) AX_WITH_LUA is deprecated; it now expands to the exact same thing as
# AX_PROG_LUA with no arguments.
#
# 2) AX_LUA_HEADERS now checks that the version number defined in lua.h
# matches the interpreter version. AX_LUA_HEADERS_VERSION is therefore
# unnecessary, so it is deprecated and does not expand to anything.
#
# 3) The configure flag --with-lua-suffix no longer exists; the user
# should instead specify the LUA precious variable on the command line.
# See the AX_PROG_LUA description for details.
#
# Please read the macro descriptions below for more information.
#
# This file was inspired by Andrew Dalke's and James Henstridge's
# python.m4 and Tom Payne's, Matthieu Moy's, and Reuben Thomas's ax_lua.m4
# (serial 17). Basically, this file is a mash-up of those two files. I
# like to think it combines the best of the two!
#
# AX_PROG_LUA: Search for the Lua interpreter, and set up important Lua
# paths. Adds precious variable LUA, which may contain the path of the Lua
# interpreter. If LUA is blank, the user's path is searched for an
# suitable interpreter.
#
# If MINIMUM-VERSION is supplied, then only Lua interpreters with a
# version number greater or equal to MINIMUM-VERSION will be accepted. If
# TOO-BIG- VERSION is also supplied, then only Lua interpreters with a
# version number greater or equal to MINIMUM-VERSION and less than
# TOO-BIG-VERSION will be accepted.
#
# Version comparisons require the AX_COMPARE_VERSION macro, which is
# provided by ax_compare_version.m4 from the Autoconf Archive.
#
# The Lua version number, LUA_VERSION, is found from the interpreter, and
# substituted. LUA_PLATFORM is also found, but not currently supported (no
# standard representation).
#
# Finally, the macro finds four paths:
#
# luadir Directory to install Lua scripts.
# pkgluadir $luadir/$PACKAGE
# luaexecdir Directory to install Lua modules.
# pkgluaexecdir $luaexecdir/$PACKAGE
#
# These paths a found based on $prefix, $exec_prefix, Lua's package.path,
# and package.cpath. The first path of package.path beginning with $prefix
# is selected as luadir. The first path of package.cpath beginning with
# $exec_prefix is used as luaexecdir. This should work on all reasonable
# Lua installations. If a path cannot be determined, a default path is
# used. Of course, the user can override these later when invoking make.
#
# luadir Default: $prefix/share/lua/$LUA_VERSION
# luaexecdir Default: $exec_prefix/lib/lua/$LUA_VERSION
#
# These directories can be used by Automake as install destinations. The
# variable name minus 'dir' needs to be used as a prefix to the
# appropriate Automake primary, e.g. lua_SCRIPS or luaexec_LIBRARIES.
#
# If an acceptable Lua interpreter is found, then ACTION-IF-FOUND is
# performed, otherwise ACTION-IF-NOT-FOUND is preformed. If ACTION-IF-NOT-
# FOUND is blank, then it will default to printing an error. To prevent
# the default behavior, give ':' as an action.
#
# AX_LUA_HEADERS: Search for Lua headers. Requires that AX_PROG_LUA be
# expanded before this macro. Adds precious variable LUA_INCLUDE, which
# may contain Lua specific include flags, e.g. -I/usr/include/lua5.1. If
# LUA_INCLUDE is blank, then this macro will attempt to find suitable
# flags.
#
# LUA_INCLUDE can be used by Automake to compile Lua modules or
# executables with embedded interpreters. The *_CPPFLAGS variables should
# be used for this purpose, e.g. myprog_CPPFLAGS = $(LUA_INCLUDE).
#
# This macro searches for the header lua.h (and others). The search is
# performed with a combination of CPPFLAGS, CPATH, etc, and LUA_INCLUDE.
# If the search is unsuccessful, then some common directories are tried.
# If the headers are then found, then LUA_INCLUDE is set accordingly.
#
# The paths automatically searched are:
#
# * /usr/include/luaX.Y
# * /usr/include/lua/X.Y
# * /usr/include/luaXY
# * /usr/local/include/luaX.Y
# * /usr/local/include/lua-X.Y
# * /usr/local/include/lua/X.Y
# * /usr/local/include/luaXY
#
# (Where X.Y is the Lua version number, e.g. 5.1.)
#
# The Lua version number found in the headers is always checked to match
# the Lua interpreter's version number. Lua headers with mismatched
# version numbers are not accepted.
#
# If headers are found, then ACTION-IF-FOUND is performed, otherwise
# ACTION-IF-NOT-FOUND is performed. If ACTION-IF-NOT-FOUND is blank, then
# it will default to printing an error. To prevent the default behavior,
# set the action to ':'.
#
# AX_LUA_LIBS: Search for Lua libraries. Requires that AX_PROG_LUA be
# expanded before this macro. Adds precious variable LUA_LIB, which may
# contain Lua specific linker flags, e.g. -llua5.1. If LUA_LIB is blank,
# then this macro will attempt to find suitable flags.
#
# LUA_LIB can be used by Automake to link Lua modules or executables with
# embedded interpreters. The *_LIBADD and *_LDADD variables should be used
# for this purpose, e.g. mymod_LIBADD = $(LUA_LIB).
#
# This macro searches for the Lua library. More technically, it searches
# for a library containing the function lua_load. The search is performed
# with a combination of LIBS, LIBRARY_PATH, and LUA_LIB.
#
# If the search determines that some linker flags are missing, then those
# flags will be added to LUA_LIB.
#
# If libraries are found, then ACTION-IF-FOUND is performed, otherwise
# ACTION-IF-NOT-FOUND is performed. If ACTION-IF-NOT-FOUND is blank, then
# it will default to printing an error. To prevent the default behavior,
# set the action to ':'.
#
# AX_LUA_READLINE: Search for readline headers and libraries. Requires the
# AX_LIB_READLINE macro, which is provided by ax_lib_readline.m4 from the
# Autoconf Archive.
#
# If a readline compatible library is found, then ACTION-IF-FOUND is
# performed, otherwise ACTION-IF-NOT-FOUND is performed.
#
# LICENSE
#
# Copyright (c) 2013 Tim Perkins <tprk77@gmail.com>
# Copyright (c) 2013 Reuben Thomas <rrt@sc3d.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 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf 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 21
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_python.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_PYTHON
#
# DESCRIPTION
#
# This macro does a complete Python development environment check.
#
# It recurses through several python versions (from 2.1 to 2.6 in this
# version), looking for an executable. When it finds an executable, it
# looks to find the header files and library.
#
# It sets PYTHON_BIN to the name of the python executable,
# PYTHON_INCLUDE_DIR to the directory holding the header files, and
# PYTHON_LIB to the name of the Python library.
#
# This macro calls AC_SUBST on PYTHON_BIN (via AC_CHECK_PROG),
# PYTHON_INCLUDE_DIR and PYTHON_LIB.
#
# LICENSE
#
# Copyright (c) 2008 Michael Tindal
#
# 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
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_check_openssl.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]])
#
# DESCRIPTION
#
# Look for OpenSSL in a number of default spots, or in a user-selected
# spot (via --with-openssl). Sets
#
# OPENSSL_INCLUDES to the include directives required
# OPENSSL_LIBS to the -l directives required
# OPENSSL_LDFLAGS to the -L or -R flags required
#
# and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately
#
# This macro sets OPENSSL_INCLUDES such that source files should use the
# openssl/ directory in include directives:
#
# #include <openssl/hmac.h>
#
# LICENSE
#
# Copyright (c) 2009,2010 Zmanda Inc. <http://www.zmanda.com/>
# Copyright (c) 2009,2010 Dustin J. Mitchell <dustin@zmanda.com>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 8
# This is what autoupdate's m4 run will expand. It fires
# the warning (with _au_warn_XXX), outputs it into the
# updated configure.ac (with AC_DIAGNOSE), and then outputs
# the replacement expansion.
# This is an auxiliary macro that is also run when
# autoupdate runs m4. It simply calls m4_warning, but
# we need a wrapper so that each warning is emitted only
# once. We break the quoting in m4_warning's argument in
# order to expand this macro's arguments, not AU_DEFUN's.
# Finally, this is the expansion that is picked up by
# autoconf. It tells the user to run autoupdate, and
# then outputs the replacement expansion. We do not care
# about autoupdate's warning because that contains
# information on what to do *after* running autoupdate.
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_check_zlib.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CHECK_ZLIB([action-if-found], [action-if-not-found])
#
# DESCRIPTION
#
# This macro searches for an installed zlib library. If nothing was
# specified when calling configure, it searches first in /usr/local and
# then in /usr, /opt/local and /sw. If the --with-zlib=DIR is specified,
# it will try to find it in DIR/include/zlib.h and DIR/lib/libz.a. If
# --without-zlib is specified, the library is not searched at all.
#
# If either the header file (zlib.h) or the library (libz) is not found,
# shell commands 'action-if-not-found' is run. If 'action-if-not-found' is
# not specified, the configuration exits on error, asking for a valid zlib
# installation directory or --without-zlib.
#
# If both header file and library are found, shell commands
# 'action-if-found' is run. If 'action-if-found' is not specified, the
# default action appends '-I${ZLIB_HOME}/include' to CPFLAGS, appends
# '-L$ZLIB_HOME}/lib' to LDFLAGS, prepends '-lz' to LIBS, and calls
# AC_DEFINE(HAVE_LIBZ). You should use autoheader to include a definition
# for this symbol in a config.h file. Sample usage in a C/C++ source is as
# follows:
#
# #ifdef HAVE_LIBZ
# #include <zlib.h>
# #endif /* HAVE_LIBZ */
#
# LICENSE
#
# Copyright (c) 2008 Loic Dachary <loic@senga.org>
# Copyright (c) 2010 Bastien Chevreux <bach@chevreux.org>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 14
# This is what autoupdate's m4 run will expand. It fires
# the warning (with _au_warn_XXX), outputs it into the
# updated configure.ac (with AC_DIAGNOSE), and then outputs
# the replacement expansion.
# This is an auxiliary macro that is also run when
# autoupdate runs m4. It simply calls m4_warning, but
# we need a wrapper so that each warning is emitted only
# once. We break the quoting in m4_warning's argument in
# order to expand this macro's arguments, not AU_DEFUN's.
# Finally, this is the expansion that is picked up by
# autoconf. It tells the user to run autoupdate, and
# then outputs the replacement expansion. We do not care
# about autoupdate's warning because that contains
# information on what to do *after* running autoupdate.
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_gcc_builtin.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_GCC_BUILTIN(BUILTIN)
#
# DESCRIPTION
#
# This macro checks if the compiler supports one of GCC's built-in
# functions; many other compilers also provide those same built-ins.
#
# The BUILTIN parameter is the name of the built-in function.
#
# If BUILTIN is supported define HAVE_<BUILTIN>. Keep in mind that since
# builtins usually start with two underscores they will be copied over
# into the HAVE_<BUILTIN> definition (e.g. HAVE___BUILTIN_EXPECT for
# __builtin_expect()).
#
# The macro caches its result in the ax_cv_have_<BUILTIN> variable (e.g.
# ax_cv_have___builtin_expect).
#
# The macro currently supports the following built-in functions:
#
# __builtin_assume_aligned
# __builtin_bswap32
# __builtin_bswap64
# __builtin_choose_expr
# __builtin___clear_cache
# __builtin_clrsb
# __builtin_clrsbl
# __builtin_clrsbll
# __builtin_clz
# __builtin_clzl
# __builtin_clzll
# __builtin_complex
# __builtin_constant_p
# __builtin_ctz
# __builtin_ctzl
# __builtin_ctzll
# __builtin_e
gitextract_jznprqyy/ ├── .gitignore ├── .gitmodules ├── .travis.yml ├── CHANGELOG ├── LICENSE ├── LICENSE.h ├── Makefile.in ├── Makefile.tgl ├── Makefile.tl-parser ├── README-Cygwin.md ├── README-LUA ├── README-PY.md ├── README.es ├── README.md ├── ax_lua.m4 ├── ax_python.m4 ├── bootstrap ├── config.h.in ├── config.sample ├── configure ├── configure.ac ├── debian/ │ ├── changelog │ ├── clean │ ├── compat │ ├── control │ ├── copyright │ ├── docs │ ├── install │ ├── rules │ ├── source/ │ │ └── format │ ├── telegram-cli.8 │ ├── telegram-cli.logrotate │ ├── telegram-cli.manpages │ ├── telegram-cli.postinst.debhelper │ ├── telegram-cli.preinst │ ├── telegram-cli.preinst.debhelper │ ├── telegram-cli.prerm │ ├── telegram-cli.prerm.debhelper │ ├── telegram-cli.upstart │ └── watch ├── event-old.h ├── gentoo/ │ └── net-im/ │ └── telegram-cli/ │ ├── Manifest │ └── telegram-cli-9999.ebuild ├── interface.c ├── interface.h ├── json-tg.c ├── json-tg.h ├── loop.c ├── loop.h ├── lua-tg.c ├── lua-tg.h ├── m4-ax_gcc_builtin.m4 ├── m4_ax_check_openssl.m4 ├── m4_ax_check_zlib.m4 ├── main.c ├── python-tg.c ├── python-tg.h ├── python-types.c ├── python-types.h ├── rpm/ │ └── telegram-cli-Beta-2.fc20.x86_64.rpm ├── server.pub ├── start-telegram-daemon ├── telegram-cli-cygwin.patch ├── telegram-cli.spec ├── telegram-daemon ├── telegram.h ├── test.lua ├── tg-server.pub └── tg-test.py
SYMBOL INDEX (593 symbols across 14 files)
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: interface.c
type username_peer_pair (line 100) | struct username_peer_pair {
type tree_username_peer_pair (line 107) | struct tree_username_peer_pair
type username_peer_pair (line 109) | struct username_peer_pair
type in_ev (line 145) | struct in_ev
type tgl_state (line 153) | struct tgl_state
type tgl_state (line 156) | struct tgl_state
type in_ev (line 156) | struct in_ev
type bufferevent (line 157) | struct bufferevent
function is_same_word (line 159) | int is_same_word (const char *s, size_t l, const char *word) {
function skip_wspc (line 163) | static void skip_wspc (void) {
function socket_answer_start (line 178) | void socket_answer_start (void) {
function socket_answer_add_printf (line 183) | void socket_answer_add_printf (const char *format, ...) {
function socket_answer_end (line 192) | void socket_answer_end (struct in_ev *ev) {
function unescape_token (line 221) | static void unescape_token (char *start, char *end) {
function next_token (line 261) | static void next_token (void) {
function next_token_end (line 300) | void next_token_end (void) {
function next_token_end_ac (line 327) | void next_token_end_ac (void) {
function cur_token_int (line 354) | long long cur_token_int (void) {
function hex2int (line 371) | int hex2int (char c) {
function tgl_message_id_t (line 401) | tgl_message_id_t parse_input_msg_id (const char *s, int l) {
function tgl_message_id_t (line 443) | tgl_message_id_t cur_token_msg_id (void) {
function cur_token_double (line 447) | double cur_token_double (void) {
function tgl_peer_id_t (line 464) | tgl_peer_id_t parse_input_peer_id (const char *s, int l, int mask) {
function tgl_peer_id_t (line 535) | tgl_peer_id_t cur_token_user (void) {
function tgl_peer_id_t (line 539) | tgl_peer_id_t cur_token_chat (void) {
function tgl_peer_id_t (line 543) | tgl_peer_id_t cur_token_encr_chat (void) {
function tgl_peer_id_t (line 547) | tgl_peer_id_t cur_token_channel (void) {
function tgl_peer_id_t (line 551) | tgl_peer_id_t cur_token_peer (void) {
function set_prompt (line 608) | void set_prompt (const char *s) {
function update_prompt (line 613) | void update_prompt (void) {
type command_argument (line 644) | enum command_argument {
type arg (line 668) | struct arg {
type command (line 681) | struct command {
type tgl_state (line 694) | struct tgl_state
type tgl_user (line 694) | struct tgl_user
type tgl_state (line 695) | struct tgl_state
type tgl_message (line 695) | struct tgl_message
type tgl_state (line 696) | struct tgl_state
type tgl_message (line 696) | struct tgl_message
type tgl_state (line 697) | struct tgl_state
type tgl_message (line 697) | struct tgl_message
type tgl_state (line 698) | struct tgl_state
type tgl_state (line 699) | struct tgl_state
type tgl_chat (line 699) | struct tgl_chat
type tgl_state (line 700) | struct tgl_state
type tgl_channel (line 700) | struct tgl_channel
type tgl_state (line 701) | struct tgl_state
type tgl_user (line 701) | struct tgl_user
type tgl_state (line 702) | struct tgl_state
type tgl_state (line 703) | struct tgl_state
type tgl_state (line 704) | struct tgl_state
type tgl_state (line 705) | struct tgl_state
type tgl_secret_chat (line 705) | struct tgl_secret_chat
type tgl_state (line 706) | struct tgl_state
type tgl_state (line 707) | struct tgl_state
type tgl_user (line 707) | struct tgl_user
type tgl_state (line 708) | struct tgl_state
type tgl_state (line 709) | struct tgl_state
type tgl_message (line 709) | struct tgl_message
type tgl_state (line 710) | struct tgl_state
type tgl_message (line 710) | struct tgl_message
type tgl_state (line 711) | struct tgl_state
type tgl_secret_chat (line 711) | struct tgl_secret_chat
type tgl_state (line 712) | struct tgl_state
type command (line 714) | struct command
function do_help (line 717) | void do_help (struct command *command, int arg_num, struct arg args[], s...
function do_get_terms_of_service (line 741) | void do_get_terms_of_service (struct command *command, int arg_num, stru...
function do_stats (line 747) | void do_stats (struct command *command, int arg_num, struct arg args[], ...
function do_show_license (line 759) | void do_show_license (struct command *command, int arg_num, struct arg a...
function do_quit (line 769) | void do_quit (struct command *command, int arg_num, struct arg args[], s...
function do_safe_quit (line 776) | void do_safe_quit (struct command *command, int arg_num, struct arg args...
function do_set (line 783) | void do_set (struct command *command, int arg_num, struct arg args[], st...
function do_chat_with_peer (line 796) | void do_chat_with_peer (struct command *command, int arg_num, struct arg...
function do_main_session (line 803) | void do_main_session (struct command *command, int arg_num, struct arg a...
function do_version (line 811) | void do_version (struct command *command, int arg_num, struct arg args[]...
function do_set_password (line 835) | void do_set_password (struct command *command, int arg_num, struct arg a...
function do_msg (line 844) | void do_msg (struct command *command, int arg_num, struct arg args[], st...
function do_post (line 851) | void do_post (struct command *command, int arg_num, struct arg args[], s...
function do_msg_kbd (line 858) | void do_msg_kbd (struct command *command, int arg_num, struct arg args[]...
function do_reply (line 878) | void do_reply (struct command *command, int arg_num, struct arg args[], ...
function do_send_text (line 884) | void do_send_text (struct command *command, int arg_num, struct arg args...
function do_post_text (line 890) | void do_post_text (struct command *command, int arg_num, struct arg args...
function do_reply_text (line 895) | void do_reply_text (struct command *command, int arg_num, struct arg arg...
function _do_send_file (line 901) | static void _do_send_file (struct command *command, int arg_num, struct ...
function do_send_photo (line 908) | void do_send_photo (struct command *command, int arg_num, struct arg arg...
function do_send_file (line 912) | void do_send_file (struct command *command, int arg_num, struct arg args...
function do_send_audio (line 916) | void do_send_audio (struct command *command, int arg_num, struct arg arg...
function do_send_video (line 920) | void do_send_video (struct command *command, int arg_num, struct arg arg...
function do_send_document (line 924) | void do_send_document (struct command *command, int arg_num, struct arg ...
function do_post_photo (line 928) | void do_post_photo (struct command *command, int arg_num, struct arg arg...
function do_post_file (line 932) | void do_post_file (struct command *command, int arg_num, struct arg args...
function do_post_audio (line 936) | void do_post_audio (struct command *command, int arg_num, struct arg arg...
function do_post_video (line 940) | void do_post_video (struct command *command, int arg_num, struct arg arg...
function do_post_document (line 944) | void do_post_document (struct command *command, int arg_num, struct arg ...
function _do_reply_file (line 948) | void _do_reply_file (struct command *command, int arg_num, struct arg ar...
function do_reply_photo (line 954) | void do_reply_photo (struct command *command, int arg_num, struct arg ar...
function do_reply_file (line 958) | void do_reply_file (struct command *command, int arg_num, struct arg arg...
function do_reply_audio (line 962) | void do_reply_audio (struct command *command, int arg_num, struct arg ar...
function do_reply_video (line 966) | void do_reply_video (struct command *command, int arg_num, struct arg ar...
function do_reply_document (line 970) | void do_reply_document (struct command *command, int arg_num, struct arg...
function do_fwd (line 974) | void do_fwd (struct command *command, int arg_num, struct arg args[], st...
function do_fwd_media (line 990) | void do_fwd_media (struct command *command, int arg_num, struct arg args...
function do_send_contact (line 996) | void do_send_contact (struct command *command, int arg_num, struct arg a...
function do_reply_contact (line 1002) | void do_reply_contact (struct command *command, int arg_num, struct arg ...
function do_send_location (line 1008) | void do_send_location (struct command *command, int arg_num, struct arg ...
function do_post_location (line 1014) | void do_post_location (struct command *command, int arg_num, struct arg ...
function do_reply_location (line 1020) | void do_reply_location (struct command *command, int arg_num, struct arg...
function do_broadcast (line 1026) | void do_broadcast (struct command *command, int arg_num, struct arg args...
function do_get_self (line 1041) | void do_get_self(struct command *command, int arg_num, struct arg args[]...
function do_set_profile_photo (line 1046) | void do_set_profile_photo (struct command *command, int arg_num, struct ...
function do_set_profile_name (line 1052) | void do_set_profile_name (struct command *command, int arg_num, struct a...
function do_set_username (line 1058) | void do_set_username (struct command *command, int arg_num, struct arg a...
function do_set_phone_number (line 1064) | void do_set_phone_number (struct command *command, int arg_num, struct a...
function do_status_online (line 1070) | void do_status_online (struct command *command, int arg_num, struct arg ...
function do_status_offline (line 1076) | void do_status_offline (struct command *command, int arg_num, struct arg...
function do_export_card (line 1082) | void do_export_card (struct command *command, int arg_num, struct arg ar...
function do_chat_set_photo (line 1092) | void do_chat_set_photo (struct command *command, int arg_num, struct arg...
function do_rename_chat (line 1098) | void do_rename_chat (struct command *command, int arg_num, struct arg ar...
function do_chat_info (line 1104) | void do_chat_info (struct command *command, int arg_num, struct arg args...
function do_channel_info (line 1110) | void do_channel_info (struct command *command, int arg_num, struct arg a...
function do_chat_add_user (line 1116) | void do_chat_add_user (struct command *command, int arg_num, struct arg ...
function do_chat_del_user (line 1122) | void do_chat_del_user (struct command *command, int arg_num, struct arg ...
function do_create_group_chat (line 1128) | void do_create_group_chat (struct command *command, int arg_num, struct ...
function do_export_chat_link (line 1140) | void do_export_chat_link (struct command *command, int arg_num, struct a...
function do_import_chat_link (line 1146) | void do_import_chat_link (struct command *command, int arg_num, struct a...
function do_channel_invite (line 1152) | void do_channel_invite (struct command *command, int arg_num, struct arg...
function do_channel_kick (line 1158) | void do_channel_kick (struct command *command, int arg_num, struct arg a...
function do_channel_get_members (line 1164) | void do_channel_get_members (struct command *command, int arg_num, struc...
function do_channel_get_admins (line 1170) | void do_channel_get_admins (struct command *command, int arg_num, struct...
function do_chat_upgrade (line 1176) | void do_chat_upgrade (struct command *command, int arg_num, struct arg a...
function do_user_info (line 1188) | void do_user_info (struct command *command, int arg_num, struct arg args...
function do_add_contact (line 1194) | void do_add_contact (struct command *command, int arg_num, struct arg ar...
function do_rename_contact (line 1200) | void do_rename_contact (struct command *command, int arg_num, struct arg...
function do_del_contact (line 1213) | void do_del_contact (struct command *command, int arg_num, struct arg ar...
function do_import_card (line 1220) | void do_import_card (struct command *command, int arg_num, struct arg ar...
function do_block_user (line 1252) | void do_block_user (struct command *command, int arg_num, struct arg arg...
function do_unblock_user (line 1258) | void do_unblock_user (struct command *command, int arg_num, struct arg a...
function do_accept_secret_chat (line 1267) | void do_accept_secret_chat (struct command *command, int arg_num, struct...
function do_set_ttl (line 1279) | void do_set_ttl (struct command *command, int arg_num, struct arg args[]...
function do_visualize_key (line 1290) | void do_visualize_key (struct command *command, int arg_num, struct arg ...
function do_create_secret_chat (line 1338) | void do_create_secret_chat (struct command *command, int arg_num, struct...
function do_rename_channel (line 1348) | void do_rename_channel (struct command *command, int arg_num, struct arg...
function do_channel_set_photo (line 1354) | void do_channel_set_photo (struct command *command, int arg_num, struct ...
function do_channel_set_about (line 1360) | void do_channel_set_about (struct command *command, int arg_num, struct ...
function do_channel_set_admin (line 1366) | void do_channel_set_admin (struct command *command, int arg_num, struct ...
function do_channel_set_username (line 1372) | void do_channel_set_username (struct command *command, int arg_num, stru...
function do_create_channel (line 1378) | void do_create_channel (struct command *command, int arg_num, struct arg...
function do_join_channel (line 1390) | void do_join_channel (struct command *command, int arg_num, struct arg a...
function do_leave_channel (line 1396) | void do_leave_channel (struct command *command, int arg_num, struct arg ...
function do_export_channel_link (line 1402) | void do_export_channel_link (struct command *command, int arg_num, struc...
function do_dialog_list (line 1412) | void do_dialog_list (struct command *command, int arg_num, struct arg ar...
function do_channel_list (line 1418) | void do_channel_list (struct command *command, int arg_num, struct arg a...
function do_resolve_username (line 1424) | void do_resolve_username (struct command *command, int arg_num, struct a...
function do_contact_list (line 1430) | void do_contact_list (struct command *command, int arg_num, struct arg a...
function do_mark_read (line 1440) | void do_mark_read (struct command *command, int arg_num, struct arg args...
function do_history (line 1446) | void do_history (struct command *command, int arg_num, struct arg args[]...
type in_ev (line 1452) | struct in_ev
function do_send_typing (line 1454) | void do_send_typing (struct command *command, int arg_num, struct arg ar...
function do_send_typing_abort (line 1468) | void do_send_typing_abort (struct command *command, int arg_num, struct ...
function do_load_user_photo (line 1534) | void do_load_user_photo (struct command *command, int arg_num, struct a...
function do_view_user_photo (line 1546) | void do_view_user_photo (struct command *command, int arg_num, struct a...
function do_search (line 1562) | void do_search (struct command *command, int arg_num, struct arg args[],...
function do_delete_msg (line 1592) | void do_delete_msg (struct command *command, int arg_num, struct arg arg...
function do_get_message (line 1597) | void do_get_message (struct command *command, int arg_num, struct arg ar...
function do_start_bot (line 1607) | void do_start_bot (struct command *command, int arg_num, struct arg args...
type event (line 1625) | struct event
function do_clear (line 1627) | void do_clear (struct command *command, int arg_num, struct arg args[], ...
type command (line 1654) | struct command
function register_new_command (line 1780) | void register_new_command (struct command *cmd) {
function get_complete_mode (line 1792) | enum command_argument get_complete_mode (void) {
function complete_string_list (line 1942) | int complete_string_list (char **list, int index, const char *text, int ...
type tgl_state (line 1956) | struct tgl_state
type tgl_message (line 1956) | struct tgl_message
type tgl_state (line 1957) | struct tgl_state
type tgl_secret_chat (line 1957) | struct tgl_secret_chat
type tgl_state (line 1958) | struct tgl_state
function complete_command_list (line 1960) | int complete_command_list (int index, const char *text, int len, char **...
function complete_spec_message_answer (line 1976) | int complete_spec_message_answer (struct tgl_message *M, int index, cons...
function complete_message_answer (line 1998) | int complete_message_answer (tgl_peer_t *P, int index, const char *text,...
function complete_user_command (line 2008) | int complete_user_command (tgl_peer_t *P, int index, const char *text, i...
function complete_chat_command (line 2037) | int complete_chat_command (tgl_peer_t *P, int index, const char *text, i...
function complete_username (line 2079) | int complete_username (int mode, int index, const char *text, int len, c...
type command_argument (line 2122) | enum command_argument
type tgl_message (line 2211) | struct tgl_message
function work_modifier (line 2238) | void work_modifier (const char *s, int l) {
function print_fail (line 2260) | void print_fail (struct in_ev *ev) {
function fail_interface (line 2279) | void fail_interface (struct tgl_state *TLS, struct in_ev *ev, int error_...
function print_success (line 2307) | void print_success (struct in_ev *ev) {
function print_success_gw (line 2326) | void print_success_gw (struct tgl_state *TLSR, void *extra, int success) {
function print_msg_success_gw (line 2337) | void print_msg_success_gw (struct tgl_state *TLS, void *extra, int succe...
function print_msg_list_success_gw (line 2342) | void print_msg_list_success_gw (struct tgl_state *TLSR, void *extra, int...
function print_encr_chat_success_gw (line 2347) | void print_encr_chat_success_gw (struct tgl_state *TLS, void *extra, int...
function print_msg_list_gw (line 2352) | void print_msg_list_gw (struct tgl_state *TLSR, void *extra, int success...
function print_msg_list_history_gw (line 2384) | void print_msg_list_history_gw (struct tgl_state *TLSR, void *extra, int...
function print_msg_gw (line 2395) | void print_msg_gw (struct tgl_state *TLSR, void *extra, int success, str...
function print_user_list_gw (line 2418) | void print_user_list_gw (struct tgl_state *TLSR, void *extra, int succes...
function print_user_gw (line 2450) | void print_user_gw (struct tgl_state *TLSR, void *extra, int success, st...
function print_chat_gw (line 2474) | void print_chat_gw (struct tgl_state *TLSR, void *extra, int success, st...
function print_channel_gw (line 2498) | void print_channel_gw (struct tgl_state *TLSR, void *extra, int success,...
function print_peer_gw (line 2523) | void print_peer_gw (struct tgl_state *TLSR, void *extra, int success, tg...
function print_filename_gw (line 2543) | void print_filename_gw (struct tgl_state *TLSR, void *extra, int success...
function print_string_gw (line 2568) | void print_string_gw (struct tgl_state *TLSR, void *extra, int success, ...
function open_filename_gw (line 2592) | void open_filename_gw (struct tgl_state *TLSR, void *extra, int success,...
function print_chat_info_gw (line 2613) | void print_chat_info_gw (struct tgl_state *TLSR, void *extra, int succes...
function print_channel_info_gw (line 2656) | void print_channel_info_gw (struct tgl_state *TLSR, void *extra, int suc...
function print_user_status (line 2703) | void print_user_status (struct tgl_user_status *S, struct in_ev *ev) {
function print_user_info_gw (line 2726) | void print_user_info_gw (struct tgl_state *TLSR, void *extra, int succes...
function print_secret_chat_gw (line 2772) | void print_secret_chat_gw (struct tgl_state *TLSR, void *extra, int succ...
function print_dialog_list_gw (line 2799) | void print_dialog_list_gw (struct tgl_state *TLSR, void *extra, int succ...
function interpreter_chat_mode (line 2852) | void interpreter_chat_mode (char *line) {
type tgl_message (line 2876) | struct tgl_message
type event (line 2878) | struct event
function print_read_list (line 2881) | void print_read_list (int num, struct tgl_message *list[]) {
function unread_message_alarm (line 2947) | void unread_message_alarm (evutil_socket_t fd, short what, void *arg) {
function mark_read_upd (line 2954) | void mark_read_upd (struct tgl_state *TLSR, int num, struct tgl_message ...
function print_typing (line 2979) | void print_typing (struct in_ev *ev, enum tgl_typing_status status) {
function type_notification_upd (line 3017) | void type_notification_upd (struct tgl_state *TLSR, struct tgl_user *U, ...
function type_in_chat_notification_upd (line 3033) | void type_in_chat_notification_upd (struct tgl_state *TLSR, struct tgl_u...
function print_message_gw (line 3052) | void print_message_gw (struct tgl_state *TLSR, struct tgl_message *M) {
function our_id_gw (line 3084) | void our_id_gw (struct tgl_state *TLSR, tgl_peer_id_t id) {
function print_peer_updates (line 3094) | void print_peer_updates (struct in_ev *ev, int flags) {
function json_peer_update (line 3139) | void json_peer_update (struct in_ev *ev, tgl_peer_t *P, unsigned flags) {
function peer_update_username (line 3152) | void peer_update_username (tgl_peer_t *P, const char *username) {
function user_update_gw (line 3185) | void user_update_gw (struct tgl_state *TLSR, struct tgl_user *U, unsigne...
function chat_update_gw (line 3221) | void chat_update_gw (struct tgl_state *TLSR, struct tgl_chat *U, unsigne...
function secret_chat_update_gw (line 3255) | void secret_chat_update_gw (struct tgl_state *TLSR, struct tgl_secret_ch...
function channel_update_gw (line 3300) | void channel_update_gw (struct tgl_state *TLSR, struct tgl_channel *U, u...
function print_card_gw (line 3309) | void print_card_gw (struct tgl_state *TLSR, void *extra, int success, in...
function callback_extf (line 3343) | void callback_extf (struct tgl_state *TLS, void *extra, int success, con...
function user_status_upd (line 3366) | void user_status_upd (struct tgl_state *TLS, struct tgl_user *U) {
type tgl_state (line 3393) | struct tgl_state
type tgl_state (line 3394) | struct tgl_state
type tgl_state (line 3395) | struct tgl_state
type tgl_state (line 3396) | struct tgl_state
type tgl_value_type (line 3396) | enum tgl_value_type
type tgl_state (line 3397) | struct tgl_state
type tgl_update_callback (line 3399) | struct tgl_update_callback
function interpreter_ex (line 3424) | void interpreter_ex (char *line, void *ex) {
function interpreter (line 3710) | void interpreter (char *line) {
function deactivate_readline (line 3729) | void deactivate_readline (void) {
function reactivate_readline (line 3747) | void reactivate_readline (void) {
function print_start (line 3763) | void print_start (void) {
function print_end (line 3773) | void print_end (void) {
function logprintf (line 3794) | void logprintf (const char *format, ...) {
function push_color (line 3824) | void push_color (const char *color) {
function pop_color (line 3831) | void pop_color (void) {
function print_media (line 3842) | void print_media (struct in_ev *ev, struct tgl_message_media *M) {
function print_peer_permanent_name (line 4017) | void print_peer_permanent_name (struct in_ev *ev, tgl_peer_id_t id) {
function print_user_name (line 4021) | void print_user_name (struct in_ev *ev, tgl_peer_id_t id, tgl_peer_t *U) {
function print_chat_name (line 4067) | void print_chat_name (struct in_ev *ev, tgl_peer_id_t id, tgl_peer_t *C) {
function print_channel_name (line 4083) | void print_channel_name (struct in_ev *ev, tgl_peer_id_t id, tgl_peer_t ...
function print_encr_chat_name (line 4099) | void print_encr_chat_name (struct in_ev *ev, tgl_peer_id_t id, tgl_peer_...
function print_peer_name (line 4115) | void print_peer_name (struct in_ev *ev, tgl_peer_id_t id, tgl_peer_t *C) {
function print_date (line 4135) | void print_date (struct in_ev *ev, long t) {
function print_date_full (line 4146) | void print_date_full (struct in_ev *ev, long t) {
function print_msg_id (line 4151) | void print_msg_id (struct in_ev *ev, tgl_message_id_t msg_id, struct tgl...
function print_service_message (line 4165) | void print_service_message (struct in_ev *ev, struct tgl_message *M) {
function print_message (line 4294) | void print_message (struct in_ev *ev, struct tgl_message *M) {
function play_sound (line 4455) | void play_sound (void) {
function set_interface_callbacks (line 4459) | void set_interface_callbacks (void) {
FILE: interface.h
type bufferevent (line 56) | struct bufferevent
type in_ev (line 57) | struct in_ev {
type tgl_message (line 67) | struct tgl_message
type in_ev (line 68) | struct in_ev
type in_ev (line 69) | struct in_ev
type tgl_message (line 69) | struct tgl_message
type in_ev (line 70) | struct in_ev
type in_ev (line 71) | struct in_ev
type in_ev (line 72) | struct in_ev
type in_ev (line 73) | struct in_ev
type in_ev (line 74) | struct in_ev
type in_ev (line 81) | struct in_ev
type in_ev (line 82) | struct in_ev
FILE: json-tg.c
type tgl_state (line 17) | struct tgl_state
function json_pack_peer_type (line 19) | void json_pack_peer_type (json_t *res, tgl_peer_id_t id) {
function str_format_time (line 39) | int str_format_time(long when, char* string)
function json_pack_user (line 45) | void json_pack_user (json_t *res, tgl_peer_t *P) {
function json_pack_chat (line 73) | void json_pack_chat (json_t *res, tgl_peer_t *P) {
function json_pack_channel (line 96) | void json_pack_channel (json_t *res, tgl_peer_t *P) {
function json_pack_encr_chat (line 105) | void json_pack_encr_chat (json_t *res, tgl_peer_t *P) {
function json_t (line 109) | json_t *json_pack_peer (tgl_peer_id_t id) {
function json_t (line 168) | json_t *json_pack_updates (unsigned flags) {
function json_t (line 221) | json_t *json_pack_media (struct tgl_message_media *M) {
function json_t (line 290) | json_t *json_pack_typing (enum tgl_typing_status status) {
function json_t (line 333) | json_t *json_pack_service (struct tgl_message *M) {
function json_t (line 430) | json_t *json_pack_message (struct tgl_message *M) {
function json_t (line 478) | json_t *json_pack_read (struct tgl_message *M) {
function json_t (line 485) | json_t *json_pack_user_status (struct tgl_user *U) {
FILE: json-tg.h
type tgl_message (line 8) | struct tgl_message
type tgl_message (line 11) | struct tgl_message
type tgl_user (line 12) | struct tgl_user
FILE: loop.c
type tgl_state (line 111) | struct tgl_state
type event (line 114) | struct event
type tgl_state (line 119) | struct tgl_state
type tgl_value_type (line 120) | enum tgl_value_type
type tgl_state (line 133) | struct tgl_state
function one_string_read_end (line 134) | static void one_string_read_end (void) {
function generate_prompt (line 157) | void generate_prompt (enum tgl_value_type type, int num) {
function do_get_string (line 229) | void do_get_string (struct tgl_state *TLS) {
function do_get_values (line 238) | void do_get_values (struct tgl_state *TLS, enum tgl_value_type type, con...
function stdin_read_callback (line 254) | static void stdin_read_callback (evutil_socket_t fd, short what, void *a...
function net_loop (line 311) | void net_loop (void) {
type tgl_dc (line 372) | struct tgl_dc
function is_authorized (line 373) | int is_authorized (void) {
function all_authorized (line 377) | int all_authorized (void) {
type tgl_update_callback (line 394) | struct tgl_update_callback
function read_state_file (line 404) | void read_state_file (void) {
function write_state_file (line 432) | void write_state_file (void) {
function write_dc (line 456) | void write_dc (struct tgl_dc *DC, void *extra) {
function write_auth_file (line 477) | void write_auth_file (void) {
function write_secret_chat (line 492) | void write_secret_chat (tgl_peer_t *Peer, void *extra) {
function write_secret_chat_file (line 521) | void write_secret_chat_file (void) {
function read_dc (line 542) | void read_dc (int auth_file_fd, int id, unsigned ver) {
function empty_auth_file (line 563) | void empty_auth_file (void) {
function read_auth_file (line 580) | void read_auth_file (void) {
function read_secret_chat (line 620) | void read_secret_chat (int fd, int v) {
function read_secret_chat_file (line 669) | void read_secret_chat_file (void) {
function read_incoming (line 688) | static void read_incoming (struct bufferevent *bev, void *_arg) {
function event_incoming (line 724) | void event_incoming (struct bufferevent *bev, short what, void *_arg) {
function accept_incoming (line 736) | static void accept_incoming (evutil_socket_t efd, short what, void *arg) {
function on_login (line 755) | void on_login (struct tgl_state *TLS) {
function on_failed_login (line 759) | void on_failed_login (struct tgl_state *TLS) {
type tgl_state (line 766) | struct tgl_state
function clist_cb (line 767) | void clist_cb (struct tgl_state *TLSR, void *callback_extra, int success...
function dlist_cb (line 771) | void dlist_cb (struct tgl_state *TLSR, void *callback_extra, int success...
function on_started (line 775) | void on_started (struct tgl_state *TLS) {
function loop (line 805) | int loop (void) {
FILE: lua-tg.c
type tgl_state (line 50) | struct tgl_state
function ps_lua_pcall (line 57) | int ps_lua_pcall (lua_State *l, int a, int b, int c) {
function lua_add_string_field (line 68) | void lua_add_string_field (const char *name, const char *value) {
function lua_add_lstring_field (line 77) | void lua_add_lstring_field (const char *name, const char *value, int len) {
function lua_add_string_field_arr (line 86) | void lua_add_string_field_arr (int num, const char *value) {
function lua_add_num_field (line 94) | void lua_add_num_field (const char *name, double value) {
function push_tgl_peer_type (line 102) | void push_tgl_peer_type (int x) {
function push_user (line 121) | void push_user (tgl_peer_t *P) {
function push_chat (line 134) | void push_chat (tgl_peer_t *P) {
function push_encr_chat (line 153) | void push_encr_chat (tgl_peer_t *P) {
function push_channel (line 160) | void push_channel (tgl_peer_t *P) {
function push_update_types (line 169) | void push_update_types (unsigned flags) {
function push_peer (line 226) | void push_peer (tgl_peer_id_t id, tgl_peer_t *P) {
function push_media (line 281) | void push_media (struct tgl_message_media *M) {
function push_service (line 338) | void push_service (struct tgl_message *M) {
function push_message (line 467) | void push_message (struct tgl_message *M) {
function lua_binlog_end (line 539) | void lua_binlog_end (void) {
function lua_diff_end (line 553) | void lua_diff_end (void) {
function lua_our_id (line 567) | void lua_our_id (tgl_peer_id_t id) {
function lua_new_msg (line 582) | void lua_new_msg (struct tgl_message *M) {
function lua_secret_chat_update (line 597) | void lua_secret_chat_update (struct tgl_secret_chat *C, unsigned flags) {
function lua_user_update (line 613) | void lua_user_update (struct tgl_user *U, unsigned flags) {
function lua_chat_update (line 629) | void lua_chat_update (struct tgl_chat *C, unsigned flags) {
type lua_arg (line 650) | struct lua_arg {
type lua_arg (line 661) | struct lua_arg
function tgl_peer_t (line 664) | static inline tgl_peer_t *get_peer (const char *s) {
type lua_query_type (line 668) | enum lua_query_type {
type lua_query_extra (line 724) | struct lua_query_extra {
function lua_empty_cb (line 729) | void lua_empty_cb (struct tgl_state *TLSR, void *cb_extra, int success) {
function lua_contact_list_cb (line 755) | void lua_contact_list_cb (struct tgl_state *TLSR, void *cb_extra, int su...
function lua_dialog_list_cb (line 793) | void lua_dialog_list_cb (struct tgl_state *TLSR, void *cb_extra, int suc...
function lua_msg_cb (line 847) | void lua_msg_cb (struct tgl_state *TLSR, void *cb_extra, int success, st...
function lua_one_msg_cb (line 879) | void lua_one_msg_cb (struct tgl_state *TLSR, void *cb_extra, int success...
function lua_msg_list_cb (line 911) | void lua_msg_list_cb (struct tgl_state *TLSR, void *cb_extra, int succes...
function lua_file_cb (line 949) | void lua_file_cb (struct tgl_state *TLSR, void *cb_extra, int success, c...
function lua_chat_cb (line 981) | void lua_chat_cb (struct tgl_state *TLSR, void *cb_extra, int success, s...
function lua_secret_chat_cb (line 1013) | void lua_secret_chat_cb (struct tgl_state *TLSR, void *cb_extra, int suc...
function lua_channel_cb (line 1045) | void lua_channel_cb (struct tgl_state *TLSR, void *cb_extra, int success...
function lua_user_cb (line 1077) | void lua_user_cb (struct tgl_state *TLSR, void *cb_extra, int success, s...
function lua_str_cb (line 1109) | void lua_str_cb (struct tgl_state *TLSR, void *cb_extra, int success, co...
function lua_do_all (line 1143) | void lua_do_all (void) {
type lua_function_param (line 1396) | enum lua_function_param {
type lua_function (line 1411) | struct lua_function {
type lua_function (line 1417) | struct lua_function
function parse_lua_function (line 1474) | static int parse_lua_function (lua_State *L, struct lua_function *F) {
function lua_postpone_alarm (line 1621) | static void lua_postpone_alarm (evutil_socket_t fd, short what, void *ar...
function postpone_from_lua (line 1643) | static int postpone_from_lua (lua_State *L) {
function safe_quit_from_lua (line 1679) | static int safe_quit_from_lua (lua_State *L) {
function universal_from_lua (line 1691) | static int universal_from_lua (lua_State *L) {
function my_lua_register (line 1709) | static void my_lua_register (lua_State *L, const char *name, lua_CFuncti...
type command_argument (line 1715) | enum command_argument {
type arg (line 1738) | struct arg {
type in_ev (line 1749) | struct in_ev
type command (line 1750) | struct command {
function do_interface_from_lua (line 1760) | static void do_interface_from_lua (struct command *command, int arg_num,...
type command (line 1830) | struct command
function register_interface_from_lua (line 1831) | static int register_interface_from_lua (lua_State *L) {
function lua_init (line 1914) | void lua_init (const char *file) {
FILE: lua-tg.h
type tgl_message (line 26) | struct tgl_message
type tgl_secret_chat (line 28) | struct tgl_secret_chat
type tgl_user (line 29) | struct tgl_user
type tgl_chat (line 30) | struct tgl_chat
FILE: main.c
type tgl_state (line 126) | struct tgl_state
function set_default_username (line 128) | void set_default_username (const char *s) {
type termios (line 137) | struct termios
function get_terminal_attributes (line 141) | void get_terminal_attributes (void) {
function set_terminal_attributes (line 152) | void set_terminal_attributes (void) {
function str_empty (line 166) | int str_empty (char *str) {
type passwd (line 176) | struct passwd
function check_type_sizes (line 241) | void check_type_sizes (void) {
function running_for_first_time (line 252) | void running_for_first_time (void) {
function parse_config_val (line 297) | void parse_config_val (config_t *conf, char **s, char *param_name, const...
function parse_config (line 324) | void parse_config (void) {
function parse_config (line 418) | void parse_config (void) {
function inner_main (line 444) | void inner_main (void) {
function usage (line 448) | void usage (void) {
function reopen_logs (line 516) | void reopen_logs (void) {
function sigusr1_handler (line 538) | static void sigusr1_handler (const int sig) {
function sighup_handler (line 544) | static void sighup_handler (const int sig) {
function change_user_group (line 554) | int change_user_group () {
function args_parse (line 602) | void args_parse (int argc, char **argv) {
function print_backtrace (line 802) | void print_backtrace (void) {
function print_backtrace (line 808) | void print_backtrace (void) {
function termination_signal_handler (line 818) | void termination_signal_handler (int signum) {
function sig_term_handler (line 845) | void sig_term_handler (int signum __attribute__ ((unused))) {
function do_halt (line 857) | void do_halt (int error) {
function main (line 892) | int main (int argc, char **argv) {
FILE: python-tg.c
type tgl_state (line 89) | struct tgl_state
function py_add_string_field (line 112) | void py_add_string_field (PyObject* dict, char *name, const char *value) {
function py_add_string_field_arr (line 122) | void py_add_string_field_arr (PyObject* list, int num, const char *value) {
function py_add_num_field (line 131) | void py_add_num_field (PyObject* dict, const char *name, double value) {
function PyObject (line 137) | PyObject* get_tgl_peer_type (int x) {
function PyObject (line 157) | PyObject* get_update_types (unsigned flags) {
function PyObject (line 214) | PyObject* get_peer (tgl_peer_id_t id, tgl_peer_t *P) {
function PyObject (line 221) | PyObject* get_message (struct tgl_message *M) {
function py_binlog_end (line 229) | void py_binlog_end (void) {
function py_diff_end (line 251) | void py_diff_end (void) {
function py_our_id (line 272) | void py_our_id (int id) {
function py_new_msg (line 293) | void py_new_msg (struct tgl_message *M) {
function py_secret_chat_update (line 317) | void py_secret_chat_update (struct tgl_secret_chat *C, unsigned flags) {
function py_user_update (line 343) | void py_user_update (struct tgl_user *U, unsigned flags) {
function py_chat_update (line 368) | void py_chat_update (struct tgl_chat *C, unsigned flags) {
function py_on_loop (line 394) | void py_on_loop () {
type py_query_type (line 426) | enum py_query_type {
function py_empty_cb (line 474) | void py_empty_cb (struct tgl_state *TLSR, void *cb_extra, int success) {
function py_contact_list_cb (line 494) | void py_contact_list_cb (struct tgl_state *TLSR, void *cb_extra, int suc...
function py_dialog_list_cb (line 523) | void py_dialog_list_cb (struct tgl_state *TLSR, void *cb_extra, int succ...
function py_msg_cb (line 562) | void py_msg_cb (struct tgl_state *TLSR, void *cb_extra, int success, str...
function py_msg_list_cb (line 590) | void py_msg_list_cb (struct tgl_state *TLSR, void *cb_extra, int success...
function py_file_cb (line 619) | void py_file_cb (struct tgl_state *TLSR, void *cb_extra, int success, co...
function py_chat_cb (line 647) | void py_chat_cb (struct tgl_state *TLSR, void *cb_extra, int success, st...
function py_secret_chat_cb (line 675) | void py_secret_chat_cb (struct tgl_state *TLSR, void *cb_extra, int succ...
function py_user_cb (line 703) | void py_user_cb (struct tgl_state *TLSR, void *cb_extra, int success, st...
function py_str_cb (line 731) | void py_str_cb (struct tgl_state *TLSR, void *cb_extra, int success, con...
function py_do_all (line 761) | void py_do_all (void) {
function PyObject (line 1101) | PyObject* push_py_func(enum py_query_type type, PyObject *args) {
function PyObject (line 1112) | PyObject* py_contact_list(PyObject *self, PyObject *args) { return push_...
function PyObject (line 1113) | PyObject* py_dialog_list(PyObject *self, PyObject *args) { return push_p...
function PyObject (line 1114) | PyObject* py_rename_chat(PyObject *self, PyObject *args) { return push_p...
function PyObject (line 1115) | PyObject* py_send_msg(PyObject *self, PyObject *args) { return push_py_f...
function PyObject (line 1116) | PyObject* py_send_typing(PyObject *self, PyObject *args) { return push_p...
function PyObject (line 1117) | PyObject* py_send_typing_abort(PyObject *self, PyObject *args) { return ...
function PyObject (line 1118) | PyObject* py_send_photo(PyObject *self, PyObject *args) { return push_py...
function PyObject (line 1119) | PyObject* py_send_video(PyObject *self, PyObject *args) { return push_py...
function PyObject (line 1120) | PyObject* py_send_audio(PyObject *self, PyObject *args) { return push_py...
function PyObject (line 1121) | PyObject* py_send_document(PyObject *self, PyObject *args) { return push...
function PyObject (line 1122) | PyObject* py_send_file(PyObject *self, PyObject *args) { return push_py_...
function PyObject (line 1123) | PyObject* py_send_text(PyObject *self, PyObject *args) { return push_py_...
function PyObject (line 1124) | PyObject* py_chat_set_photo(PyObject *self, PyObject *args) { return pus...
function PyObject (line 1125) | PyObject* py_load_photo(PyObject *self, PyObject *args) { return push_py...
function PyObject (line 1126) | PyObject* py_load_video(PyObject *self, PyObject *args) { return push_py...
function PyObject (line 1127) | PyObject* py_load_video_thumb(PyObject *self, PyObject *args) { return p...
function PyObject (line 1128) | PyObject* py_load_audio(PyObject *self, PyObject *args) { return push_py...
function PyObject (line 1129) | PyObject* py_load_document(PyObject *self, PyObject *args) { return push...
function PyObject (line 1130) | PyObject* py_load_document_thumb(PyObject *self, PyObject *args) { retur...
function PyObject (line 1131) | PyObject* py_fwd(PyObject *self, PyObject *args) { return push_py_func(p...
function PyObject (line 1132) | PyObject* py_fwd_media(PyObject *self, PyObject *args) { return push_py_...
function PyObject (line 1133) | PyObject* py_chat_info(PyObject *self, PyObject *args) { return push_py_...
function PyObject (line 1134) | PyObject* py_user_info(PyObject *self, PyObject *args) { return push_py_...
function PyObject (line 1135) | PyObject* py_history(PyObject *self, PyObject *args) { return push_py_fu...
function PyObject (line 1136) | PyObject* py_chat_add_user(PyObject *self, PyObject *args) { return push...
function PyObject (line 1137) | PyObject* py_chat_del_user(PyObject *self, PyObject *args) { return push...
function PyObject (line 1138) | PyObject* py_add_contact(PyObject *self, PyObject *args) { return push_p...
function PyObject (line 1139) | PyObject* py_del_contact(PyObject *self, PyObject *args) { return push_p...
function PyObject (line 1140) | PyObject* py_rename_contact(PyObject *self, PyObject *args) { return pus...
function PyObject (line 1141) | PyObject* py_search(PyObject *self, PyObject *args) { return push_py_fun...
function PyObject (line 1142) | PyObject* py_global_search(PyObject *self, PyObject *args) { return push...
function PyObject (line 1143) | PyObject* py_mark_read(PyObject *self, PyObject *args) { return push_py_...
function PyObject (line 1144) | PyObject* py_set_profile_photo(PyObject *self, PyObject *args) { return ...
function PyObject (line 1145) | PyObject* py_set_profile_name(PyObject *self, PyObject *args) { return p...
function PyObject (line 1146) | PyObject* py_create_secret_chat(PyObject *self, PyObject *args) { return...
function PyObject (line 1147) | PyObject* py_create_group_chat(PyObject *self, PyObject *args) { return ...
function PyObject (line 1148) | PyObject* py_delete_msg(PyObject *self, PyObject *args) { return push_py...
function PyObject (line 1149) | PyObject* py_restore_msg(PyObject *self, PyObject *args) { return push_p...
function PyObject (line 1150) | PyObject* py_accept_secret_chat(PyObject *self, PyObject *args) { return...
function PyObject (line 1151) | PyObject* py_send_contact(PyObject *self, PyObject *args) { return push_...
function PyObject (line 1152) | PyObject* py_status_online(PyObject *self, PyObject *args) { return push...
function PyObject (line 1153) | PyObject* py_status_offline(PyObject *self, PyObject *args) { return pus...
function PyObject (line 1154) | PyObject* py_send_location(PyObject *self, PyObject *args) { return push...
function PyObject (line 1155) | PyObject* py_extf(PyObject *self, PyObject *args) { return push_py_func(...
function PyObject (line 1156) | PyObject* py_import_chat_link(PyObject *self, PyObject *args) { return p...
function PyObject (line 1160) | PyObject* py_safe_quit(PyObject *self, PyObject *args)
function PyObject (line 1173) | PyObject* py_set_preview(PyObject *self, PyObject *args)
function py_add_action_enums (line 1258) | void py_add_action_enums(PyObject *m)
function py_add_peer_type_enums (line 1285) | void py_add_peer_type_enums(PyObject *m)
function MOD_INIT (line 1293) | MOD_INIT(tgl)
function py_init (line 1333) | void py_init (const char *file) {
FILE: python-tg.h
type tgl_message (line 29) | struct tgl_message
type tgl_secret_chat (line 31) | struct tgl_secret_chat
type tgl_user (line 32) | struct tgl_user
type tgl_chat (line 33) | struct tgl_chat
FILE: python-types.c
type tgl_state (line 21) | struct tgl_state
function PyObject (line 31) | PyObject* get_datetime(long datetime)
function tgl_Peer_dealloc (line 40) | static void
function PyObject (line 46) | static PyObject *
function tgl_Peer_init (line 56) | static int
function PyObject (line 75) | static PyObject *
function PyObject (line 100) | static PyObject *
function PyObject (line 126) | static PyObject *
function PyObject (line 156) | static PyObject *
function PyObject (line 182) | static PyObject *
function PyObject (line 208) | static PyObject *
function PyObject (line 234) | static PyObject *
function PyObject (line 260) | static PyObject *
function PyObject (line 286) | static PyObject *
function PyObject (line 311) | static PyObject *
function PyObject (line 332) | static PyObject *
function PyObject (line 343) | static PyObject *
function PyObject (line 374) | static PyObject *
function PyObject (line 409) | static PyObject *
function PyObject (line 437) | static PyObject *
function PyObject (line 464) | static PyObject *
function PyObject (line 491) | static PyObject *
function PyObject (line 525) | static PyObject *
function PyObject (line 553) | static PyObject *
function PyObject (line 581) | static PyObject *
function PyObject (line 609) | static PyObject *
function PyObject (line 637) | static PyObject *
function PyObject (line 665) | static PyObject *
function PyObject (line 693) | static PyObject *
function PyObject (line 727) | static PyObject *
function PyObject (line 761) | static PyObject *
function PyObject (line 795) | static PyObject *
function PyObject (line 823) | static PyObject *
function PyObject (line 858) | static PyObject *
function PyObject (line 887) | static PyObject *
function PyObject (line 916) | static PyObject *
function PyObject (line 968) | static PyObject *
function tgl_Peer_hash (line 1004) | int
function PyObject (line 1010) | PyObject *
function PyObject (line 1085) | PyObject *
function tgl_Msg_dealloc (line 1097) | static void
function PyObject (line 1103) | static PyObject *
function tgl_Msg_init (line 1113) | static int
function PyObject (line 1120) | static PyObject *
function PyObject (line 1131) | static PyObject *
function PyObject (line 1142) | static PyObject *
function PyObject (line 1153) | static PyObject *
function PyObject (line 1164) | static PyObject *
function PyObject (line 1175) | static PyObject *
function PyObject (line 1186) | static PyObject *
function PyObject (line 1198) | static PyObject *
function PyObject (line 1220) | static PyObject *
function PyObject (line 1241) | static PyObject *
function PyObject (line 1258) | static PyObject *
function PyObject (line 1319) | static PyObject *
function PyObject (line 1334) | static PyObject *
function PyObject (line 1355) | static PyObject *
function PyObject (line 1370) | static PyObject *
function PyObject (line 1390) | static PyObject *
function PyObject (line 1406) | static PyObject *
function PyObject (line 1430) | static PyObject *
function PyObject (line 1454) | static PyObject *
function PyObject (line 1562) | PyObject *
FILE: python-types.h
type tgl_Peer (line 7) | typedef struct {
type tgl_Msg (line 12) | typedef struct {
type tgl_message (line 19) | struct tgl_message
FILE: tg-test.py
function on_binlog_replay_end (line 11) | def on_binlog_replay_end():
function on_get_difference_end (line 14) | def on_get_difference_end():
function on_our_id (line 17) | def on_our_id(id):
function msg_cb (line 21) | def msg_cb(success, msg):
function history_cb (line 27) | def history_cb(msg_list, peer, success, msgs):
function cb (line 35) | def cb(success):
function on_msg_receive (line 38) | def on_msg_receive(msg):
function on_secret_chat_update (line 52) | def on_secret_chat_update(peer, types):
function on_user_update (line 55) | def on_user_update():
function on_chat_update (line 58) | def on_chat_update():
Condensed preview — 69 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (807K chars).
[
{
"path": ".gitignore",
"chars": 265,
"preview": "telegram\n*.o\nMakefile\naclocal.m4\nautom4te.cache\nconfig.h\nconfig.log\nconfig.status\n.idea/\nnbproject/\nbin/\nobjs/\ndep/\nauto"
},
{
"path": ".gitmodules",
"chars": 72,
"preview": "[submodule \"tgl\"]\n\tpath = tgl\n\turl = https://github.com/vysheng/tgl.git\n"
},
{
"path": ".travis.yml",
"chars": 431,
"preview": "language: c\n\ncompiler:\n - gcc\n - clang\n\ninstall:\n - sudo apt-get update\n - sudo apt-get install libconfig8-dev\n - sudo"
},
{
"path": "CHANGELOG",
"chars": 1088,
"preview": "1.3.3\n* support for sending custom keyboard \n* fixed contact_search\n* TGL-2.0.3\n1.3.2\n* use TGL-2.0.2\n* add block/unbloc"
},
{
"path": "LICENSE",
"chars": 18092,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 2, June 1991\n\n Copyright (C) 1989, 1991 Fr"
},
{
"path": "LICENSE.h",
"chars": 19464,
"preview": "\" GNU GENERAL PUBLIC LICENSE\\n\"\n\" Version 2, June 1991\\n\"\n\"\\n\"\n\" Copyright (C) "
},
{
"path": "Makefile.in",
"chars": 2053,
"preview": "srcdir=@srcdir@\n\nCFLAGS=@CFLAGS@\nLDFLAGS=@LDFLAGS@ @OPENSSL_LDFLAGS@\nCPPFLAGS=@CPPFLAGS@ @OPENSSL_INCLUDES@\nDEFS=@DEFS@\n"
},
{
"path": "Makefile.tgl",
"chars": 3156,
"preview": "TGL_OBJECTS=${OBJ}/mtproto-common.o ${OBJ}/mtproto-client.o ${OBJ}/mtproto-key.o ${OBJ}/queries.o ${OBJ}/structures.o ${"
},
{
"path": "Makefile.tl-parser",
"chars": 316,
"preview": "TL_PARSER_OBJECTS=${OBJ}/tl-parser.o ${OBJ}/tlc.o\n\n${TL_PARSER_OBJECTS}: ${OBJ}/%.o: ${srcdir}/tgl/tl-parser/%.c | creat"
},
{
"path": "README-Cygwin.md",
"chars": 1920,
"preview": "### Installation on Windows\nTo use telegram-cli in Windows, you should compile with Cygwin which has POSIX API functiona"
},
{
"path": "README-LUA",
"chars": 3065,
"preview": "To use lua with client you should write lua script. You can specify it from config (\"lua_script\" option) or from command"
},
{
"path": "README-PY.md",
"chars": 12468,
"preview": "Python Bindings\n====================\nAll of the functions and methods are executed in the network loop of tg, ***NOT IMM"
},
{
"path": "README.es",
"chars": 5908,
"preview": "## Telegram messenger CLI [](https://travis-ci.org/vysheng/tg)\n\n!!!"
},
{
"path": "README.md",
"chars": 8332,
"preview": "## Telegram messenger CLI [](https://travis-ci.org/vysheng/tg)\n\nCom"
},
{
"path": "ax_lua.m4",
"chars": 24805,
"preview": "# ===========================================================================\n# http://www.gnu.org/software/aut"
},
{
"path": "ax_python.m4",
"chars": 3985,
"preview": "# ===========================================================================\n# http://www.gnu.org/software/auto"
},
{
"path": "bootstrap",
"chars": 71,
"preview": "#! /bin/sh\n\naclocal \nautoheader\nautomake --gnu --add-missing \nautoconf\n"
},
{
"path": "config.h.in",
"chars": 5028,
"preview": "/* config.h.in. Generated from configure.ac by autoheader. */\n\n/* disable extf queries */\n#undef DISABLE_EXTF\n\n/* Use "
},
{
"path": "config.sample",
"chars": 946,
"preview": "# This is an empty config file\n# Feel free to put something here\n\ndefault_profile = \"binlog\";\n\ntest_dc1 = {\n config_dir"
},
{
"path": "configure",
"chars": 234699,
"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": 6067,
"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": "debian/changelog",
"chars": 321,
"preview": "telegram-cli (1.0.6-1) unstable; urgency=low\n\n * Upstream update version\n * Inpliment -e option\n\n -- Steve Illichevsky"
},
{
"path": "debian/clean",
"chars": 8,
"preview": "Makefile"
},
{
"path": "debian/compat",
"chars": 2,
"preview": "9\n"
},
{
"path": "debian/control",
"chars": 1295,
"preview": "Source: telegram-cli\nSection: net\nPriority: extra\nMaintainer: Steve Illichevsky <still.ru@gmail.com>\nBuild-Depends: \tdeb"
},
{
"path": "debian/copyright",
"chars": 1197,
"preview": "Format: http://dep.debian.net/deps/dep5\nUpstream-Name: telegram-cli\nSource: https://github.com/vysheng/tg\n\nFiles: *\nCopy"
},
{
"path": "debian/docs",
"chars": 47,
"preview": "README.es\nREADME-LUA\nREADME.md\n#telegram-cli.8\n"
},
{
"path": "debian/install",
"chars": 215,
"preview": "bin/telegram-cli usr/bin\nserver.pub etc/telegram-cli\n\n#bin/telegram-cli usr/share/telegram-daemon/bin\n#start-telegram-da"
},
{
"path": "debian/rules",
"chars": 991,
"preview": "#!/usr/bin/make -f\n# -*- makefile -*-\n# Sample debian/rules that uses debhelper.\n# This file was originally written by J"
},
{
"path": "debian/source/format",
"chars": 12,
"preview": "3.0 (quilt)\n"
},
{
"path": "debian/telegram-cli.8",
"chars": 2055,
"preview": ".TH man 8 \"02 October 2014\" \"1.0.5.1\" \"telegram-cli man page\"\n.SH NAME\ntelegram-cli \\- Command-line interface for Telegr"
},
{
"path": "debian/telegram-cli.logrotate",
"chars": 128,
"preview": "/var/lib/telegram-cli/*.log {\n daily\n missingok\n rotate 31\n compress\n notifempty\n\tnoc"
},
{
"path": "debian/telegram-cli.manpages",
"chars": 22,
"preview": "debian/telegram-cli.8\n"
},
{
"path": "debian/telegram-cli.postinst.debhelper",
"chars": 297,
"preview": "# Automatically added by dh_installinit\nif [ -e \"/etc/init/telegram-cli.conf\" ]; then\n\tinvoke-rc.d telegram-cli start ||"
},
{
"path": "debian/telegram-cli.preinst",
"chars": 95,
"preview": "adduser --system --home /var/lib/telegram-cli --gecos \"Telegram Daemon User\" --group telegramd"
},
{
"path": "debian/telegram-cli.preinst.debhelper",
"chars": 647,
"preview": "# Automatically added by dh_installinit\nif [ \"$1\" = install ] || [ \"$1\" = upgrade ]; then\n\tif [ -e \"/etc/init.d/telegram"
},
{
"path": "debian/telegram-cli.prerm",
"chars": 197,
"preview": "# Automatically added by dh_installinit\nif [ -e \"/etc/init/telegram-cli.conf\" ]; then\n\tinvoke-rc.d telegram-cli stop || "
},
{
"path": "debian/telegram-cli.prerm.debhelper",
"chars": 165,
"preview": "# Automatically added by dh_installinit\nif [ -e \"/etc/init/telegram-cli.conf\" ]; then\n\tinvoke-rc.d telegram-cli stop || "
},
{
"path": "debian/telegram-cli.upstart",
"chars": 318,
"preview": "# Service\n\nsetuid telegramd\nsetgid telegramd\n\nscript\n exec /usr/bin/telegram-cli -s /var/lib/telegram-cli/test.lua -W "
},
{
"path": "debian/watch",
"chars": 133,
"preview": "version=3\n\nopts=filenamemangle=s/.+\\/v?(\\d\\S*)\\.tar\\.gz/tg-$1\\.tar\\.gz/ \\\n https://github.com/vysheng/tg/tags .*/v?(\\d\\"
},
{
"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": "gentoo/net-im/telegram-cli/Manifest",
"chars": 383,
"preview": "EBUILD telegram-cli-9999.ebuild 926 SHA256 d9c959af30c77afe8e6b1cee162e5362edfb9da6980b53ef71c3cae5f621bf05 SHA512 eeef9"
},
{
"path": "gentoo/net-im/telegram-cli/telegram-cli-9999.ebuild",
"chars": 926,
"preview": "# Copyright 1999-2013 Gentoo Foundation\n# Distributed under the terms of the GNU General Public License v2\n# $Header: $\n"
},
{
"path": "interface.c",
"chars": 145205,
"preview": "/*\n This file is part of telegram-cli.\n\n Telegram-cli is free software: you can redistribute it and/or modify\n "
},
{
"path": "interface.h",
"chars": 2969,
"preview": "/*\n This file is part of telegram-cli.\n\n Telegram-cli is free software: you can redistribute it and/or modify\n "
},
{
"path": "json-tg.c",
"chars": 19363,
"preview": "#include \"config.h\"\n#ifdef USE_JSON\n\n#include <jansson.h>\n#include \"json-tg.h\"\n#include <tgl/tgl.h>\n#include <tgl/tgl-la"
},
{
"path": "json-tg.h",
"chars": 402,
"preview": "#ifndef __JSON_TG_H__\n#define __JSON_TG_H__\n#include \"config.h\"\n#ifdef USE_JSON\n#include <jansson.h>\n#include <tgl/tgl.h"
},
{
"path": "loop.c",
"chars": 23189,
"preview": "/*\n This file is part of telegram-cli.\n\n Telegram-cli is free software: you can redistribute it and/or modify\n "
},
{
"path": "loop.h",
"chars": 1025,
"preview": "/*\n This file is part of telegram-cli.\n\n Telegram-cli is free software: you can redistribute it and/or modify\n "
},
{
"path": "lua-tg.c",
"chars": 55027,
"preview": "/*\n This file is part of telegram-cli.\n\n Telegram-cli is free software: you can redistribute it and/or modify\n "
},
{
"path": "lua-tg.h",
"chars": 1216,
"preview": "/*\n This file is part of telegram-cli.\n\n Telegram-cli is free software: you can redistribute it and/or modify\n "
},
{
"path": "m4-ax_gcc_builtin.m4",
"chars": 5791,
"preview": "# ===========================================================================\n# http://www.gnu.org/software/autocon"
},
{
"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": "main.c",
"chars": 26272,
"preview": "/*\n This file is part of telegram-cli.\n\n Telegram-cli is free software: you can redistribute it and/or modify\n "
},
{
"path": "python-tg.c",
"chars": 44788,
"preview": "/*\n This file is part of telegram-cli.\n\n Telegram-cli is free software: you can redistribute it and/or modify\n "
},
{
"path": "python-tg.h",
"chars": 4125,
"preview": "/*\n This file is part of telegram-cli.\n\n Telegram-cli is free software: you can redistribute it and/or modify\n "
},
{
"path": "python-types.c",
"chars": 42484,
"preview": "\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n\n#ifdef USE_PYTHON\n#include <Python.h>\n#include <tgl/tgl.h>\n#include <t"
},
{
"path": "python-types.h",
"chars": 352,
"preview": "#ifndef __PYTHON_TYPES_H__\n#define __PYTHON_TYPES_H__\n\n#include <Python.h>\n#include <tgl/tgl.h>\n\ntypedef struct {\n PyOb"
},
{
"path": "server.pub",
"chars": 426,
"preview": "-----BEGIN RSA PUBLIC KEY-----\nMIIBCgKCAQEAwVACPi9w23mF3tBkdZz+zwrzKOaaQdr01vAbU4E1pvkfj4sqDsm6\nlyDONS789sVoD/xCS9Y0hkkC"
},
{
"path": "start-telegram-daemon",
"chars": 5293,
"preview": "#!/usr/bin/perl -w\n\n# start-engine\n# derived from start-memcached\n# 2003/2004 - Jay Bonci <jaybonci@debian.org>\n# This s"
},
{
"path": "telegram-cli-cygwin.patch",
"chars": 1133,
"preview": "Binary files tg/.git/index and tg-cygwin/.git/index differ\ndiff -urN tg/Makefile tg-cygwin/Makefile\n--- tg/Makefile\t2015"
},
{
"path": "telegram-cli.spec",
"chars": 1080,
"preview": "Name: \ttelegram-cli\nVersion:\tBeta\nRelease:\t2%{?dist}\nSummary:\tPrivate fast and open platform for instant messaging"
},
{
"path": "telegram-daemon",
"chars": 8351,
"preview": "#!/bin/bash\n\n### BEGIN INIT INFO\n# Provides:\t\tengine\n# Required-Start:\t$local_fs $syslog\n# Required-Stop:\t$local_fs $sys"
},
{
"path": "telegram.h",
"chars": 840,
"preview": "/*\n This file is part of telegram-cli.\n\n Telegram-cli is free software: you can redistribute it and/or modify\n "
},
{
"path": "test.lua",
"chars": 2571,
"preview": "started = 0\nour_id = 0\n\nfunction vardump(value, depth, key)\n local linePrefix = \"\"\n local spaces = \"\"\n \n if key ~= n"
},
{
"path": "tg-server.pub",
"chars": 427,
"preview": "-----BEGIN RSA PUBLIC KEY-----\nMIIBCgKCAQEAwVACPi9w23mF3tBkdZz+zwrzKOaaQdr01vAbU4E1pvkfj4sqDsm6\nlyDONS789sVoD/xCS9Y0hkkC"
},
{
"path": "tg-test.py",
"chars": 1450,
"preview": "import tgl\nimport pprint\nfrom functools import partial\n\n\nour_id = 0\npp = pprint.PrettyPrinter(indent=4)\n\nbinlog_done = F"
}
]
// ... and 1 more files (download for full content)
About this extraction
This page contains the full source code of the vysheng/tg GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 69 files (748.8 KB), approximately 233.0k tokens, and a symbol index with 593 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.