mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-14 19:55:12 +01:00
parent
bd2a9f7ebb
commit
e7992b7b06
@ -191,13 +191,13 @@ g_converter_input_stream_init (GConverterInputStream *stream)
|
||||
*
|
||||
* Creates a new converter input stream for the @base_stream.
|
||||
*
|
||||
* Returns: a new #GConverterInputStream.
|
||||
* Returns: a new #GInputStream.
|
||||
**/
|
||||
GConverterInputStream *
|
||||
GInputStream *
|
||||
g_converter_input_stream_new (GInputStream *base_stream,
|
||||
GConverter *converter)
|
||||
GConverter *converter)
|
||||
{
|
||||
GConverterInputStream *stream;
|
||||
GInputStream *stream;
|
||||
|
||||
g_return_val_if_fail (G_IS_INPUT_STREAM (base_stream), NULL);
|
||||
|
||||
|
@ -71,8 +71,8 @@ struct _GConverterInputStreamClass
|
||||
};
|
||||
|
||||
GType g_converter_input_stream_get_type (void) G_GNUC_CONST;
|
||||
GConverterInputStream *g_converter_input_stream_new (GInputStream *base_stream,
|
||||
GConverter *converter);
|
||||
GInputStream *g_converter_input_stream_new (GInputStream *base_stream,
|
||||
GConverter *converter);
|
||||
GConverter *g_converter_input_stream_get_converter (GConverterInputStream *converter_stream);
|
||||
|
||||
G_END_DECLS
|
||||
|
@ -192,8 +192,8 @@ g_converter_output_stream_get_property (GObject *object,
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
g_converter_output_stream_init (GConverterOutputStream *stream)
|
||||
{
|
||||
@ -208,13 +208,13 @@ g_converter_output_stream_init (GConverterOutputStream *stream)
|
||||
*
|
||||
* Creates a new converter output stream for the @base_stream.
|
||||
*
|
||||
* Returns: a new #GConverterOutputStream.
|
||||
* Returns: a new #GOutputStream.
|
||||
**/
|
||||
GConverterOutputStream *
|
||||
GOutputStream *
|
||||
g_converter_output_stream_new (GOutputStream *base_stream,
|
||||
GConverter *converter)
|
||||
GConverter *converter)
|
||||
{
|
||||
GConverterOutputStream *stream;
|
||||
GOutputStream *stream;
|
||||
|
||||
g_return_val_if_fail (G_IS_OUTPUT_STREAM (base_stream), NULL);
|
||||
|
||||
|
@ -71,8 +71,8 @@ struct _GConverterOutputStreamClass
|
||||
};
|
||||
|
||||
GType g_converter_output_stream_get_type (void) G_GNUC_CONST;
|
||||
GConverterOutputStream *g_converter_output_stream_new (GOutputStream *base_stream,
|
||||
GConverter *converter);
|
||||
GOutputStream *g_converter_output_stream_new (GOutputStream *base_stream,
|
||||
GConverter *converter);
|
||||
GConverter *g_converter_output_stream_get_converter (GConverterOutputStream *converter_stream);
|
||||
|
||||
G_END_DECLS
|
||||
|
@ -298,10 +298,8 @@ test_expander (void)
|
||||
gsize total_read;
|
||||
gssize res;
|
||||
GConverterResult cres;
|
||||
GInputStream *mem;
|
||||
GConverterInputStream *cstream;
|
||||
GOutputStream *mem_out;
|
||||
GConverterOutputStream *cstream_out;
|
||||
GInputStream *mem, *cstream;
|
||||
GOutputStream *mem_out, *cstream_out;
|
||||
GConverter *expander;
|
||||
GError *error;
|
||||
int i;
|
||||
@ -334,7 +332,7 @@ test_expander (void)
|
||||
while (TRUE)
|
||||
{
|
||||
error = NULL;
|
||||
res = g_input_stream_read (G_INPUT_STREAM (cstream),
|
||||
res = g_input_stream_read (cstream,
|
||||
ptr, 1,
|
||||
NULL, &error);
|
||||
g_assert (res != -1);
|
||||
@ -356,7 +354,7 @@ test_expander (void)
|
||||
for (i = 0; i < sizeof(unexpanded_data); i++)
|
||||
{
|
||||
error = NULL;
|
||||
res = g_output_stream_write (G_OUTPUT_STREAM (cstream_out),
|
||||
res = g_output_stream_write (cstream_out,
|
||||
unexpanded_data + i, 1,
|
||||
NULL, &error);
|
||||
g_assert (res != -1);
|
||||
@ -368,7 +366,7 @@ test_expander (void)
|
||||
g_assert (res == 1);
|
||||
}
|
||||
|
||||
g_output_stream_close (G_OUTPUT_STREAM (cstream_out), NULL, NULL);
|
||||
g_output_stream_close (cstream_out, NULL, NULL);
|
||||
|
||||
g_assert (g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (mem_out)) == n_written);
|
||||
g_assert (memcmp (g_memory_output_stream_get_data (G_MEMORY_OUTPUT_STREAM (mem_out)),
|
||||
@ -390,10 +388,8 @@ test_compressor (void)
|
||||
gsize total_read;
|
||||
gssize res;
|
||||
GConverterResult cres;
|
||||
GInputStream *mem;
|
||||
GOutputStream *mem_out;
|
||||
GConverterInputStream *cstream;
|
||||
GConverterOutputStream *cstream_out;
|
||||
GInputStream *mem, *cstream;
|
||||
GOutputStream *mem_out, *cstream_out;
|
||||
GConverter *expander, *compressor;
|
||||
GError *error;
|
||||
int i;
|
||||
@ -424,7 +420,7 @@ test_compressor (void)
|
||||
while (TRUE)
|
||||
{
|
||||
error = NULL;
|
||||
res = g_input_stream_read (G_INPUT_STREAM (cstream),
|
||||
res = g_input_stream_read (cstream,
|
||||
ptr, 1,
|
||||
NULL, &error);
|
||||
g_assert (res != -1);
|
||||
@ -448,7 +444,7 @@ test_compressor (void)
|
||||
for (i = 0; i < expanded_size; i++)
|
||||
{
|
||||
error = NULL;
|
||||
res = g_output_stream_write (G_OUTPUT_STREAM (cstream_out),
|
||||
res = g_output_stream_write (cstream_out,
|
||||
expanded + i, 1,
|
||||
NULL, &error);
|
||||
g_assert (res != -1);
|
||||
@ -460,7 +456,7 @@ test_compressor (void)
|
||||
g_assert (res == 1);
|
||||
}
|
||||
|
||||
g_output_stream_close (G_OUTPUT_STREAM (cstream_out), NULL, NULL);
|
||||
g_output_stream_close (cstream_out, NULL, NULL);
|
||||
|
||||
g_assert (g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (mem_out)) == n_read - 1); /* Last 2 zeros are combined */
|
||||
g_assert (memcmp (g_memory_output_stream_get_data (G_MEMORY_OUTPUT_STREAM (mem_out)),
|
||||
@ -484,7 +480,7 @@ test_compressor (void)
|
||||
while (TRUE)
|
||||
{
|
||||
error = NULL;
|
||||
res = g_input_stream_read (G_INPUT_STREAM (cstream),
|
||||
res = g_input_stream_read (cstream,
|
||||
ptr, 1,
|
||||
NULL, &error);
|
||||
g_assert (res != -1);
|
||||
@ -508,7 +504,7 @@ test_compressor (void)
|
||||
while (TRUE)
|
||||
{
|
||||
error = NULL;
|
||||
res = g_input_stream_read (G_INPUT_STREAM (cstream),
|
||||
res = g_input_stream_read (cstream,
|
||||
ptr, 1,
|
||||
NULL, &error);
|
||||
g_assert (res != -1);
|
||||
@ -537,7 +533,7 @@ test_compressor (void)
|
||||
while (TRUE)
|
||||
{
|
||||
error = NULL;
|
||||
res = g_input_stream_read (G_INPUT_STREAM (cstream),
|
||||
res = g_input_stream_read (cstream,
|
||||
ptr, 1,
|
||||
NULL, &error);
|
||||
if (res == -1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user