~alivema4ever/ubuntu/trusty/weechat/lp-1299347-fix

« back to all changes in this revision

Viewing changes to src/plugins/relay/weechat/relay-weechat-msg.c

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bouthenot
  • Date: 2013-01-23 18:44:36 UTC
  • mfrom: (1.1.23)
  • Revision ID: package-import@ubuntu.com-20130123184436-pillcj7jmtyyj00j
Tags: 0.4.0-1
* New upstream release.
* Bump Standards-Version to 3.9.4
* Remove UPGRADE_0.3 from doc (no more included in upstream sources).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2003-2012 Sebastien Helleu <flashcode@flashtux.org>
 
2
 * relay-weechat-msg.c - build binary messages for WeeChat protocol
 
3
 *
 
4
 * Copyright (C) 2003-2013 Sebastien Helleu <flashcode@flashtux.org>
3
5
 *
4
6
 * This file is part of WeeChat, the extensible chat client.
5
7
 *
17
19
 * along with WeeChat.  If not, see <http://www.gnu.org/licenses/>.
18
20
 */
19
21
 
20
 
/*
21
 
 * relay-weechat-msg.c: build binary messages for WeeChat protocol
22
 
 */
23
 
 
24
22
#include <stdlib.h>
25
23
#include <stdio.h>
26
24
#include <string.h>
43
41
 
44
42
 
45
43
/*
46
 
 * relay_weechat_msg_new: build a new message (for sending to client)
 
44
 * Builds a new message (for sending to client).
 
45
 *
 
46
 * Returns pointer to new message, NULL if error.
47
47
 */
48
48
 
49
49
struct t_relay_weechat_msg *
76
76
}
77
77
 
78
78
/*
79
 
 * relay_weechat_msg_add_bytes: add some bytes to a message
 
79
 * Adds some bytes to a message.
80
80
 */
81
81
 
82
82
void
108
108
}
109
109
 
110
110
/*
111
 
 * relay_weechat_msg_set_bytes: set some bytes in a message
 
111
 * Sets some bytes in a message.
112
112
 */
113
113
 
114
114
void
122
122
}
123
123
 
124
124
/*
125
 
 * relay_weechat_msg_add_type: add type to a message
 
125
 * Adds type to a message.
126
126
 */
127
127
 
128
128
void
133
133
}
134
134
 
135
135
/*
136
 
 * relay_weechat_msg_add_char: add a char to a message
 
136
 * Adds a char to a message.
137
137
 */
138
138
 
139
139
void
143
143
}
144
144
 
145
145
/*
146
 
 * relay_weechat_msg_add_int: add an integer to a message
 
146
 * Adds an integer to a message.
147
147
 */
148
148
 
149
149
void
156
156
}
157
157
 
158
158
/*
159
 
 * relay_weechat_msg_add_long: add a long integer to a message
 
159
 * Adds a long integer to a message.
160
160
 */
161
161
 
162
162
void
172
172
}
173
173
 
174
174
/*
175
 
 * relay_weechat_msg_add_string: add length + string to a message
 
175
 * Adds length + string to a message.
176
176
 */
177
177
 
178
178
void
195
195
}
196
196
 
197
197
/*
198
 
 * relay_weechat_msg_add_buffer: add buffer (length + data) to a message
 
198
 * Adds buffer (length + data) to a message.
199
199
 */
200
200
 
201
201
void
215
215
}
216
216
 
217
217
/*
218
 
 * relay_weechat_msg_add_pointer: add a pointer to a message
 
218
 * Adds a pointer to a message.
219
219
 */
220
220
 
221
221
void
232
232
}
233
233
 
234
234
/*
235
 
 * relay_weechat_msg_add_time: add a time to a message
 
235
 * Adds a time to a message.
236
236
 */
237
237
 
238
238
void
248
248
}
249
249
 
250
250
/*
251
 
 * relay_weechat_msg_hashtable_map_cb: callback used to add hashtable items in
252
 
 *                                     message
 
251
 * Adds items of hashtable to a message.
253
252
 */
254
253
 
255
254
void
283
282
}
284
283
 
285
284
/*
286
 
 * relay_weechat_msg_add_hashtable: add a hashtable to a message
 
285
 * Adds a hashtable to a message.
287
286
 */
288
287
 
289
288
void
319
318
}
320
319
 
321
320
/*
322
 
 * relay_weechat_msg_add_hdata_path: recursively add hdata for a path
323
 
 *                                   return number of hdata objects added in
324
 
 *                                   message
 
321
 * Adds recursively hdata for a path to a message.
 
322
 *
 
323
 * Returns the number of hdata objects added to message.
325
324
 */
326
325
 
327
326
int
531
530
}
532
531
 
533
532
/*
534
 
 * relay_weechat_msg_add_hdata: add a hdata to a message
535
 
 *                              path has format:
536
 
 *                                  hdata_head:ptr->var->var->...->var
537
 
 *                                where ptr can be a list name or a
538
 
 *                                pointer (0x12345)
539
 
 *                              keys is optional: if not NULL,
540
 
 *                              comma-separated list of keys to return
541
 
 *                              for hdata
 
533
 * Adds a hdata to a message.
 
534
 *
 
535
 * Argument path has format:
 
536
 *   hdata_head:ptr->var->var->...->var
 
537
 * where ptr can be a list name or a pointer (0x12345)
 
538
 *
 
539
 * Argument keys is optional: if not NULL, comma-separated list of keys to
 
540
 * return for hdata.
542
541
 */
543
542
 
544
543
void
701
700
                                                  ptr_hdata_head,
702
701
                                                  pointer,
703
702
                                                  list_keys);
 
703
        free (path_pointers);
704
704
    }
705
705
    count32 = htonl ((uint32_t)count);
706
706
    relay_weechat_msg_set_bytes (msg, pos_count, &count32, 4);
719
719
}
720
720
 
721
721
/*
722
 
 * relay_weechat_msg_add_infolist: add an infolist to a message
 
722
 * Adds an infolist to a message.
723
723
 */
724
724
 
725
725
void
821
821
}
822
822
 
823
823
/*
824
 
 * relay_weechat_msg_add_nicklist_buffer: add nicklist for a buffer, as hdata
825
 
 *                                        object
826
 
 *                                        return number of nicks+groups added
827
 
 *                                        in message
 
824
 * Adds nicklist for a buffer, as hdata object.
 
825
 *
 
826
 * Returns the number of nicks+groups added to message.
828
827
 */
829
828
 
830
829
int
909
908
}
910
909
 
911
910
/*
912
 
 * relay_weechat_msg_add_nicklist: add nicklist for one or all buffers, as
913
 
 *                                 hdata object
 
911
 * Adds nicklist for one or all buffers, as hdata object.
914
912
 */
915
913
 
916
914
void
952
950
}
953
951
 
954
952
/*
955
 
 * relay_weechat_msg_send: send a message
 
953
 * Sends a message.
956
954
 */
957
955
 
958
956
void
1023
1021
}
1024
1022
 
1025
1023
/*
1026
 
 * relay_weechat_msg_free: free a message
 
1024
 * Frees a message.
1027
1025
 */
1028
1026
 
1029
1027
void