| 75 |
75 |
| 76 if (bytes != NULL) { |
76 if (bytes != NULL) { |
| 77 priv->bytes = bytes; |
77 priv->bytes = bytes; |
| 78 priv->offset = offset; |
78 priv->offset = offset; |
| 79 } else { |
79 } else { |
| |
80 priv->bytes = g_byte_array_new(); |
| 80 priv->flags |= FB_THRIFT_FLAG_INTERNAL; |
81 priv->flags |= FB_THRIFT_FLAG_INTERNAL; |
| 81 } |
82 } |
| 82 |
83 |
| 83 if (compact) { |
84 if (compact) { |
| 84 priv->flags |= FB_THRIFT_FLAG_COMPACT; |
85 priv->flags |= FB_THRIFT_FLAG_COMPACT; |
| 85 } |
86 } |
| 86 |
87 |
| 87 priv->pos = priv->offset; |
88 priv->pos = priv->offset; |
| 88 return thft; |
89 return thft; |
| |
90 } |
| |
91 |
| |
92 const GByteArray * |
| |
93 fb_thrift_get_bytes(FbThrift *thft) |
| |
94 { |
| |
95 FbThriftPrivate *priv; |
| |
96 |
| |
97 g_return_val_if_fail(FB_IS_THRIFT(thft), NULL); |
| |
98 priv = thft->priv; |
| |
99 return priv->bytes; |
| 89 } |
100 } |
| 90 |
101 |
| 91 guint |
102 guint |
| 92 fb_thrift_get_pos(FbThrift *thft) |
103 fb_thrift_get_pos(FbThrift *thft) |
| 93 { |
104 { |
| 753 fb_thrift_write_vi32(FbThrift *thft, guint32 u32) |
764 fb_thrift_write_vi32(FbThrift *thft, guint32 u32) |
| 754 { |
765 { |
| 755 fb_thrift_write_vi64(thft, u32); |
766 fb_thrift_write_vi64(thft, u32); |
| 756 } |
767 } |
| 757 |
768 |
| 758 |
|
| 759 void |
769 void |
| 760 fb_thrift_write_i64(FbThrift *thft, gint64 i64) |
770 fb_thrift_write_i64(FbThrift *thft, gint64 i64) |
| 761 { |
771 { |
| 762 FbThriftPrivate *priv; |
772 FbThriftPrivate *priv; |
| 763 |
773 |