Mon, 22 Aug 2022 21:40:04 -0500
Inline pidgin_make_scrollable
We need to change it for GTK4, and there are few enough that it can be inlined. Eventually, that code might be a `.ui` anyway.
Testing Done:
Compile only.
Reviewed at https://reviews.imfreedom.org/r/1615/
| 2086 | 1 | /* This file is part of the Project Athena Zephyr Notification System. |
| 2 | * It contains source for the ZCheckIfNotice function. | |
| 3 | * | |
| 4 | * Created by: Robert French | |
| 5 | * | |
| 6 | * Copyright (c) 1987,1988 by the Massachusetts Institute of Technology. | |
| 7 | * For copying and distribution information, see the file | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
8 | * "mit-copyright.h". |
| 2086 | 9 | */ |
| 10 | ||
|
8792
b0645c9dc276
[gaim-migrate @ 9554]
Christian Hammond <chipx86@chipx86.com>
parents:
2086
diff
changeset
|
11 | #include "internal.h" |
| 2086 | 12 | |
|
40166
811f82db29dd
zephyr: Modernize K&R function prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39829
diff
changeset
|
13 | Code_t |
|
40643
1c9bdf8d3e85
Convert zephyr to gio
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40628
diff
changeset
|
14 | ZCheckIfNotice(ZNotice_t *notice, GSocketAddress **from, |
|
40166
811f82db29dd
zephyr: Modernize K&R function prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39829
diff
changeset
|
15 | register int (*predicate)(ZNotice_t *, void *), void *args) |
| 2086 | 16 | { |
| 17 | ZNotice_t tmpnotice; | |
| 18 | Code_t retval; | |
| 19 | register char *buffer; | |
|
40628
4266008a7791
Use a GQueue for zephyr plus related cleanup
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40166
diff
changeset
|
20 | register Z_InputQ *qptr; |
| 2086 | 21 | |
| 22 | if ((retval = Z_ReadEnqueue()) != ZERR_NONE) | |
| 23 | return (retval); | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
24 | |
| 2086 | 25 | qptr = Z_GetFirstComplete(); |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
26 | |
| 2086 | 27 | while (qptr) { |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
28 | if ((retval = ZParseNotice(qptr->packet, qptr->packet_len, |
| 2086 | 29 | &tmpnotice)) != ZERR_NONE) |
| 30 | return (retval); | |
| 31 | if ((*predicate)(&tmpnotice, args)) { | |
| 32 | if (!(buffer = (char *) malloc((unsigned) qptr->packet_len))) | |
| 33 | return (ENOMEM); | |
| 34 | (void) memcpy(buffer, qptr->packet, qptr->packet_len); | |
|
40643
1c9bdf8d3e85
Convert zephyr to gio
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40628
diff
changeset
|
35 | if (from) { |
|
1c9bdf8d3e85
Convert zephyr to gio
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40628
diff
changeset
|
36 | *from = g_object_ref(qptr->from); |
|
1c9bdf8d3e85
Convert zephyr to gio
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40628
diff
changeset
|
37 | } |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
38 | if ((retval = ZParseNotice(buffer, qptr->packet_len, |
| 2086 | 39 | notice)) != ZERR_NONE) { |
| 40 | free(buffer); | |
| 41 | return (retval); | |
| 42 | } | |
| 43 | Z_RemQueue(qptr); | |
| 44 | return (ZERR_NONE); | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
45 | } |
| 2086 | 46 | qptr = Z_GetNextComplete(qptr); |
| 47 | } | |
| 48 | ||
| 49 | return (ZERR_NONOTICE); | |
| 50 | } |