summaryrefslogtreecommitdiff
path: root/src/plugins/relay/api/relay-api-msg.h
blob: 8d171ef782abb5d5d28f288bef762aaf3e476dc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
 * Copyright (C) 2023-2024 Sébastien Helleu <flashcode@flashtux.org>
 *
 * This file is part of WeeChat, the extensible chat client.
 *
 * WeeChat 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.
 *
 * WeeChat 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 WeeChat.  If not, see <https://www.gnu.org/licenses/>.
 */

#ifndef WEECHAT_PLUGIN_RELAY_API_MSG_H
#define WEECHAT_PLUGIN_RELAY_API_MSG_H

enum t_relay_api_colors;

extern int relay_api_msg_send_json (struct t_relay_client *client,
                                    int return_code,
                                    const char *message,
                                    const char *headers,
                                    const char *body_type,
                                    cJSON *json_body);
extern int relay_api_msg_send_error_json (struct t_relay_client *client,
                                          int return_code,
                                          const char *message,
                                          const char *headers,
                                          const char *format, ...);
extern int relay_api_msg_send_event (struct t_relay_client *client,
                                     const char *name,
                                     long long buffer_id,
                                     const char *body_type,
                                     cJSON *json_body);
extern cJSON *relay_api_msg_buffer_to_json (struct t_gui_buffer *buffer,
                                            long lines,
                                            long lines_free,
                                            int nicks,
                                            enum t_relay_api_colors colors);
extern cJSON *relay_api_msg_key_to_json (struct t_gui_key *key);
extern cJSON *relay_api_msg_keys_to_json (struct t_gui_buffer *buffer);
extern cJSON *relay_api_msg_line_data_to_json (struct t_gui_line_data *line_data,
                                               enum t_relay_api_colors colors);
extern cJSON *relay_api_msg_lines_to_json (struct t_gui_buffer *buffer,
                                           long lines,
                                           enum t_relay_api_colors colors);
extern cJSON *relay_api_msg_nick_to_json (struct t_gui_nick *nick,
                                          enum t_relay_api_colors colors);
extern cJSON *relay_api_msg_nick_group_to_json (struct t_gui_nick_group *nick_group,
                                                enum t_relay_api_colors colors);
extern cJSON *relay_api_msg_hotlist_to_json (struct t_gui_hotlist *hotlist);

#endif /* WEECHAT_PLUGIN_RELAY_API_MSG_H */