1 /*
2     This file is part of tgl-library
3 
4     This library is free software; you can redistribute it and/or
5     modify it under the terms of the GNU Lesser General Public
6     License as published by the Free Software Foundation; either
7     version 2.1 of the License, or (at your option) any later version.
8 
9     This library is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12     Lesser General Public License for more details.
13 
14     You should have received a copy of the GNU Lesser General Public
15     License along with this library; if not, write to the Free Software
16     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
17 
18     Copyright Vitaly Valtman 2013-2015
19 */
20 #ifndef __BINLOG_H__
21 #define __BINLOG_H__
22 
23 //#include "structures.h"
24 #include "tgl.h"
25 #include "auto/auto-types.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 void bl_do_dc_option (struct tgl_state *TLS, int flags, int id, const char *name, int l1, const char *ip, int l2, int port);
32 
33 void bl_do_set_working_dc (struct tgl_state *TLS, int num);
34 void bl_do_dc_signed (struct tgl_state *TLS, int id);
35 void bl_do_set_our_id (struct tgl_state *TLS, tgl_peer_id_t id);
36 void bl_do_set_dh_params (struct tgl_state *TLS, int root, unsigned char prime[], int version);
37 
38 void bl_do_set_pts (struct tgl_state *TLS, int pts);
39 void bl_do_set_qts (struct tgl_state *TLS, int qts);
40 void bl_do_set_date (struct tgl_state *TLS, int date);
41 void bl_do_set_seq (struct tgl_state *TLS, int seq);
42 void bl_do_set_channel_pts (struct tgl_state *TLS, int id, int pts);
43 
44 void bl_do_set_auth_key (struct tgl_state *TLS, int num, unsigned char *buf);
45 
46 void bl_do_set_msg_id (struct tgl_state *TLS, struct tgl_message_id *old_id, struct tgl_message_id *new_id);
47 void bl_do_message_delete (struct tgl_state *TLS, struct tgl_message_id *id);
48 
49 void bl_do_peer_delete (struct tgl_state *TLS, tgl_peer_id_t id);
50 
51 void bl_do_chat_add_user (struct tgl_state *TLS, tgl_peer_id_t id, int version, int user, int inviter, int date);
52 void bl_do_chat_del_user (struct tgl_state *TLS, tgl_peer_id_t id, int version, int user);
53 
54 void bl_do_msg_update (struct tgl_state *TLS, struct tgl_message_id *id);
55 void bl_do_reset_authorization (struct tgl_state *TLS);
56 
57 
58 void bl_do_edit_message (struct tgl_state *TLS, struct tgl_message_id *id, tgl_peer_id_t *from_id, tgl_peer_id_t *to_id, tgl_peer_id_t *fwd_from_id, int *fwd_date, int *date, const char *message, int message_len, struct tl_ds_message_media *media, struct tl_ds_message_action *action, int *reply_id, struct tl_ds_reply_markup *reply_markup, struct tl_ds_vector *entities, int flags);
59 void bl_do_edit_message_encr (struct tgl_state *TLS, struct tgl_message_id *id, tgl_peer_id_t *from_id, tgl_peer_id_t *to_id, int *date, const char *message, int message_len, struct tl_ds_decrypted_message_media *media, struct tl_ds_decrypted_message_action *action, struct tl_ds_encrypted_file *file, int flags);
60 void bl_do_encr_chat_exchange (struct tgl_state *TLS, tgl_peer_id_t id, long long *exchange_id, const void *key, int *state);
61 void bl_do_user (struct tgl_state *TLS, int id, long long *access_hash, const char *first_name, int first_name_len, const char *last_name, int last_name_len, const char *phone, int phone_len, const char *username, int username_len, struct tl_ds_photo *photo, struct tl_ds_user_profile_photo *profile_photo, int *last_read_in, int *last_read_out, struct tl_ds_bot_info *bot_info, int flags);
62 void bl_do_chat (struct tgl_state *TLS, int id, const char *title, int title_len, int *user_num, int *date, int *version, struct tl_ds_vector *participants, struct tl_ds_chat_photo *chat_photo, struct tl_ds_photo *photo, int *admin, int *last_read_in, int *last_read_out, int flags);
63 void bl_do_encr_chat (struct tgl_state *TLS, int id, long long *access_hash, int *date, int *admin, int *user_id, void *key, void *g_key, void *first_key_id, int *state, int *ttl, int *layer, int *in_seq_no, int *last_in_seq_no, int *out_seq_no, long long *key_fingerprint, int flags, const char *print_name, int print_name_len);
64 void bl_do_channel (struct tgl_state *TLS, int id, long long *access_hash, int *date, const char *title, int title_len, const char *username, int username_len, struct tl_ds_chat_photo *chat_photo, struct tl_ds_photo *photo, int *version, char *about, int about_len, int *participants_count, int *admins_count, int *kicked_count, int *last_read_in, int flags);
65 void bl_do_peer_delete (struct tgl_state *TLS, tgl_peer_id_t id);
66 
67 #ifdef __cplusplus
68 }
69 #endif
70 
71 #endif
72