21
20
<link linkend="SoupBuffer">SoupBuffer</link>;
22
21
enum <link linkend="SoupMemoryUse">SoupMemoryUse</link>;
23
<link linkend="SoupBuffer">SoupBuffer</link>* <link linkend="soup-buffer-new">soup_buffer_new</link> (<link linkend="SoupMemoryUse">SoupMemoryUse</link> use,
22
<link linkend="SoupBuffer">SoupBuffer</link> * <link linkend="soup-buffer-new">soup_buffer_new</link> (<link linkend="SoupMemoryUse">SoupMemoryUse</link> use,
24
23
<link linkend="gconstpointer">gconstpointer</link> data,
25
24
<link linkend="gsize">gsize</link> length);
26
<link linkend="SoupBuffer">SoupBuffer</link>* <link linkend="soup-buffer-new-subbuffer">soup_buffer_new_subbuffer</link> (<link linkend="SoupBuffer">SoupBuffer</link> *parent,
25
<link linkend="SoupBuffer">SoupBuffer</link> * <link linkend="soup-buffer-new-subbuffer">soup_buffer_new_subbuffer</link> (<link linkend="SoupBuffer">SoupBuffer</link> *parent,
27
26
<link linkend="gsize">gsize</link> offset,
28
27
<link linkend="gsize">gsize</link> length);
29
<link linkend="SoupBuffer">SoupBuffer</link>* <link linkend="soup-buffer-new-with-owner">soup_buffer_new_with_owner</link> (<link linkend="gconstpointer">gconstpointer</link> data,
28
<link linkend="SoupBuffer">SoupBuffer</link> * <link linkend="soup-buffer-new-with-owner">soup_buffer_new_with_owner</link> (<link linkend="gconstpointer">gconstpointer</link> data,
30
29
<link linkend="gsize">gsize</link> length,
31
30
<link linkend="gpointer">gpointer</link> owner,
32
31
<link linkend="GDestroyNotify">GDestroyNotify</link> owner_dnotify);
33
32
<link linkend="gpointer">gpointer</link> <link linkend="soup-buffer-get-owner">soup_buffer_get_owner</link> (<link linkend="SoupBuffer">SoupBuffer</link> *buffer);
34
<link linkend="SoupBuffer">SoupBuffer</link>* <link linkend="soup-buffer-copy">soup_buffer_copy</link> (<link linkend="SoupBuffer">SoupBuffer</link> *buffer);
33
<link linkend="SoupBuffer">SoupBuffer</link> * <link linkend="soup-buffer-copy">soup_buffer_copy</link> (<link linkend="SoupBuffer">SoupBuffer</link> *buffer);
35
34
<link linkend="void">void</link> <link linkend="soup-buffer-free">soup_buffer_free</link> (<link linkend="SoupBuffer">SoupBuffer</link> *buffer);
37
36
<link linkend="SoupMessageBody">SoupMessageBody</link>;
38
<link linkend="SoupMessageBody">SoupMessageBody</link>* <link linkend="soup-message-body-new">soup_message_body_new</link> (void);
37
<link linkend="SoupMessageBody">SoupMessageBody</link> * <link linkend="soup-message-body-new">soup_message_body_new</link> (void);
39
38
<link linkend="void">void</link> <link linkend="soup-message-body-free">soup_message_body_free</link> (<link linkend="SoupMessageBody">SoupMessageBody</link> *body);
41
40
<link linkend="void">void</link> <link linkend="soup-message-body-set-accumulate">soup_message_body_set_accumulate</link> (<link linkend="SoupMessageBody">SoupMessageBody</link> *body,
103
101
<parameter>data</parameter> is a <link linkend="char"><type>char</type></link> because that's generally convenient; in some
104
102
situations you may need to cast it to <link linkend="guchar"><type>guchar</type></link> or another type.</para>
107
104
</para><variablelist role="struct">
109
<term>const <link linkend="char">char</link> *<structfield>data</structfield>;</term>
106
<term>const <link linkend="char">char</link> *<structfield>data</structfield>;</term>
110
107
<listitem><simpara> the data
111
108
</simpara></listitem>
114
<term><link linkend="gsize">gsize</link> <structfield>length</structfield>;</term>
111
<term><link linkend="gsize">gsize</link> <structfield>length</structfield>;</term>
115
112
<listitem><simpara> length of <parameter>data</parameter>
116
113
</simpara></listitem>
118
115
</variablelist></refsect2>
119
116
<refsect2 id="SoupMemoryUse" role="enum">
120
117
<title>enum SoupMemoryUse</title>
121
<indexterm zone="SoupMemoryUse"><primary>SoupMemoryUse</primary></indexterm><programlisting>typedef enum {
118
<indexterm zone="SoupMemoryUse"><primary sortas="SoupMemoryUse">SoupMemoryUse</primary></indexterm><programlisting>typedef enum {
122
119
SOUP_MEMORY_STATIC,
123
120
SOUP_MEMORY_TAKE,
124
121
SOUP_MEMORY_COPY,
133
130
See also <link linkend="soup-buffer-new-with-owner"><function>soup_buffer_new_with_owner()</function></link>, which allows to you create a
134
131
buffer containing data which is owned by another object.</para>
137
133
</para><variablelist role="enum">
138
<varlistentry id="SOUP-MEMORY-STATIC:CAPS" role="constant">
134
<varlistentry id="SOUP-MEMORY-STATIC--CAPS" role="constant">
139
135
<term><literal>SOUP_MEMORY_STATIC</literal></term>
140
136
<listitem><simpara> The memory is statically allocated and
141
137
constant; libsoup can use the passed-in buffer directly and not
142
138
need to worry about it being modified or freed.
143
139
</simpara></listitem>
145
<varlistentry id="SOUP-MEMORY-TAKE:CAPS" role="constant">
141
<varlistentry id="SOUP-MEMORY-TAKE--CAPS" role="constant">
146
142
<term><literal>SOUP_MEMORY_TAKE</literal></term>
147
143
<listitem><simpara> The caller has allocated the memory for the
148
144
<link linkend="SoupBuffer"><type>SoupBuffer</type></link>'s use; libsoup will assume ownership of it and free it
149
145
(with <link linkend="g-free"><function>g_free()</function></link>) when it is done with it.
150
146
</simpara></listitem>
152
<varlistentry id="SOUP-MEMORY-COPY:CAPS" role="constant">
148
<varlistentry id="SOUP-MEMORY-COPY--CAPS" role="constant">
153
149
<term><literal>SOUP_MEMORY_COPY</literal></term>
154
150
<listitem><simpara> The passed-in data belongs to the caller; the
155
151
<link linkend="SoupBuffer"><type>SoupBuffer</type></link> will copy it into new memory, leaving the caller free
156
152
to reuse the original memory.
157
153
</simpara></listitem>
159
<varlistentry id="SOUP-MEMORY-TEMPORARY:CAPS" role="constant">
155
<varlistentry id="SOUP-MEMORY-TEMPORARY--CAPS" role="constant">
160
156
<term><literal>SOUP_MEMORY_TEMPORARY</literal></term>
161
157
<listitem><simpara> The passed-in data belongs to the caller,
162
158
but will remain valid for the lifetime of the <link linkend="SoupBuffer"><type>SoupBuffer</type></link>. The
168
164
</variablelist></refsect2>
169
165
<refsect2 id="soup-buffer-new" role="function">
170
166
<title>soup_buffer_new ()</title>
171
<indexterm zone="soup-buffer-new"><primary>soup_buffer_new</primary></indexterm><programlisting><link linkend="SoupBuffer">SoupBuffer</link>* soup_buffer_new (<link linkend="SoupMemoryUse">SoupMemoryUse</link> use,
167
<indexterm zone="soup-buffer-new"><primary sortas="soup_buffer_new">soup_buffer_new</primary></indexterm><programlisting><link linkend="SoupBuffer">SoupBuffer</link> * soup_buffer_new (<link linkend="SoupMemoryUse">SoupMemoryUse</link> use,
172
168
<link linkend="gconstpointer">gconstpointer</link> data,
173
169
<link linkend="gsize">gsize</link> length);</programlisting>
175
171
Creates a new <link linkend="SoupBuffer"><type>SoupBuffer</type></link> containing <parameter>length</parameter> bytes from <parameter>data</parameter>.</para>
178
173
</para><variablelist role="params">
179
<varlistentry><term><parameter>use</parameter> :</term>
174
<varlistentry><term><parameter>use</parameter> :</term>
180
175
<listitem><simpara> how <parameter>data</parameter> is to be used by the buffer
181
176
</simpara></listitem></varlistentry>
182
<varlistentry><term><parameter>data</parameter> :</term>
177
<varlistentry><term><parameter>data</parameter> :</term>
183
178
<listitem><simpara> data
184
179
</simpara></listitem></varlistentry>
185
<varlistentry><term><parameter>length</parameter> :</term>
180
<varlistentry><term><parameter>length</parameter> :</term>
186
181
<listitem><simpara> length of <parameter>data</parameter>
187
182
</simpara></listitem></varlistentry>
188
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the new <link linkend="SoupBuffer"><type>SoupBuffer</type></link>.
183
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the new <link linkend="SoupBuffer"><type>SoupBuffer</type></link>.
189
184
</simpara></listitem></varlistentry>
190
185
</variablelist></refsect2>
191
186
<refsect2 id="soup-buffer-new-subbuffer" role="function">
192
187
<title>soup_buffer_new_subbuffer ()</title>
193
<indexterm zone="soup-buffer-new-subbuffer"><primary>soup_buffer_new_subbuffer</primary></indexterm><programlisting><link linkend="SoupBuffer">SoupBuffer</link>* soup_buffer_new_subbuffer (<link linkend="SoupBuffer">SoupBuffer</link> *parent,
188
<indexterm zone="soup-buffer-new-subbuffer"><primary sortas="soup_buffer_new_subbuffer">soup_buffer_new_subbuffer</primary></indexterm><programlisting><link linkend="SoupBuffer">SoupBuffer</link> * soup_buffer_new_subbuffer (<link linkend="SoupBuffer">SoupBuffer</link> *parent,
194
189
<link linkend="gsize">gsize</link> offset,
195
190
<link linkend="gsize">gsize</link> length);</programlisting>
199
194
any data, but will instead simply reference the same data as
200
195
<parameter>parent</parameter> does.)</para>
203
197
</para><variablelist role="params">
204
<varlistentry><term><parameter>parent</parameter> :</term>
198
<varlistentry><term><parameter>parent</parameter> :</term>
205
199
<listitem><simpara> the parent <link linkend="SoupBuffer"><type>SoupBuffer</type></link>
206
200
</simpara></listitem></varlistentry>
207
<varlistentry><term><parameter>offset</parameter> :</term>
201
<varlistentry><term><parameter>offset</parameter> :</term>
208
202
<listitem><simpara> offset within <parameter>parent</parameter> to start at
209
203
</simpara></listitem></varlistentry>
210
<varlistentry><term><parameter>length</parameter> :</term>
204
<varlistentry><term><parameter>length</parameter> :</term>
211
205
<listitem><simpara> number of bytes to copy from <parameter>parent</parameter>
212
206
</simpara></listitem></varlistentry>
213
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the new <link linkend="SoupBuffer"><type>SoupBuffer</type></link>.
207
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the new <link linkend="SoupBuffer"><type>SoupBuffer</type></link>.
214
208
</simpara></listitem></varlistentry>
215
209
</variablelist></refsect2>
216
210
<refsect2 id="soup-buffer-new-with-owner" role="function">
217
211
<title>soup_buffer_new_with_owner ()</title>
218
<indexterm zone="soup-buffer-new-with-owner"><primary>soup_buffer_new_with_owner</primary></indexterm><programlisting><link linkend="SoupBuffer">SoupBuffer</link>* soup_buffer_new_with_owner (<link linkend="gconstpointer">gconstpointer</link> data,
212
<indexterm zone="soup-buffer-new-with-owner"><primary sortas="soup_buffer_new_with_owner">soup_buffer_new_with_owner</primary></indexterm><programlisting><link linkend="SoupBuffer">SoupBuffer</link> * soup_buffer_new_with_owner (<link linkend="gconstpointer">gconstpointer</link> data,
219
213
<link linkend="gsize">gsize</link> length,
220
214
<link linkend="gpointer">gpointer</link> owner,
221
215
<link linkend="GDestroyNotify">GDestroyNotify</link> owner_dnotify);</programlisting>
241
235
they would be different (eg, <parameter>owner</parameter> would be a object, and <parameter>data</parameter>
242
236
would be a pointer to one of the object's fields).</para>
245
238
</para><variablelist role="params">
246
<varlistentry><term><parameter>data</parameter> :</term>
239
<varlistentry><term><parameter>data</parameter> :</term>
247
240
<listitem><simpara> data
248
241
</simpara></listitem></varlistentry>
249
<varlistentry><term><parameter>length</parameter> :</term>
242
<varlistentry><term><parameter>length</parameter> :</term>
250
243
<listitem><simpara> length of <parameter>data</parameter>
251
244
</simpara></listitem></varlistentry>
252
<varlistentry><term><parameter>owner</parameter> :</term>
245
<varlistentry><term><parameter>owner</parameter> :</term>
253
246
<listitem><simpara> pointer to an object that owns <parameter>data</parameter>
254
247
</simpara></listitem></varlistentry>
255
<varlistentry><term><parameter>owner_dnotify</parameter> :</term>
248
<varlistentry><term><parameter>owner_dnotify</parameter> :</term>
256
249
<listitem><simpara> a function to free/unref <parameter>owner</parameter> when the buffer is
258
251
</simpara></listitem></varlistentry>
259
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the new <link linkend="SoupBuffer"><type>SoupBuffer</type></link>.
252
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the new <link linkend="SoupBuffer"><type>SoupBuffer</type></link>.
260
253
</simpara></listitem></varlistentry>
261
254
</variablelist></refsect2>
262
255
<refsect2 id="soup-buffer-get-owner" role="function">
263
256
<title>soup_buffer_get_owner ()</title>
264
<indexterm zone="soup-buffer-get-owner"><primary>soup_buffer_get_owner</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link> soup_buffer_get_owner (<link linkend="SoupBuffer">SoupBuffer</link> *buffer);</programlisting>
257
<indexterm zone="soup-buffer-get-owner"><primary sortas="soup_buffer_get_owner">soup_buffer_get_owner</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link> soup_buffer_get_owner (<link linkend="SoupBuffer">SoupBuffer</link> *buffer);</programlisting>
266
259
Gets the "owner" object for a buffer created with
267
260
<link linkend="soup-buffer-new-with-owner"><function>soup_buffer_new_with_owner()</function></link>.</para>
270
262
</para><variablelist role="params">
271
<varlistentry><term><parameter>buffer</parameter> :</term>
263
<varlistentry><term><parameter>buffer</parameter> :</term>
272
264
<listitem><simpara> a <link linkend="SoupBuffer"><type>SoupBuffer</type></link> created with <link linkend="soup-buffer-new-with-owner"><function>soup_buffer_new_with_owner()</function></link>
273
265
</simpara></listitem></varlistentry>
274
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the owner pointer
266
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the owner pointer
275
267
</simpara></listitem></varlistentry>
276
268
</variablelist></refsect2>
277
269
<refsect2 id="soup-buffer-copy" role="function">
278
270
<title>soup_buffer_copy ()</title>
279
<indexterm zone="soup-buffer-copy"><primary>soup_buffer_copy</primary></indexterm><programlisting><link linkend="SoupBuffer">SoupBuffer</link>* soup_buffer_copy (<link linkend="SoupBuffer">SoupBuffer</link> *buffer);</programlisting>
271
<indexterm zone="soup-buffer-copy"><primary sortas="soup_buffer_copy">soup_buffer_copy</primary></indexterm><programlisting><link linkend="SoupBuffer">SoupBuffer</link> * soup_buffer_copy (<link linkend="SoupBuffer">SoupBuffer</link> *buffer);</programlisting>
281
273
Makes a copy of <parameter>buffer</parameter>. In reality, <link linkend="SoupBuffer"><type>SoupBuffer</type></link> is a refcounted
282
274
type, and calling <link linkend="soup-buffer-copy"><function>soup_buffer_copy()</function></link> will normally just increment
283
275
the refcount on <parameter>buffer</parameter> and return it. However, if <parameter>buffer</parameter> was
284
created with <link linkend="SOUP-MEMORY-TEMPORARY:CAPS"><type>SOUP_MEMORY_TEMPORARY</type></link> memory, then <link linkend="soup-buffer-copy"><function>soup_buffer_copy()</function></link>
276
created with <link linkend="SOUP-MEMORY-TEMPORARY--CAPS"><type>SOUP_MEMORY_TEMPORARY</type></link> memory, then <link linkend="soup-buffer-copy"><function>soup_buffer_copy()</function></link>
285
277
will actually return a copy of it, so that the data in the copy
286
278
will remain valid after the temporary buffer is freed.</para>
289
280
</para><variablelist role="params">
290
<varlistentry><term><parameter>buffer</parameter> :</term>
281
<varlistentry><term><parameter>buffer</parameter> :</term>
291
282
<listitem><simpara> a <link linkend="SoupBuffer"><type>SoupBuffer</type></link>
292
283
</simpara></listitem></varlistentry>
293
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the new (or newly-reffed) buffer
284
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the new (or newly-reffed) buffer
294
285
</simpara></listitem></varlistentry>
295
286
</variablelist></refsect2>
296
287
<refsect2 id="soup-buffer-free" role="function">
297
288
<title>soup_buffer_free ()</title>
298
<indexterm zone="soup-buffer-free"><primary>soup_buffer_free</primary></indexterm><programlisting><link linkend="void">void</link> soup_buffer_free (<link linkend="SoupBuffer">SoupBuffer</link> *buffer);</programlisting>
289
<indexterm zone="soup-buffer-free"><primary sortas="soup_buffer_free">soup_buffer_free</primary></indexterm><programlisting><link linkend="void">void</link> soup_buffer_free (<link linkend="SoupBuffer">SoupBuffer</link> *buffer);</programlisting>
300
291
Frees <parameter>buffer</parameter>. (In reality, as described in the documentation for
301
292
<link linkend="soup-buffer-copy"><function>soup_buffer_copy()</function></link>, this is actually an "unref" operation, and may
302
293
or may not actually free <parameter>buffer</parameter>.)</para>
305
295
</para><variablelist role="params">
306
<varlistentry><term><parameter>buffer</parameter> :</term>
296
<varlistentry><term><parameter>buffer</parameter> :</term>
307
297
<listitem><simpara> a <link linkend="SoupBuffer"><type>SoupBuffer</type></link>
308
298
</simpara></listitem></varlistentry>
309
299
</variablelist></refsect2>
310
300
<refsect2 id="SoupMessageBody" role="struct">
311
301
<title>SoupMessageBody</title>
312
<indexterm zone="SoupMessageBody"><primary>SoupMessageBody</primary></indexterm><programlisting>typedef struct {
302
<indexterm zone="SoupMessageBody"><primary sortas="SoupMessageBody">SoupMessageBody</primary></indexterm><programlisting>typedef struct {
313
303
const char *data;
315
305
} SoupMessageBody;
331
321
As an added bonus, when <parameter>data</parameter> is filled in, it is always terminated
332
322
with a '\0' byte (which is not reflected in <parameter>length</parameter>).</para>
335
324
</para><variablelist role="struct">
337
<term>const <link linkend="char">char</link> *<structfield>data</structfield>;</term>
326
<term>const <link linkend="char">char</link> *<structfield>data</structfield>;</term>
338
327
<listitem><simpara> the data
339
328
</simpara></listitem>
342
<term><link linkend="goffset">goffset</link> <structfield>length</structfield>;</term>
331
<term><link linkend="goffset">goffset</link> <structfield>length</structfield>;</term>
343
332
<listitem><simpara> length of <parameter>data</parameter>
344
333
</simpara></listitem>
346
335
</variablelist></refsect2>
347
336
<refsect2 id="soup-message-body-new" role="function">
348
337
<title>soup_message_body_new ()</title>
349
<indexterm zone="soup-message-body-new"><primary>soup_message_body_new</primary></indexterm><programlisting><link linkend="SoupMessageBody">SoupMessageBody</link>* soup_message_body_new (void);</programlisting>
338
<indexterm zone="soup-message-body-new"><primary sortas="soup_message_body_new">soup_message_body_new</primary></indexterm><programlisting><link linkend="SoupMessageBody">SoupMessageBody</link> * soup_message_body_new (void);</programlisting>
351
340
Creates a new <link linkend="SoupMessageBody"><type>SoupMessageBody</type></link>. <link linkend="SoupMessage"><type>SoupMessage</type></link> uses this internally; you
352
341
will not normally need to call it yourself.</para>
355
343
</para><variablelist role="params">
356
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a new <link linkend="SoupMessageBody"><type>SoupMessageBody</type></link>.
344
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a new <link linkend="SoupMessageBody"><type>SoupMessageBody</type></link>.
357
345
</simpara></listitem></varlistentry>
358
346
</variablelist></refsect2>
359
347
<refsect2 id="soup-message-body-free" role="function">
360
348
<title>soup_message_body_free ()</title>
361
<indexterm zone="soup-message-body-free"><primary>soup_message_body_free</primary></indexterm><programlisting><link linkend="void">void</link> soup_message_body_free (<link linkend="SoupMessageBody">SoupMessageBody</link> *body);</programlisting>
349
<indexterm zone="soup-message-body-free"><primary sortas="soup_message_body_free">soup_message_body_free</primary></indexterm><programlisting><link linkend="void">void</link> soup_message_body_free (<link linkend="SoupMessageBody">SoupMessageBody</link> *body);</programlisting>
363
351
Frees <parameter>body</parameter>. You will not normally need to use this, as
364
352
<link linkend="SoupMessage"><type>SoupMessage</type></link> frees its associated message bodies automatically.</para>
367
354
</para><variablelist role="params">
368
<varlistentry><term><parameter>body</parameter> :</term>
355
<varlistentry><term><parameter>body</parameter> :</term>
369
356
<listitem><simpara> a <link linkend="SoupMessageBody"><type>SoupMessageBody</type></link>
370
357
</simpara></listitem></varlistentry>
371
358
</variablelist></refsect2>
372
359
<refsect2 id="soup-message-body-set-accumulate" role="function">
373
360
<title>soup_message_body_set_accumulate ()</title>
374
<indexterm zone="soup-message-body-set-accumulate"><primary>soup_message_body_set_accumulate</primary></indexterm><programlisting><link linkend="void">void</link> soup_message_body_set_accumulate (<link linkend="SoupMessageBody">SoupMessageBody</link> *body,
361
<indexterm zone="soup-message-body-set-accumulate"><primary sortas="soup_message_body_set_accumulate">soup_message_body_set_accumulate</primary></indexterm><programlisting><link linkend="void">void</link> soup_message_body_set_accumulate (<link linkend="SoupMessageBody">SoupMessageBody</link> *body,
375
362
<link linkend="gboolean">gboolean</link> accumulate);</programlisting>
377
364
Sets or clears the accumulate flag on <parameter>body</parameter>. (The default value
378
is <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>.)
365
is <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>.)
381
If you set this flag to <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> on an "incoming" message body (that
368
If you set this flag to <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> on an "incoming" message body (that
382
369
is, the <link linkend="response-body"><literal>response_body</literal></link> of a client-side message, or <link linkend="request-body"><literal>request_body</literal></link>
383
370
of a server-side message), this will cause each chunk of the body
384
371
to be discarded after its corresponding <link linkend="SoupMessage-got-chunk"><type>"got_chunk"</type></link>
385
372
signal is emitted. (This is equivalent to setting the deprecated
386
<link linkend="SOUP-MESSAGE-OVERWRITE-CHUNKS:CAPS"><literal>SOUP_MESSAGE_OVERWRITE_CHUNKS</literal></link> flag on the message.)
373
<link linkend="SOUP-MESSAGE-OVERWRITE-CHUNKS--CAPS"><literal>SOUP_MESSAGE_OVERWRITE_CHUNKS</literal></link> flag on the message.)
389
If you set this flag to <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> on an "outgoing" message body (the
376
If you set this flag to <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> on an "outgoing" message body (the
390
377
<link linkend="request-body"><literal>request_body</literal></link> of a client-side message, or <link linkend="response-body"><literal>response_body</literal></link> of a
391
378
server-side message), it will cause each chunk of the body to be
392
379
discarded after its corresponding <link linkend="SoupMessage-wrote-chunk"><type>"wrote_chunk"</type></link> signal
397
384
body is fully sent/received, since the body data will no longer be
401
387
</para><variablelist role="params">
402
<varlistentry><term><parameter>body</parameter> :</term>
388
<varlistentry><term><parameter>body</parameter> :</term>
403
389
<listitem><simpara> a <link linkend="SoupMessageBody"><type>SoupMessageBody</type></link>
404
390
</simpara></listitem></varlistentry>
405
<varlistentry><term><parameter>accumulate</parameter> :</term>
391
<varlistentry><term><parameter>accumulate</parameter> :</term>
406
392
<listitem><simpara> whether or not to accumulate body chunks in <parameter>body</parameter>
407
393
</simpara></listitem></varlistentry>
408
394
</variablelist></refsect2>
409
395
<refsect2 id="soup-message-body-get-accumulate" role="function">
410
396
<title>soup_message_body_get_accumulate ()</title>
411
<indexterm zone="soup-message-body-get-accumulate"><primary>soup_message_body_get_accumulate</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> soup_message_body_get_accumulate (<link linkend="SoupMessageBody">SoupMessageBody</link> *body);</programlisting>
397
<indexterm zone="soup-message-body-get-accumulate"><primary sortas="soup_message_body_get_accumulate">soup_message_body_get_accumulate</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> soup_message_body_get_accumulate (<link linkend="SoupMessageBody">SoupMessageBody</link> *body);</programlisting>
413
399
Gets the accumulate flag on <parameter>body</parameter>; see
414
400
<link linkend="soup-message-body-set-accumulate"><function>soup_message_body_set_accumulate()</function></link> for details.</para>
417
402
</para><variablelist role="params">
418
<varlistentry><term><parameter>body</parameter> :</term>
403
<varlistentry><term><parameter>body</parameter> :</term>
419
404
<listitem><simpara> a <link linkend="SoupMessageBody"><type>SoupMessageBody</type></link>
420
405
</simpara></listitem></varlistentry>
421
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the accumulate flag for <parameter>body</parameter>.
406
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the accumulate flag for <parameter>body</parameter>.
422
407
</simpara></listitem></varlistentry>
423
408
</variablelist></refsect2>
424
409
<refsect2 id="soup-message-body-append" role="function">
425
410
<title>soup_message_body_append ()</title>
426
<indexterm zone="soup-message-body-append"><primary>soup_message_body_append</primary></indexterm><programlisting><link linkend="void">void</link> soup_message_body_append (<link linkend="SoupMessageBody">SoupMessageBody</link> *body,
411
<indexterm zone="soup-message-body-append"><primary sortas="soup_message_body_append">soup_message_body_append</primary></indexterm><programlisting><link linkend="void">void</link> soup_message_body_append (<link linkend="SoupMessageBody">SoupMessageBody</link> *body,
427
412
<link linkend="SoupMemoryUse">SoupMemoryUse</link> use,
428
413
<link linkend="gconstpointer">gconstpointer</link> data,
429
414
<link linkend="gsize">gsize</link> length);</programlisting>
431
416
Appends <parameter>length</parameter> bytes from <parameter>data</parameter> to <parameter>body</parameter> according to <parameter>use</parameter>.</para>
434
418
</para><variablelist role="params">
435
<varlistentry><term><parameter>body</parameter> :</term>
419
<varlistentry><term><parameter>body</parameter> :</term>
436
420
<listitem><simpara> a <link linkend="SoupMessageBody"><type>SoupMessageBody</type></link>
437
421
</simpara></listitem></varlistentry>
438
<varlistentry><term><parameter>use</parameter> :</term>
422
<varlistentry><term><parameter>use</parameter> :</term>
439
423
<listitem><simpara> how to use <parameter>data</parameter>
440
424
</simpara></listitem></varlistentry>
441
<varlistentry><term><parameter>data</parameter> :</term>
425
<varlistentry><term><parameter>data</parameter> :</term>
442
426
<listitem><simpara> data to append
443
427
</simpara></listitem></varlistentry>
444
<varlistentry><term><parameter>length</parameter> :</term>
428
<varlistentry><term><parameter>length</parameter> :</term>
445
429
<listitem><simpara> length of <parameter>data</parameter>
446
430
</simpara></listitem></varlistentry>
447
431
</variablelist></refsect2>
448
432
<refsect2 id="soup-message-body-append-buffer" role="function">
449
433
<title>soup_message_body_append_buffer ()</title>
450
<indexterm zone="soup-message-body-append-buffer"><primary>soup_message_body_append_buffer</primary></indexterm><programlisting><link linkend="void">void</link> soup_message_body_append_buffer (<link linkend="SoupMessageBody">SoupMessageBody</link> *body,
434
<indexterm zone="soup-message-body-append-buffer"><primary sortas="soup_message_body_append_buffer">soup_message_body_append_buffer</primary></indexterm><programlisting><link linkend="void">void</link> soup_message_body_append_buffer (<link linkend="SoupMessageBody">SoupMessageBody</link> *body,
451
435
<link linkend="SoupBuffer">SoupBuffer</link> *buffer);</programlisting>
453
437
Appends the data from <parameter>buffer</parameter> to <parameter>body</parameter>. (<link linkend="SoupMessageBody"><type>SoupMessageBody</type></link> uses
455
439
operation that doesn't actually require copying the data in
456
440
<parameter>buffer</parameter>.)</para>
459
442
</para><variablelist role="params">
460
<varlistentry><term><parameter>body</parameter> :</term>
443
<varlistentry><term><parameter>body</parameter> :</term>
461
444
<listitem><simpara> a <link linkend="SoupMessageBody"><type>SoupMessageBody</type></link>
462
445
</simpara></listitem></varlistentry>
463
<varlistentry><term><parameter>buffer</parameter> :</term>
446
<varlistentry><term><parameter>buffer</parameter> :</term>
464
447
<listitem><simpara> a <link linkend="SoupBuffer"><type>SoupBuffer</type></link>
465
448
</simpara></listitem></varlistentry>
466
449
</variablelist></refsect2>
467
450
<refsect2 id="soup-message-body-truncate" role="function">
468
451
<title>soup_message_body_truncate ()</title>
469
<indexterm zone="soup-message-body-truncate"><primary>soup_message_body_truncate</primary></indexterm><programlisting><link linkend="void">void</link> soup_message_body_truncate (<link linkend="SoupMessageBody">SoupMessageBody</link> *body);</programlisting>
452
<indexterm zone="soup-message-body-truncate"><primary sortas="soup_message_body_truncate">soup_message_body_truncate</primary></indexterm><programlisting><link linkend="void">void</link> soup_message_body_truncate (<link linkend="SoupMessageBody">SoupMessageBody</link> *body);</programlisting>
471
454
Deletes all of the data in <parameter>body</parameter>.</para>
474
456
</para><variablelist role="params">
475
<varlistentry><term><parameter>body</parameter> :</term>
457
<varlistentry><term><parameter>body</parameter> :</term>
476
458
<listitem><simpara> a <link linkend="SoupMessageBody"><type>SoupMessageBody</type></link>
477
459
</simpara></listitem></varlistentry>
478
460
</variablelist></refsect2>
479
461
<refsect2 id="soup-message-body-complete" role="function">
480
462
<title>soup_message_body_complete ()</title>
481
<indexterm zone="soup-message-body-complete"><primary>soup_message_body_complete</primary></indexterm><programlisting><link linkend="void">void</link> soup_message_body_complete (<link linkend="SoupMessageBody">SoupMessageBody</link> *body);</programlisting>
463
<indexterm zone="soup-message-body-complete"><primary sortas="soup_message_body_complete">soup_message_body_complete</primary></indexterm><programlisting><link linkend="void">void</link> soup_message_body_complete (<link linkend="SoupMessageBody">SoupMessageBody</link> *body);</programlisting>
483
465
Tags <parameter>body</parameter> as being complete; Call this when using chunked encoding
484
466
after you have appended the last chunk.</para>
487
468
</para><variablelist role="params">
488
<varlistentry><term><parameter>body</parameter> :</term>
469
<varlistentry><term><parameter>body</parameter> :</term>
489
470
<listitem><simpara> a <link linkend="SoupMessageBody"><type>SoupMessageBody</type></link>
490
471
</simpara></listitem></varlistentry>
491
472
</variablelist></refsect2>
492
473
<refsect2 id="soup-message-body-flatten" role="function">
493
474
<title>soup_message_body_flatten ()</title>
494
<indexterm zone="soup-message-body-flatten"><primary>soup_message_body_flatten</primary></indexterm><programlisting><link linkend="SoupBuffer">SoupBuffer</link>* soup_message_body_flatten (<link linkend="SoupMessageBody">SoupMessageBody</link> *body);</programlisting>
475
<indexterm zone="soup-message-body-flatten"><primary sortas="soup_message_body_flatten">soup_message_body_flatten</primary></indexterm><programlisting><link linkend="SoupBuffer">SoupBuffer</link> * soup_message_body_flatten (<link linkend="SoupMessageBody">SoupMessageBody</link> *body);</programlisting>
496
477
Fills in <parameter>body</parameter>'s data field with a buffer containing all of the
497
478
data in <parameter>body</parameter> (plus an additional '\0' byte not counted by <parameter>body</parameter>'s
498
479
length field).</para>
501
481
</para><variablelist role="params">
502
<varlistentry><term><parameter>body</parameter> :</term>
482
<varlistentry><term><parameter>body</parameter> :</term>
503
483
<listitem><simpara> a <link linkend="SoupMessageBody"><type>SoupMessageBody</type></link>
504
484
</simpara></listitem></varlistentry>
505
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a <link linkend="SoupBuffer"><type>SoupBuffer</type></link> containing the same data as <parameter>body</parameter>.
485
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a <link linkend="SoupBuffer"><type>SoupBuffer</type></link> containing the same data as <parameter>body</parameter>.
506
486
(You must free this buffer if you do not want it.)
507
487
</simpara></listitem></varlistentry>
508
488
</variablelist></refsect2>
509
489
<refsect2 id="soup-message-body-get-chunk" role="function">
510
490
<title>soup_message_body_get_chunk ()</title>
511
<indexterm zone="soup-message-body-get-chunk"><primary>soup_message_body_get_chunk</primary></indexterm><programlisting><link linkend="SoupBuffer">SoupBuffer</link>* soup_message_body_get_chunk (<link linkend="SoupMessageBody">SoupMessageBody</link> *body,
491
<indexterm zone="soup-message-body-get-chunk"><primary sortas="soup_message_body_get_chunk">soup_message_body_get_chunk</primary></indexterm><programlisting><link linkend="SoupBuffer">SoupBuffer</link> * soup_message_body_get_chunk (<link linkend="SoupMessageBody">SoupMessageBody</link> *body,
512
492
<link linkend="goffset">goffset</link> offset);</programlisting>
514
494
Gets a <link linkend="SoupBuffer"><type>SoupBuffer</type></link> containing data from <parameter>body</parameter> starting at <parameter>offset</parameter>.
524
504
<link linkend="soup-message-body-complete"><function>soup_message_body_complete()</function></link> has been called or not; if it has,
525
505
then <link linkend="soup-message-body-get-chunk"><function>soup_message_body_get_chunk()</function></link> will return a 0-length chunk
526
506
(indicating the end of <parameter>body</parameter>). If it has not, then
527
<link linkend="soup-message-body-get-chunk"><function>soup_message_body_get_chunk()</function></link> will return <link linkend="NULL:CAPS"><literal>NULL</literal></link> (indicating that
507
<link linkend="soup-message-body-get-chunk"><function>soup_message_body_get_chunk()</function></link> will return <link linkend="NULL--CAPS"><literal>NULL</literal></link> (indicating that
528
508
<parameter>body</parameter> may still potentially have more data, but that data is not
529
509
currently available).</para>
532
511
</para><variablelist role="params">
533
<varlistentry><term><parameter>body</parameter> :</term>
512
<varlistentry><term><parameter>body</parameter> :</term>
534
513
<listitem><simpara> a <link linkend="SoupMessageBody"><type>SoupMessageBody</type></link>
535
514
</simpara></listitem></varlistentry>
536
<varlistentry><term><parameter>offset</parameter> :</term>
515
<varlistentry><term><parameter>offset</parameter> :</term>
537
516
<listitem><simpara> an offset
538
517
</simpara></listitem></varlistentry>
539
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a <link linkend="SoupBuffer"><type>SoupBuffer</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>.
518
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a <link linkend="SoupBuffer"><type>SoupBuffer</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
540
519
</simpara></listitem></varlistentry>
541
520
</variablelist></refsect2>
542
521
<refsect2 id="soup-message-body-got-chunk" role="function">
543
522
<title>soup_message_body_got_chunk ()</title>
544
<indexterm zone="soup-message-body-got-chunk"><primary>soup_message_body_got_chunk</primary></indexterm><programlisting><link linkend="void">void</link> soup_message_body_got_chunk (<link linkend="SoupMessageBody">SoupMessageBody</link> *body,
523
<indexterm zone="soup-message-body-got-chunk"><primary sortas="soup_message_body_got_chunk">soup_message_body_got_chunk</primary></indexterm><programlisting><link linkend="void">void</link> soup_message_body_got_chunk (<link linkend="SoupMessageBody">SoupMessageBody</link> *body,
545
524
<link linkend="SoupBuffer">SoupBuffer</link> *chunk);</programlisting>
547
526
Handles the <link linkend="SoupMessageBody"><type>SoupMessageBody</type></link> part of receiving a chunk of data from
548
527
the network. Normally this means appending <parameter>chunk</parameter> to <parameter>body</parameter>, exactly
549
528
as with <link linkend="soup-message-body-append-buffer"><function>soup_message_body_append_buffer()</function></link>, but if you have set
550
<parameter>body</parameter>'s accumulate flag to <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>, then that will not happen.
529
<parameter>body</parameter>'s accumulate flag to <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>, then that will not happen.
553
532
This is a low-level method which you should not normally need to
557
535
</para><variablelist role="params">
558
<varlistentry><term><parameter>body</parameter> :</term>
536
<varlistentry><term><parameter>body</parameter> :</term>
559
537
<listitem><simpara> a <link linkend="SoupMessageBody"><type>SoupMessageBody</type></link>
560
538
</simpara></listitem></varlistentry>
561
<varlistentry><term><parameter>chunk</parameter> :</term>
539
<varlistentry><term><parameter>chunk</parameter> :</term>
562
540
<listitem><simpara> a <link linkend="SoupBuffer"><type>SoupBuffer</type></link> received from the network
563
541
</simpara></listitem></varlistentry>
564
542
</variablelist></refsect2>
565
543
<refsect2 id="soup-message-body-wrote-chunk" role="function">
566
544
<title>soup_message_body_wrote_chunk ()</title>
567
<indexterm zone="soup-message-body-wrote-chunk"><primary>soup_message_body_wrote_chunk</primary></indexterm><programlisting><link linkend="void">void</link> soup_message_body_wrote_chunk (<link linkend="SoupMessageBody">SoupMessageBody</link> *body,
545
<indexterm zone="soup-message-body-wrote-chunk"><primary sortas="soup_message_body_wrote_chunk">soup_message_body_wrote_chunk</primary></indexterm><programlisting><link linkend="void">void</link> soup_message_body_wrote_chunk (<link linkend="SoupMessageBody">SoupMessageBody</link> *body,
568
546
<link linkend="SoupBuffer">SoupBuffer</link> *chunk);</programlisting>
570
548
Handles the <link linkend="SoupMessageBody"><type>SoupMessageBody</type></link> part of writing a chunk of data to the
571
549
network. Normally this is a no-op, but if you have set <parameter>body</parameter>'s
572
accumulate flag to <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>, then this will cause <parameter>chunk</parameter> (and any
550
accumulate flag to <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>, then this will cause <parameter>chunk</parameter> (and any
573
551
chunks preceding it in <parameter>body</parameter>) to be discarded to free up memory.
576
554
This is a low-level method which you should not normally need to
580
557
</para><variablelist role="params">
581
<varlistentry><term><parameter>body</parameter> :</term>
558
<varlistentry><term><parameter>body</parameter> :</term>
582
559
<listitem><simpara> a <link linkend="SoupMessageBody"><type>SoupMessageBody</type></link>
583
560
</simpara></listitem></varlistentry>
584
<varlistentry><term><parameter>chunk</parameter> :</term>
561
<varlistentry><term><parameter>chunk</parameter> :</term>
585
562
<listitem><simpara> a <link linkend="SoupBuffer"><type>SoupBuffer</type></link> received from the network
586
563
</simpara></listitem></varlistentry>
587
564
</variablelist></refsect2>