| 149 |
149 |
| 150 /* pack four bytes as "guint32" into buf |
150 /* pack four bytes as "guint32" into buf |
| 151 * return the number of bytes packed, otherwise return -1 */ |
151 * return the number of bytes packed, otherwise return -1 */ |
| 152 gint qq_put32(guint8 *buf, guint32 dw) |
152 gint qq_put32(guint8 *buf, guint32 dw) |
| 153 { |
153 { |
| 154 guint32 dw_dest; |
154 guint32 dw_porter; |
| 155 memcpy(&dw_dest, buf, sizeof(dw_dest)); |
|
| 156 |
|
| 157 guint32 dw_porter; |
|
| 158 dw_porter = g_htonl(dw); |
155 dw_porter = g_htonl(dw); |
| 159 #ifdef PARSER_DEBUG |
156 #ifdef PARSER_DEBUG |
| 160 purple_debug_info("QQ", "[DBG][put32] buf %p\n", (void *)buf); |
157 purple_debug_info("QQ", "[DBG][put32] buf %p\n", (void *)buf); |
| 161 purple_debug_info("QQ", "[DBG][put32] dw 0x%08x, dw_porter 0x%08x\n", dw, dw_porter); |
158 purple_debug_info("QQ", "[DBG][put32] dw 0x%08x, dw_porter 0x%08x\n", dw, dw_porter); |
| 162 #endif |
159 #endif |