Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major fixes and improvements #140

Open
wants to merge 113 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
2000069
panzi Oct 6, 2013
aeed61a
Merge pull request #1 from vysheng/master
smlu Oct 27, 2015
e2a41a9
Enable histories bigger than 100 for supergroups
majn Mar 3, 2016
561d73c
Allow fetching history ranges
majn Mar 3, 2016
6a7d6e9
Merge branch 'test'
Mar 8, 2016
b17c2ac
Added channel_get_bots case 4
Mar 9, 2016
8c57fa8
Fixed channels_set_admin bug
Mar 9, 2016
f386b5f
Fix tgl
Mar 9, 2016
79d091f
Merge branch 'master' of https://github.com/Rondoozle/tgl
Mar 9, 2016
075fba5
Update tgl
Mar 11, 2016
dfdf42b
Merge branch 'master' of https://github.com/Rondoozle/tgl
Mar 11, 2016
3568aa9
don't hardcode the path to config.h
efidler Mar 18, 2016
40d6ae6
Allow uppercased HTML and support unescaping quotes
majn Apr 2, 2016
2b12e34
Allow uppercased HTML and support unescaping quotes
majn Apr 2, 2016
dba887f
"Updated tl"
Apr 15, 2016
213db7c
Update scheme.tl
Apr 16, 2016
9461454
Update scheme.tl
Apr 16, 2016
f307990
Merge branch 'master' of https://github.com/Rondoozle/tgl
Apr 16, 2016
021a197
Fixed error in set_profile_picture command: FAIL: 71: RPC_CALL_FAIL 4…
s-londono May 5, 2016
7cd3479
Fixed error when loading an image of a expired forwarded message(imag…
blaize9 May 24, 2016
4eec78b
Add Makefile.android
invalid-email-address Jun 6, 2016
40658e3
Remove default Android NDK path
invalid-email-address Jun 6, 2016
1dbdcd8
Update Readme.md
invalid-email-address Jun 6, 2016
c3fe254
Update README.md
smlu Jun 6, 2016
c37b03a
Update Makefile.android
invalid-email-address Jun 6, 2016
8ef4500
Merge branch 'master' of https://github.com/smlu/tgl
invalid-email-address Jun 6, 2016
153ccd7
Edited to save documents with filename
Goty Jul 19, 2016
cbab552
Fix to work on raspberry pi
Goty Jul 19, 2016
e0a6dc4
Fix parsing links with multiple attributes
majn Jul 22, 2016
ba77997
Properly initialize libgcrypt on start
BenWiederhake Feb 18, 2016
43c9132
Fix use-after-not-created for photos
BenWiederhake Feb 18, 2016
0d1c543
Use a single, global counter
BenWiederhake Jan 13, 2016
ff9d386
Adapt mime-types.c auto-gen to vysheng's behavior
BenWiederhake Apr 12, 2016
46334cf
Fix build on solaris (-Werror=return-type)
avsej Mar 12, 2016
8213472
Free messages exactly once
BenWiederhake Apr 14, 2016
624cf5a
fixup! Properly initialize libgcrypt on start
BenWiederhake Aug 1, 2016
bbc7698
Remove empty file (auto-static-skip.c)
BenWiederhake Aug 2, 2016
6a85e9a
Fix dependency on xxd
BenWiederhake Aug 28, 2016
47b571f
32-bit runtime assert fix
EionRobb Sep 2, 2016
1c985a3
Merge pull request #10 from EionRobb/patch-2
BenWiederhake Sep 2, 2016
6b8da83
Add tilde expansion to file uploads
C-Elegans Nov 25, 2016
0e4bad3
Fix out-of-source compile: fix path of config.h in crypto/
hedayat Jan 7, 2017
bd9b744
On migration, pass new channel_id
LucentW Jan 8, 2017
652728a
C++ compatibility fixes
hedayat Jan 14, 2017
be481ae
Fix segmentation fault on image downloading
Almamu Jan 17, 2017
ac2cdc9
make tgl work with openssl
r3t Jan 22, 2017
f0b40dc
Merge pull request #13 from r3t/dev-1.3.0
BenWiederhake Jan 22, 2017
198e97c
C++ compatibility fixes
hedayat Jan 14, 2017
6dcafcd
Prevent using memcpy on the same buffer
hedayat Feb 3, 2017
ac2e73b
Fix trying to print name of NULL query
hedayat Feb 3, 2017
66758bb
OpenSSL 1.1 compatibility
Mar 6, 2017
6d2be7e
tgl: fix
Mar 23, 2016
9b9ff65
OpenSSL 1.1 compatibility
Mar 6, 2017
27e138e
Fix out-of-source compile: fix path of config.h in crypto/
hedayat Jan 7, 2017
3ce5b5d
Enhance security using stack protector and -D_FORTIFY_SOURCE
carpikes Oct 13, 2016
7696b68
Stop using -Werror: bad practice
BenWiederhake Apr 17, 2017
aa8493a
Fix null ptr deref on invalid msgs
CapacitorSet Jun 11, 2017
829ed98
Merge pull request #1 from CapacitorSet/master
LucentW Jun 13, 2017
e1ac3fb
Re-run autoreconf
BenWiederhake Jun 15, 2017
c58d62b
Fix "rpl_malloc not found" when cross-compiling, re-run autoreconf
BenWiederhake Jun 15, 2017
2098fd9
Move to subdirectory
BenWiederhake Jun 16, 2017
87ea867
x
panzi Apr 28, 2014
151c205
x
panzi Jun 11, 2014
fd1f925
x
panzi Apr 15, 2015
29cb465
Add republishing notice.
BenWiederhake Oct 16, 2015
4aa7cd2
Write a README
BenWiederhake Mar 12, 2016
689ec01
More portable endian (solaris/openindiana)
avsej Mar 12, 2016
c761468
do a correct definition
Jun 8, 2016
195fa93
tl-parser is not standalone, never was, never will be
BenWiederhake Jun 15, 2017
58ed5e7
Fix typos
BenWiederhake Jun 15, 2017
1eb3cc7
Remove unused, broken build system
BenWiederhake Jun 15, 2017
9e534f0
Merge branch 'from-portable-endian' into rebasing
BenWiederhake Jun 16, 2017
23680f9
Portable endian: avoid nonexisting functions
BenWiederhake Jun 16, 2017
1103c36
Add bot value to the user structure
giuseppeM99 Jun 21, 2017
be2f67f
Merge pull request #2 from giuseppeM99/master
LucentW Jun 24, 2017
147af92
Fix imagined buffer overflow
BenWiederhake Jun 26, 2017
abdb20f
Auto-discover path to ar
BenWiederhake Jun 24, 2018
db13dc4
Merge pull request #25 from BenWiederhake/master
majn Jun 24, 2018
79c1b96
Fix LibreSSL <2.7.0 support
steils Nov 10, 2018
d1dca8e
fix broken compilation
ultimatesolution Jan 24, 2019
df00d36
Merge branch 'master' of https://github.com/Rondoozle/tgl
kenorb Feb 2, 2019
06eb1db
Stop using -Werror: bad practice
BenWiederhake Apr 17, 2017
077bd3a
Merge branch 'dev-1.3.0' of https://github.com/r3t/tgl
kenorb Feb 2, 2019
e212d1a
Merge commit 'f0b40dc64186d567961520a74e7285aaad056d1a', see: https:/…
kenorb Feb 2, 2019
37261e0
Merge pull request #4 from pollolobo/master
kenorb Feb 2, 2019
1fd30a9
Merge branch 'master' of github.com:kenorb-contrib/tgl
kenorb Feb 2, 2019
2db07de
Merge branch 'master' of https://github.com/LucentW/tgl
kenorb Feb 2, 2019
588b7b6
Merge branch 'master' of https://github.com/ultimatesolution/tgl
kenorb Feb 2, 2019
05e1ce9
Merge pull request #8 from smlu/master
kenorb Feb 2, 2019
16f1cce
Adds Travis CI tests
kenorb Feb 2, 2019
94f6332
Merge commit 'e212d1a177f7110bbcd0e644cbc8ac71dfa78d14'
kenorb Feb 2, 2019
9fe3daf
Merge commit 'd1dca8e6c17473472a83eeb0d97915803b27180d'
kenorb Feb 2, 2019
f763115
Merge branch 'master' of https://github.com/giuseppeM99/tgl
kenorb Feb 2, 2019
67bb8c5
Merge branch 'master' of https://github.com/smlu/tgl into ci
kenorb Feb 2, 2019
a7bebd3
Merge commit 'be2f67f' into ci
kenorb Feb 2, 2019
cff6faf
Merge commit '05e1ce9' into ci
kenorb Feb 2, 2019
cee0cca
Merge commit 'cbab552' into ci
kenorb Feb 2, 2019
16feb59
Fixed send_contact issue
igor04 Sep 8, 2016
8b52822
Update structures.c
Oleg78 Feb 26, 2016
ce8216a
exposed reply_markup
Apr 2, 2017
b3c9ce2
Fixes #100. Removed other assert.
gurelkaynak Mar 31, 2016
45b75ff
Merge branch 'master' of https://github.com/BenWiederhake/tgl
kenorb Feb 2, 2019
7831132
Fixed sending replyKeyboardHide as ReplyMarkup.
srazi Jan 22, 2016
e990385
Merge branch 'dev-1.4.0' of https://github.com/majn/tgl
kenorb Feb 2, 2019
f83306f
Merge branch 'master' of https://github.com/efidler/tgl
kenorb Feb 2, 2019
b5e0921
Merge branch 'uppercase-html' of https://github.com/majn/tgl
kenorb Feb 2, 2019
31f6f50
Merge branch 'master' of https://github.com/s-londono/tgl
kenorb Feb 2, 2019
86155ef
Merge branch 'master' of https://github.com/blaize9/tgl
kenorb Feb 2, 2019
a02aa37
Merge branch 'expand_tilde' of https://github.com/C-Elegans/tgl
kenorb Feb 2, 2019
f82cffa
Merge branch 'out_of_source_fix' of https://github.com/hedayat/tgl
kenorb Feb 2, 2019
1e78b40
Merge branch 'cpp_fixes' of https://github.com/hedayat/tgl
kenorb Feb 2, 2019
09a32d9
Merge branch 'Almamu-patch-1' of https://github.com/Almamu/tgl
kenorb Feb 2, 2019
57f1bc4
Updates README with table of builds
kenorb Feb 3, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: c

compiler:
- gcc
- clang

script:
- git submodule update --init --recursive
- ./configure
- make
134 changes: 134 additions & 0 deletions Makefile.android
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
srcdir=.

# ANDROID Config -------------------------------------------------------------
ANDROID_NDK=
ANDROID_API=android-18
ARCH=arm
MACHINE=armv7-a

CROSS_COMPILE_CC=${ANDROID_NDK}/toolchains/${ARCH}-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/${ARCH}-linux-androideabi-gcc
CROSS_COMPILE_AR=${ANDROID_NDK}/toolchains/${ARCH}-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/${ARCH}-linux-androideabi-ar
CROSS_COMPILE_LD=${ANDROID_NDK}/toolchains/${ARCH}-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/${ARCH}-linux-androideabi-ld

TOOLCHAIN_CFLAGS=--sysroot=${ANDROID_NDK}/platforms/${ANDROID_API}/arch-${ARCH} -mandroid -march=${MACHINE} -Wa,--noexecstack

TOOLCHAIN_LFLAGS=--sysroot=${ANDROID_NDK}/platforms/${ANDROID_API}/arch-${ARCH} -nostdlib
#--------------------------------------------------------------------

# OpenSSL --------------------------------------------------
OPENSSL_ROOT=
OPENSSL_INCLUDE=-I${OPENSSL_ROOT}/include
OPENSSL_LIBS=-L${OPENSSL_ROOT}/android
#----------------------------------------------------------

#Cross Compiler Configs -------------------------------------------------------------
CROSS_COMPILE_CFLAGS=-g -O2
CROSS_COMPILE_CPPFLAGS= ${TOOLCHAIN_CFLAGS} ${OPENSSL_INCLUDE}
CROSS_COMPILE_DEFS=-DHAVE_CONFIG_H
CROSS_COMPILE_FLAGS=${CROSS_COMPILE_CFLAGS} ${CROSS_COMPILE_CPPFLAGS} ${CROSS_COMPILE_DEFS} -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC

CROSS_COMPILE_LDFLAGS= ${TOOLCHAIN_LFLAGS} ${OPENSSL_LIBS}
CROSS_COMPILE_EXTRA_LIBS=-lm -lssl -lcrypto
CROSS_COMPILE_LOCAL_LDFLAGS=-rdynamic -ggdb ${CROSS_COMPILE_EXTRA_LIBS}
CROSS_COMPILE_LINK_FLAGS=${CROSS_COMPILE_LDFLAGS} ${CROSS_COMPILE_LOCAL_LDFLAGS}
# -----------------------------------------------------------------------------------

CFLAGS=-g -O2
LDFLAGS= -L/usr/local/lib -L/usr/lib -L/usr/lib
CPPFLAGS= -I/usr/local/include -I/usr/include -I/usr/include
DEFS=-DHAVE_CONFIG_H
COMPILE_FLAGS=${CFLAGS} ${CPFLAGS} ${CPPFLAGS} ${DEFS} -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC

EXTRA_LIBS=-lz -lm -lssl -lcrypto
LOCAL_LDFLAGS=-rdynamic -ggdb ${EXTRA_LIBS}
LINK_FLAGS=${LDFLAGS} ${LOCAL_LDFLAGS}

DEP=dep
AUTO=auto
OBJ=objs
CROSS_OBJ=${OBJ}/cross_objs
LIB=libs
EXE=bin
DIR_LIST=${DEP} ${AUTO} ${EXE} ${OBJ} ${CROSS_OBJ} ${LIB} ${DEP}/auto ${CROSS_OBJ}/auto

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

TGL_OBJECTS=${CROSS_OBJ}/mtproto-common.o ${CROSS_OBJ}/mtproto-client.o ${CROSS_OBJ}/queries.o ${CROSS_OBJ}/structures.o ${CROSS_OBJ}/binlog.o ${CROSS_OBJ}/tgl.o ${CROSS_OBJ}/updates.o ${CROSS_OBJ}/tg-mime-types.o ${CROSS_OBJ}/mtproto-utils.o
TGL_OBJECTS_AUTO=${CROSS_OBJ}/auto/auto-skip.o ${CROSS_OBJ}/auto/auto-fetch.o ${CROSS_OBJ}/auto/auto-store.o ${CROSS_OBJ}/auto/auto-autocomplete.o ${CROSS_OBJ}/auto/auto-types.o ${CROSS_OBJ}/auto/auto-fetch-ds.o ${CROSS_OBJ}/auto/auto-free-ds.o ${CROSS_OBJ}/auto/auto-store-ds.o ${CROSS_OBJ}/auto/auto-print-ds.o
TLD_OBJECTS=${OBJ}/dump-tl-file.o
GENERATE_OBJECTS=${OBJ}/generate.o
COMMON_OBJECTS=${OBJ}/tools.o
CROSS_COMMON_OBJECTS=${CROSS_OBJ}/tools.o
OBJ_C=${GENERATE_OBJECTS} ${COMMON_OBJECTS} ${TLD_OBJECTS}
TGL_OBJECTS_C=${CROSS_COMMON_OBJECTS} ${TGL_OBJECTS}

DEPENDENCE=$(subst ${OBJ}/,${DEP}/,$(patsubst %.o,%.d,${OBJ_C}))
DEPENDENCE_LIST=${DEPENDENCE}

INCLUDE=-I. -I${srcdir}
CC=gcc

.SUFFIXES:

.SUFFIXES: .c .h .o

all: ${LIB_LIST}
create_dirs_and_headers: ${DIR_LIST} ${AUTO}/auto-skip.h ${AUTO}/auto-fetch.h ${AUTO}/auto-store.h ${AUTO}/auto-autocomplete.h ${AUTO}/auto-types.h
create_dirs: ${DIR_LIST}
dump-tl: ${EXE}/dump-tl-file

include ${srcdir}/Makefile.tl-parser

${DIR_LIST}:
@test -d $@ || mkdir -p $@

-include ${DEPENDENCE_LIST}

${TGL_OBJECTS}: ${AUTO}/constants.h ${AUTO}/auto-skip.h ${AUTO}/auto-fetch.h ${AUTO}/auto-store.h ${AUTO}/auto-autocomplete.h ${AUTO}/auto-types.h ${AUTO}/auto-fetch-ds.h ${AUTO}/auto-free-ds.h ${AUTO}/auto-store-ds.h ${AUTO}/auto-print-ds.h

${OBJ_C}: ${OBJ}/%.o: ${srcdir}/%.c | create_dirs
${CC} ${INCLUDE} ${COMPILE_FLAGS} -c -MP -MD -MF ${DEP}/$*.d -MQ ${OBJ}/$*.o -o $@ $<

${TGL_OBJECTS_C}: ${CROSS_OBJ}/%.o: ${srcdir}/%.c | create_dirs
${CROSS_COMPILE_CC} ${INCLUDE} ${CROSS_COMPILE_FLAGS} -c -MP -MD -MF ${DEP}/$*.d -MQ ${CROSS_OBJ}/$*.o -o $@ $<

${TGL_OBJECTS_AUTO}: ${CROSS_OBJ}/auto/%.o: ${AUTO}/%.c | create_dirs
${CROSS_COMPILE_CC} ${INCLUDE} ${CROSS_COMPILE_FLAGS} -iquote ${srcdir}/tgl -c -MP -MD -MF ${DEP}/$*.d -MQ ${CROSS_OBJ}/$*.o -o $@ $<

${LIB}/libtgl.a: ${TGL_OBJECTS} ${CROSS_COMMON_OBJECTS} ${TGL_OBJECTS_AUTO}
rm -f $@ && ${CROSS_COMPILE_AR} ruv $@ ${TGL_OBJECTS} ${CROSS_COMMON_OBJECTS}

${LIB}/libtgl.so: ${TGL_OBJECTS} ${CROSS_COMMON_OBJECTS} ${TGL_OBJECTS_AUTO}
export LD=${CROSS_COMPILE_LD} && ${CROSS_COMPILE_CC} -shared -o $@ ${TGL_OBJECTS} ${CROSS_COMMON_OBJECTS} ${CROSS_COMPILE_LINK_FLAGS}

${EXE}/generate: ${GENERATE_OBJECTS} ${COMMON_OBJECTS}
${CC} ${GENERATE_OBJECTS} ${COMMON_OBJECTS} ${LINK_FLAGS} -o $@

${AUTO}/scheme.tlo: ${AUTO}/scheme.tl ${EXE}/tl-parser
${EXE}/tl-parser -e $@ ${AUTO}/scheme.tl

${AUTO}/scheme.tl: ${srcdir}/scheme.tl ${srcdir}/encrypted_scheme.tl ${srcdir}/binlog.tl ${srcdir}/mtproto.tl ${srcdir}/append.tl | ${AUTO}
cat $^ > $@

${AUTO}/scheme2.tl: ${AUTO}/scheme.tl ${EXE}/tl-parser
${EXE}/tl-parser -E ${AUTO}/scheme.tl 2> $@ || ( cat $@ && rm $@ && false )

${AUTO}/auto.c: ${AUTO}/scheme.tlo ${EXE}/generate
${EXE}/generate ${AUTO}/scheme.tlo > $@

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

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


${AUTO}/constants.h: ${AUTO}/scheme2.tl ${srcdir}/gen_constants_h.awk
awk -f ${srcdir}/gen_constants_h.awk < $< > $@

${EXE}/dump-tl-file: ${OBJ}/auto/auto.o ${TLD_OBJECTS}
${CC} ${OBJ}/auto/auto.o ${TLD_OBJECTS} ${LINK_FLAGS} -o $@

clean:
rm -rf ${DIR_LIST} config.log config.status > /dev/null || echo "all clean"

21 changes: 16 additions & 5 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CFLAGS=@CFLAGS@
LDFLAGS=@LDFLAGS@ @OPENSSL_LDFLAGS@
CPPFLAGS=@CPPFLAGS@ @OPENSSL_INCLUDES@
DEFS=@DEFS@
COMPILE_FLAGS=${CFLAGS} ${CPFLAGS} ${CPPFLAGS} ${DEFS} -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC
COMPILE_FLAGS=${CFLAGS} ${CPFLAGS} ${CPPFLAGS} ${DEFS} -Wall -Wextra -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -D_FORTIFY_SOURCE=2

EXTRA_LIBS=@LIBS@ @EXTRA_LIBS@ @OPENSSL_LIBS@
LOCAL_LDFLAGS=-rdynamic -ggdb ${EXTRA_LIBS}
Expand All @@ -31,6 +31,13 @@ DEPENDENCE_LIST=${DEPENDENCE}

INCLUDE=-I. -I${srcdir}
CC=@CC@
AR=@AR@

# Check if -fstack-protector-strong is supported before enabling it
SPUNSUPPORTED = $(shell $(CC) -fstack-protector-strong 2>&1 | grep -c 'stack-protector-strong')
ifeq "$(SPUNSUPPORTED)" "0"
COMPILE_FLAGS += -fstack-protector-strong
endif

.SUFFIXES:

Expand All @@ -57,7 +64,7 @@ ${TGL_OBJECTS_AUTO}: ${OBJ}/auto/%.o: ${AUTO}/%.c | create_dirs
${CC} ${INCLUDE} ${COMPILE_FLAGS} -iquote ${srcdir}/tgl -c -MP -MD -MF ${DEP}/$*.d -MQ ${OBJ}/$*.o -o $@ $<

${LIB}/libtgl.a: ${TGL_OBJECTS} ${COMMON_OBJECTS} ${TGL_OBJECTS_AUTO}
rm -f $@ && ar ruv $@ $^
rm -f $@ && ${AR} ruv $@ $^

${LIB}/libtgl.so: ${TGL_OBJECTS} ${COMMON_OBJECTS} ${TGL_OBJECTS_AUTO}
${CC} -shared -o $@ $^ ${LINK_FLAGS}
Expand Down Expand Up @@ -97,6 +104,10 @@ distclean:
rm -rf ${DIR_LIST} config.h config.log config.status

mime-types.c: mime.types
@echo "// DO NOT EDIT! SEE MAKE-TARGET 'gen-mime-types'" > mime-types.c
# xxd is usually packaged with vim-common
xxd -i mime.types >> mime-types.c
@echo xxd -i mime.types > mime-types.c
@if command -v xxd >/dev/null 2>&1 ; then \
xxd -i mime.types > mime-types.c ; \
else \
echo "# No xxd installed! Trying to skip ..." ; \
test -r $@ ; \
fi
35 changes: 30 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
This is library that handles telegram api and protocol.
# Telegram library

This is library that handles Telegram API and protocol.

> This is a fork of [vysheng's repository](https://github.com/vysheng/tgl).

If you're looking for client CLI implementation, check [TG repository](https://github.com/vysheng/tg) instead.

Build status:

| Repository | Status|
| ------------------------------------------------------ | ----- |
| [vysheng](https://github.com/vysheng/tgl) (main) | [![Build Status](https://travis-ci.org/vysheng/tgl.svg)](https://travis-ci.org/vysheng/tgl) |
| [kenorb-contrib](https://github.com/kenorb-contrib/tgl) | [![Build Status](https://travis-ci.org/kenorb-contrib/tgl.svg)](https://travis-ci.org/kenorb-contrib/tgl) |

Current versions:

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

### API, Protocol documentation

Expand All @@ -13,9 +26,9 @@ Documentation for MTproto protocol is available here: https://core.telegram.org/

### Installation

Clone GitHub Repository
Clone this GitHub repository with `--recursive` parameter to clone submodules.

git clone --recursive https://github.com/vysheng/tgl.git && cd tgl
git clone --recursive https://github.com/CHANGETHIS/tgl.git && cd tgl

#### Linux and BSDs

Expand All @@ -29,6 +42,18 @@ Then,
./configure
make

#### Android
Install libs: openssl, openssl(android), zlib
if you want to use provided net/timers then install libevent and add --enable-libevent key to configure

Then,

export ANDROID_NDK=<Path_to_Android_NDK>
export OPENSSL_ROOT=<Path_to_Android_version_of_OpenSSL_root_dir>
./configure
make -f Makefile.android


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

1 change: 1 addition & 0 deletions auto-static-autocomplete.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ int tglf_extf_autocomplete (struct tgl_state *TLS, const char *text, int text_le
#ifdef DISABLE_EXTF
(void) free_vars_to_be_freed;
assert (0);
return 0;
#else
if (index == -1) {
buffer_pos = data;
Expand Down
1 change: 1 addition & 0 deletions auto-static-fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ static void print_offset (void) {
char *tglf_extf_fetch (struct tgl_state *TLS, struct paramed_type *T) {
#ifdef DISABLE_EXTF
assert (0);
return 0;
#else
out_buf_pos = 0;
if (fetch_type_any (T) < 0) { return 0; }
Expand Down
Empty file removed auto-static-skip.c
Empty file.
1 change: 1 addition & 0 deletions auto-static-store.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ void tgl_paramed_type_free (struct paramed_type *P);
struct paramed_type *tglf_extf_store (struct tgl_state *TLS, const char *data, int data_len) {
#ifdef DISABLE_EXTF
assert (0);
return 0;
#else
buffer_pos = (char *)data;
buffer_end = (char *)(data + data_len);
Expand Down
3 changes: 2 additions & 1 deletion binlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ void bl_do_set_auth_key (struct tgl_state *TLS, int num, unsigned char *buf) /*
assert (num > 0 && num <= MAX_DC_ID);
assert (TLS->DC_list[num]);

memcpy (TLS->DC_list[num]->auth_key, buf, 256);
if (TLS->DC_list[num]->auth_key != (char *)buf)
memcpy (TLS->DC_list[num]->auth_key, buf, 256);

static unsigned char sha1_buffer[20];
TGLC_sha1 ((void *)TLS->DC_list[num]->auth_key, 256, sha1_buffer);
Expand Down
15 changes: 2 additions & 13 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
/* Define to 1 if you have the <mach/mach.h> header file. */
#undef HAVE_MACH_MACH_H

/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
/* Define to 1 if you have the `malloc' function. */
#undef HAVE_MALLOC

/* Define to 1 if you have the <malloc.h> header file. */
Expand All @@ -64,8 +63,7 @@
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H

/* Define to 1 if your system has a GNU libc compatible `realloc' function,
and to 0 otherwise. */
/* Define to 1 if you have the `realloc' function. */
#undef HAVE_REALLOC

/* Define to 1 if you have the `select' function. */
Expand Down Expand Up @@ -113,9 +111,6 @@
/* 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

Expand Down Expand Up @@ -153,12 +148,6 @@
#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

Expand Down
Loading