@revizly/sharp-libvips-dev 1.0.7 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cplusplus/VImage.cpp +18 -2
- package/cplusplus/vips-operators.cpp +79 -3
- package/include/aom/aom.h +1 -1
- package/include/aom/aom_codec.h +22 -5
- package/include/aom/aom_decoder.h +1 -1
- package/include/aom/aom_encoder.h +5 -1
- package/include/aom/aom_external_partition.h +1 -1
- package/include/aom/aom_frame_buffer.h +1 -1
- package/include/aom/aom_image.h +4 -2
- package/include/aom/aom_integer.h +1 -9
- package/include/aom/aomcx.h +64 -9
- package/include/aom/aomdx.h +1 -1
- package/include/archive.h +2 -2
- package/include/archive_entry.h +7 -1
- package/include/cairo/cairo-version.h +1 -1
- package/include/expat.h +4 -2
- package/include/expat_config.h +3 -6
- package/include/freetype2/freetype/config/ftconfig.h +1 -1
- package/include/freetype2/freetype/config/ftheader.h +1 -1
- package/include/freetype2/freetype/config/ftoption.h +17 -1
- package/include/freetype2/freetype/config/ftstdlib.h +1 -1
- package/include/freetype2/freetype/config/integer-types.h +1 -1
- package/include/freetype2/freetype/config/mac-support.h +1 -1
- package/include/freetype2/freetype/config/public-macros.h +1 -1
- package/include/freetype2/freetype/freetype.h +35 -83
- package/include/freetype2/freetype/ftadvanc.h +1 -1
- package/include/freetype2/freetype/ftbbox.h +1 -1
- package/include/freetype2/freetype/ftbdf.h +1 -1
- package/include/freetype2/freetype/ftbitmap.h +1 -1
- package/include/freetype2/freetype/ftbzip2.h +1 -1
- package/include/freetype2/freetype/ftcache.h +1 -1
- package/include/freetype2/freetype/ftcid.h +1 -1
- package/include/freetype2/freetype/ftcolor.h +1 -1
- package/include/freetype2/freetype/ftdriver.h +75 -1
- package/include/freetype2/freetype/fterrdef.h +1 -1
- package/include/freetype2/freetype/fterrors.h +1 -1
- package/include/freetype2/freetype/ftfntfmt.h +1 -1
- package/include/freetype2/freetype/ftgasp.h +1 -1
- package/include/freetype2/freetype/ftglyph.h +1 -1
- package/include/freetype2/freetype/ftgxval.h +1 -1
- package/include/freetype2/freetype/ftgzip.h +1 -1
- package/include/freetype2/freetype/ftimage.h +17 -12
- package/include/freetype2/freetype/ftincrem.h +1 -1
- package/include/freetype2/freetype/ftlcdfil.h +1 -1
- package/include/freetype2/freetype/ftlist.h +1 -1
- package/include/freetype2/freetype/ftlzw.h +1 -1
- package/include/freetype2/freetype/ftmac.h +1 -1
- package/include/freetype2/freetype/ftmm.h +31 -2
- package/include/freetype2/freetype/ftmodapi.h +1 -1
- package/include/freetype2/freetype/ftmoderr.h +1 -1
- package/include/freetype2/freetype/ftotval.h +1 -1
- package/include/freetype2/freetype/ftoutln.h +2 -2
- package/include/freetype2/freetype/ftparams.h +1 -1
- package/include/freetype2/freetype/ftpfr.h +1 -1
- package/include/freetype2/freetype/ftrender.h +1 -1
- package/include/freetype2/freetype/ftsizes.h +1 -1
- package/include/freetype2/freetype/ftsnames.h +1 -1
- package/include/freetype2/freetype/ftstroke.h +1 -1
- package/include/freetype2/freetype/ftsynth.h +1 -1
- package/include/freetype2/freetype/ftsystem.h +1 -1
- package/include/freetype2/freetype/fttrigon.h +1 -1
- package/include/freetype2/freetype/fttypes.h +1 -1
- package/include/freetype2/freetype/ftwinfnt.h +1 -1
- package/include/freetype2/freetype/otsvg.h +1 -1
- package/include/freetype2/freetype/t1tables.h +1 -59
- package/include/freetype2/freetype/ttnameid.h +1 -1
- package/include/freetype2/freetype/tttables.h +4 -3
- package/include/freetype2/freetype/tttags.h +1 -1
- package/include/freetype2/ft2build.h +1 -1
- package/include/fribidi/fribidi-config.h +2 -2
- package/include/fribidi/fribidi-unicode-version.h +3 -3
- package/include/gio-unix-2.0/gio/gunixmounts.h +97 -23
- package/include/glib-2.0/gio/gappinfo.h +40 -25
- package/include/glib-2.0/gio/gasyncresult.h +1 -1
- package/include/glib-2.0/gio/gfile.h +4 -0
- package/include/glib-2.0/gio/gio-visibility.h +34 -0
- package/include/glib-2.0/gio/gioenums.h +2 -2
- package/include/glib-2.0/gio/gresource.h +6 -0
- package/include/glib-2.0/girepository/gi-visibility.h +34 -0
- package/include/glib-2.0/girepository/gicallableinfo.h +12 -0
- package/include/glib-2.0/girepository/gitypes.h +1 -0
- package/include/glib-2.0/glib/garray.h +1 -1
- package/include/glib-2.0/glib/glib-visibility.h +34 -0
- package/include/glib-2.0/glib/gmacros.h +8 -2
- package/include/glib-2.0/glib/gmain.h +223 -54
- package/include/glib-2.0/glib/gmem.h +3 -0
- package/include/glib-2.0/glib/gqsort.h +8 -1
- package/include/glib-2.0/glib/grefstring.h +4 -0
- package/include/glib-2.0/glib/gstdio.h +65 -0
- package/include/glib-2.0/glib/gstrfuncs.h +4 -0
- package/include/glib-2.0/glib/gstring.h +4 -0
- package/include/glib-2.0/glib/gunicode.h +17 -1
- package/include/glib-2.0/glib/gvariant.h +50 -13
- package/include/glib-2.0/glib/gvarianttype.h +62 -46
- package/include/glib-2.0/glib/gversionmacros.h +9 -0
- package/include/glib-2.0/glib-unix.h +21 -0
- package/include/glib-2.0/gmodule/gmodule-visibility.h +34 -0
- package/include/glib-2.0/gobject/gobject-visibility.h +34 -0
- package/include/glib-2.0/gobject/gobjectnotifyqueue.c +3 -3
- package/include/glib-2.0/gobject/gtype.h +5 -5
- package/include/harfbuzz/hb-buffer.h +7 -0
- package/include/harfbuzz/hb-common.h +18 -0
- package/include/harfbuzz/hb-draw.h +1 -1
- package/include/harfbuzz/hb-face.h +36 -0
- package/include/harfbuzz/hb-ft.h +3 -0
- package/include/harfbuzz/hb-version.h +3 -3
- package/include/libheif/heif.h +485 -34
- package/include/libheif/heif_items.h +237 -0
- package/include/libheif/heif_properties.h +58 -2
- package/include/libheif/heif_regions.h +1 -1
- package/include/libheif/heif_version.h +2 -2
- package/include/libpng16/png.h +13 -13
- package/include/libpng16/pngconf.h +4 -4
- package/include/libpng16/pnglibconf.h +1 -1
- package/include/librsvg-2.0/librsvg/rsvg-version.h +3 -3
- package/include/librsvg-2.0/librsvg/rsvg.h +32 -1
- package/include/libxml2/libxml/parser.h +1 -1
- package/include/libxml2/libxml/xmlexports.h +2 -2
- package/include/libxml2/libxml/xmlversion.h +13 -13
- package/include/pixman-1/pixman-version.h +3 -3
- package/include/png.h +13 -13
- package/include/pngconf.h +4 -4
- package/include/pnglibconf.h +1 -1
- package/include/tiffio.h +11 -11
- package/include/tiffvers.h +4 -4
- package/include/vips/VImage8.h +170 -60
- package/include/vips/arithmetic.h +9 -0
- package/include/vips/basic.h +8 -4
- package/include/vips/buf.h +0 -2
- package/include/vips/connection.h +0 -2
- package/include/vips/conversion.h +0 -3
- package/include/vips/create.h +11 -0
- package/include/vips/enumtypes.h +3 -3
- package/include/vips/foreign.h +4 -18
- package/include/vips/header.h +7 -0
- package/include/vips/image.h +7 -2
- package/include/vips/interpolate.h +2 -3
- package/include/vips/memory.h +19 -1
- package/include/vips/operation.h +2 -7
- package/include/vips/private.h +7 -0
- package/include/vips/util.h +7 -17
- package/include/vips/version.h +8 -8
- package/include/vips/vips.h +11 -5
- package/include/vips/vips8 +19 -12
- package/include/zlib.h +3 -3
- package/package.json +1 -1
- package/versions.json +16 -16
|
@@ -187,7 +187,7 @@ GPtrArray* g_ptr_array_new_from_null_terminated_array (gpointer *data,
|
|
|
187
187
|
GDestroyNotify element_free_func);
|
|
188
188
|
GLIB_AVAILABLE_IN_ALL
|
|
189
189
|
gpointer* g_ptr_array_free (GPtrArray *array,
|
|
190
|
-
gboolean
|
|
190
|
+
gboolean free_segment);
|
|
191
191
|
GLIB_AVAILABLE_IN_ALL
|
|
192
192
|
GPtrArray* g_ptr_array_ref (GPtrArray *array);
|
|
193
193
|
GLIB_AVAILABLE_IN_ALL
|
|
@@ -1018,3 +1018,37 @@
|
|
|
1018
1018
|
#define GLIB_AVAILABLE_ENUMERATOR_IN_2_82
|
|
1019
1019
|
#define GLIB_AVAILABLE_TYPE_IN_2_82
|
|
1020
1020
|
#endif
|
|
1021
|
+
|
|
1022
|
+
#if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_84
|
|
1023
|
+
#define GLIB_DEPRECATED_IN_2_84 GLIB_DEPRECATED
|
|
1024
|
+
#define GLIB_DEPRECATED_IN_2_84_FOR(f) GLIB_DEPRECATED_FOR (f)
|
|
1025
|
+
#define GLIB_DEPRECATED_MACRO_IN_2_84 GLIB_DEPRECATED_MACRO
|
|
1026
|
+
#define GLIB_DEPRECATED_MACRO_IN_2_84_FOR(f) GLIB_DEPRECATED_MACRO_FOR (f)
|
|
1027
|
+
#define GLIB_DEPRECATED_ENUMERATOR_IN_2_84 GLIB_DEPRECATED_ENUMERATOR
|
|
1028
|
+
#define GLIB_DEPRECATED_ENUMERATOR_IN_2_84_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR (f)
|
|
1029
|
+
#define GLIB_DEPRECATED_TYPE_IN_2_84 GLIB_DEPRECATED_TYPE
|
|
1030
|
+
#define GLIB_DEPRECATED_TYPE_IN_2_84_FOR(f) GLIB_DEPRECATED_TYPE_FOR (f)
|
|
1031
|
+
#else
|
|
1032
|
+
#define GLIB_DEPRECATED_IN_2_84 _GLIB_EXTERN
|
|
1033
|
+
#define GLIB_DEPRECATED_IN_2_84_FOR(f) _GLIB_EXTERN
|
|
1034
|
+
#define GLIB_DEPRECATED_MACRO_IN_2_84
|
|
1035
|
+
#define GLIB_DEPRECATED_MACRO_IN_2_84_FOR(f)
|
|
1036
|
+
#define GLIB_DEPRECATED_ENUMERATOR_IN_2_84
|
|
1037
|
+
#define GLIB_DEPRECATED_ENUMERATOR_IN_2_84_FOR(f)
|
|
1038
|
+
#define GLIB_DEPRECATED_TYPE_IN_2_84
|
|
1039
|
+
#define GLIB_DEPRECATED_TYPE_IN_2_84_FOR(f)
|
|
1040
|
+
#endif
|
|
1041
|
+
|
|
1042
|
+
#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_84
|
|
1043
|
+
#define GLIB_AVAILABLE_IN_2_84 GLIB_UNAVAILABLE (2, 84)
|
|
1044
|
+
#define GLIB_AVAILABLE_STATIC_INLINE_IN_2_84 GLIB_UNAVAILABLE_STATIC_INLINE (2, 84)
|
|
1045
|
+
#define GLIB_AVAILABLE_MACRO_IN_2_84 GLIB_UNAVAILABLE_MACRO (2, 84)
|
|
1046
|
+
#define GLIB_AVAILABLE_ENUMERATOR_IN_2_84 GLIB_UNAVAILABLE_ENUMERATOR (2, 84)
|
|
1047
|
+
#define GLIB_AVAILABLE_TYPE_IN_2_84 GLIB_UNAVAILABLE_TYPE (2, 84)
|
|
1048
|
+
#else
|
|
1049
|
+
#define GLIB_AVAILABLE_IN_2_84 _GLIB_EXTERN
|
|
1050
|
+
#define GLIB_AVAILABLE_STATIC_INLINE_IN_2_84
|
|
1051
|
+
#define GLIB_AVAILABLE_MACRO_IN_2_84
|
|
1052
|
+
#define GLIB_AVAILABLE_ENUMERATOR_IN_2_84
|
|
1053
|
+
#define GLIB_AVAILABLE_TYPE_IN_2_84
|
|
1054
|
+
#endif
|
|
@@ -190,6 +190,8 @@
|
|
|
190
190
|
#define g_macro__has_attribute_fallthrough G_GNUC_CHECK_VERSION (6, 0)
|
|
191
191
|
#define g_macro__has_attribute_may_alias G_GNUC_CHECK_VERSION (3, 3)
|
|
192
192
|
#define g_macro__has_attribute_warn_unused_result G_GNUC_CHECK_VERSION (3, 4)
|
|
193
|
+
#define g_macro__has_attribute_no_sanitize_address 0
|
|
194
|
+
#define g_macro__has_attribute_ifunc 0
|
|
193
195
|
|
|
194
196
|
#endif
|
|
195
197
|
|
|
@@ -861,9 +863,10 @@
|
|
|
861
863
|
#define G_STRINGIFY(macro_or_string) G_STRINGIFY_ARG (macro_or_string)
|
|
862
864
|
#define G_STRINGIFY_ARG(contents) #contents
|
|
863
865
|
|
|
864
|
-
#ifndef __GI_SCANNER__ /* The static assert macro really confuses the introspection parser */
|
|
865
866
|
#define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
|
|
866
867
|
#define G_PASTE(identifier1,identifier2) G_PASTE_ARGS (identifier1, identifier2)
|
|
868
|
+
|
|
869
|
+
#ifndef __GI_SCANNER__ /* The static assert macro really confuses the introspection parser */
|
|
867
870
|
#if G_CXX_STD_CHECK_VERSION (11)
|
|
868
871
|
#define G_STATIC_ASSERT(expr) static_assert (expr, "Expression evaluates to false")
|
|
869
872
|
#elif (G_C_STD_CHECK_VERSION (11) || \
|
|
@@ -877,7 +880,10 @@
|
|
|
877
880
|
#endif
|
|
878
881
|
#endif /* G_CXX_STD_CHECK_VERSION (11) */
|
|
879
882
|
#define G_STATIC_ASSERT_EXPR(expr) ((void) sizeof (char[(expr) ? 1 : -1]))
|
|
880
|
-
#
|
|
883
|
+
#else /* __GI_SCANNER__ */
|
|
884
|
+
#define G_STATIC_ASSERT(expr) static int G_PASTE (_GStaticAssertGiScannerNoop, __LINE__) G_GNUC_UNUSED
|
|
885
|
+
#define G_STATIC_ASSERT_EXPR(expr) static int G_PASTE (_GStaticAssertGiScannerNoop, __LINE__) G_GNUC_UNUSED
|
|
886
|
+
#endif /* __GI_SCANNER__ */
|
|
881
887
|
|
|
882
888
|
/* Provide a string identifying the current code position */
|
|
883
889
|
#if defined (__GNUC__) && (__GNUC__ < 3) && !defined (G_CXX_STD_VERSION)
|
|
@@ -48,8 +48,8 @@ typedef enum /*< flags >*/
|
|
|
48
48
|
* `g_main_context_{prepare,query,check,dispatch}` to integrate GMainContext in
|
|
49
49
|
* other event loops.
|
|
50
50
|
*
|
|
51
|
-
* Flags to pass to
|
|
52
|
-
* of a
|
|
51
|
+
* Flags to pass to [ctor@GLib.MainContext.new_with_flags] which affect the
|
|
52
|
+
* behaviour of a [struct@GLib.MainContext].
|
|
53
53
|
*
|
|
54
54
|
* Since: 2.72
|
|
55
55
|
*/
|
|
@@ -121,15 +121,17 @@ typedef struct _GSourceCallbackFuncs GSourceCallbackFuncs;
|
|
|
121
121
|
* %TRUE in either its @prepare or its @check function, or if a ready time
|
|
122
122
|
* has been reached. The @dispatch function receives a callback function and
|
|
123
123
|
* user data. The callback function may be %NULL if the source was never
|
|
124
|
-
* connected to a callback using
|
|
125
|
-
* function should call the callback function with @user_data and
|
|
126
|
-
* additional parameters are needed for this type of event source.
|
|
127
|
-
* return value of the @dispatch function should be
|
|
128
|
-
* source should be removed or
|
|
124
|
+
* connected to a callback using [method@GLib.Source.set_callback]. The
|
|
125
|
+
* @dispatch function should call the callback function with @user_data and
|
|
126
|
+
* whatever additional parameters are needed for this type of event source.
|
|
127
|
+
* The return value of the @dispatch function should be
|
|
128
|
+
* [const@GLib.SOURCE_REMOVE] if the source should be removed or
|
|
129
|
+
* [const@GLib.SOURCE_CONTINUE] to keep it.
|
|
129
130
|
* @finalize: Called when the source is finalized. At this point, the source
|
|
130
131
|
* will have been destroyed, had its callback cleared, and have been removed
|
|
131
|
-
* from its
|
|
132
|
-
* so methods can be called on it from within this
|
|
132
|
+
* from its [struct@GLib.MainContext], but it will still have its final
|
|
133
|
+
* reference count, so methods can be called on it from within this
|
|
134
|
+
* function.
|
|
133
135
|
*
|
|
134
136
|
* The `GSourceFuncs` struct contains a table of
|
|
135
137
|
* functions used to handle event sources in a generic manner.
|
|
@@ -182,15 +184,17 @@ typedef struct _GSourceFuncs GSourceFuncs;
|
|
|
182
184
|
* @user_data: data passed to the function, set when the source was
|
|
183
185
|
* created with one of the above functions
|
|
184
186
|
*
|
|
185
|
-
* Specifies the type of function passed to
|
|
186
|
-
*
|
|
187
|
+
* Specifies the type of function passed to [func@GLib.timeout_add],
|
|
188
|
+
* [func@GLib.timeout_add_full], [func@GLib.idle_add], and
|
|
189
|
+
* [func@GLib.idle_add_full].
|
|
187
190
|
*
|
|
188
|
-
* When calling
|
|
189
|
-
* different type to this type. Use
|
|
190
|
-
* incompatible function types.
|
|
191
|
+
* When calling [method@GLib.Source.set_callback], you may need to cast a
|
|
192
|
+
* function of a different type to this type. Use [func@GLib.SOURCE_FUNC] to
|
|
193
|
+
* avoid warnings about incompatible function types.
|
|
191
194
|
*
|
|
192
|
-
* Returns: %FALSE if the source should be removed.
|
|
193
|
-
*
|
|
195
|
+
* Returns: %FALSE if the source should be removed.
|
|
196
|
+
* [const@GLib.SOURCE_CONTINUE] and [const@GLib.SOURCE_REMOVE] are more
|
|
197
|
+
* memorable names for the return value.
|
|
194
198
|
*/
|
|
195
199
|
typedef gboolean (*GSourceFunc) (gpointer user_data);
|
|
196
200
|
|
|
@@ -202,7 +206,7 @@ typedef gboolean (*GSourceFunc) (gpointer user_data);
|
|
|
202
206
|
* A source function that is only called once before being removed from the main
|
|
203
207
|
* context automatically.
|
|
204
208
|
*
|
|
205
|
-
* See:
|
|
209
|
+
* See: [func@GLib.idle_add_once], [func@GLib.timeout_add_once]
|
|
206
210
|
*
|
|
207
211
|
* Since: 2.74
|
|
208
212
|
*/
|
|
@@ -212,15 +216,16 @@ typedef void (* GSourceOnceFunc) (gpointer user_data);
|
|
|
212
216
|
* G_SOURCE_FUNC:
|
|
213
217
|
* @f: a function pointer.
|
|
214
218
|
*
|
|
215
|
-
* Cast a function pointer to a
|
|
216
|
-
* onwards with `-Wextra` or `-Wcast-function-type` enabled
|
|
217
|
-
* types being incompatible.
|
|
219
|
+
* Cast a function pointer to a [callback@GLib.SourceFunc], suppressing
|
|
220
|
+
* warnings from GCC 8 onwards with `-Wextra` or `-Wcast-function-type` enabled
|
|
221
|
+
* about the function types being incompatible.
|
|
218
222
|
*
|
|
219
223
|
* For example, the correct type of callback for a source created by
|
|
220
|
-
*
|
|
221
|
-
* than
|
|
222
|
-
*
|
|
223
|
-
* back to the correct type before it is
|
|
224
|
+
* [func@GLib.child_watch_source_new] is #GChildWatchFunc, which accepts more
|
|
225
|
+
* arguments than [callback@GLib.SourceFunc]. Casting the function with
|
|
226
|
+
* `(GSourceFunc)` to call [method@GLib.Source.set_callback] will trigger a
|
|
227
|
+
* warning, even though it will be cast back to the correct type before it is
|
|
228
|
+
* called by the source.
|
|
224
229
|
*
|
|
225
230
|
* Since: 2.58
|
|
226
231
|
*/
|
|
@@ -231,13 +236,13 @@ typedef void (* GSourceOnceFunc) (gpointer user_data);
|
|
|
231
236
|
* @pid: the process id of the child process
|
|
232
237
|
* @wait_status: Status information about the child process, encoded
|
|
233
238
|
* in a platform-specific manner
|
|
234
|
-
* @user_data: user data passed to
|
|
239
|
+
* @user_data: user data passed to [func@GLib.child_watch_add]
|
|
235
240
|
*
|
|
236
241
|
* Prototype of a #GChildWatchSource callback, called when a child
|
|
237
242
|
* process has exited.
|
|
238
243
|
*
|
|
239
|
-
* To interpret @wait_status, see the documentation
|
|
240
|
-
*
|
|
244
|
+
* To interpret @wait_status, see the documentation for
|
|
245
|
+
* [func@GLib.spawn_check_wait_status]. In particular,
|
|
241
246
|
* on Unix platforms, note that it is usually not equal
|
|
242
247
|
* to the integer passed to `exit()` or returned from `main()`.
|
|
243
248
|
*/
|
|
@@ -250,8 +255,8 @@ typedef void (*GChildWatchFunc) (GPid pid,
|
|
|
250
255
|
* GSourceDisposeFunc:
|
|
251
256
|
* @source: #GSource that is currently being disposed
|
|
252
257
|
*
|
|
253
|
-
* Dispose function for @source. See
|
|
254
|
-
* details.
|
|
258
|
+
* Dispose function for @source. See [method@GLib.Source.set_dispose_function]
|
|
259
|
+
* for details.
|
|
255
260
|
*
|
|
256
261
|
* Since: 2.64
|
|
257
262
|
*/
|
|
@@ -301,15 +306,101 @@ struct _GSourceCallbackFuncs
|
|
|
301
306
|
*/
|
|
302
307
|
typedef void (*GSourceDummyMarshal) (void);
|
|
303
308
|
|
|
309
|
+
/**
|
|
310
|
+
* GSourceFuncsPrepareFunc:
|
|
311
|
+
* @source: The #GSource
|
|
312
|
+
* @timeout_: (out) (optional): the maximum timeout (in milliseconds) which should be passed to the poll call
|
|
313
|
+
*
|
|
314
|
+
* Checks the source for readiness.
|
|
315
|
+
*
|
|
316
|
+
* Called before all the file descriptors are polled. If the
|
|
317
|
+
* source can determine that it is ready here (without waiting for the
|
|
318
|
+
* results of the poll call) it should return %TRUE. It can also return
|
|
319
|
+
* a @timeout_ value which should be the maximum timeout (in milliseconds)
|
|
320
|
+
* which should be passed to the poll call. The actual timeout used will
|
|
321
|
+
* be `-1` if all sources returned `-1`, or it will be the minimum of all
|
|
322
|
+
* the @timeout_ values returned which were greater than or equal to `0`.
|
|
323
|
+
* If the prepare function returns a timeout and the source also has a
|
|
324
|
+
* ready time set, then the lower of the two will be used.
|
|
325
|
+
*
|
|
326
|
+
* Since 2.36 this may be `NULL`, in which case the effect is as if the
|
|
327
|
+
* function always returns `FALSE` with a timeout of `-1`.
|
|
328
|
+
*
|
|
329
|
+
* Returns: %TRUE if the source is ready, %FALSE otherwise
|
|
330
|
+
*
|
|
331
|
+
* Since: 2.82
|
|
332
|
+
*/
|
|
333
|
+
typedef gboolean (*GSourceFuncsPrepareFunc) (GSource *source,
|
|
334
|
+
gint *timeout_);
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* GSourceFuncsCheckFunc:
|
|
338
|
+
* @source: The #GSource
|
|
339
|
+
*
|
|
340
|
+
* Checks if the source is ready to be dispatched.
|
|
341
|
+
*
|
|
342
|
+
* Called after all the file descriptors are polled. The source
|
|
343
|
+
* should return %TRUE if it is ready to be dispatched. Note that some
|
|
344
|
+
* time may have passed since the previous prepare function was called,
|
|
345
|
+
* so the source should be checked again here.
|
|
346
|
+
*
|
|
347
|
+
* Since 2.36 this may be `NULL`, in which case the effect is
|
|
348
|
+
* as if the function always returns `FALSE`.
|
|
349
|
+
*
|
|
350
|
+
* Returns: %TRUE if ready to be dispatched, %FALSE otherwise
|
|
351
|
+
*
|
|
352
|
+
* Since: 2.82
|
|
353
|
+
*/
|
|
354
|
+
typedef gboolean (*GSourceFuncsCheckFunc) (GSource *source);
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* GSourceFuncsDispatchFunc:
|
|
358
|
+
* @source: The #GSource
|
|
359
|
+
* @callback: (nullable): The #GSourceFunc to call
|
|
360
|
+
* @user_data: (nullable): data to pass to @callback
|
|
361
|
+
*
|
|
362
|
+
* Dispatches the source callback.
|
|
363
|
+
*
|
|
364
|
+
* Called to dispatch the event source, after it has returned
|
|
365
|
+
* `TRUE` in either its prepare or its check function, or if a ready time
|
|
366
|
+
* has been reached. The dispatch function receives a callback function and
|
|
367
|
+
* user data. The callback function may be `NULL` if the source was never
|
|
368
|
+
* connected to a callback using [method@GLib.Source.set_callback]. The dispatch
|
|
369
|
+
* function should call the callback function with @user_data and whatever
|
|
370
|
+
* additional parameters are needed for this type of event source. The
|
|
371
|
+
* return value of the dispatch function should be [const@GLib.SOURCE_REMOVE]
|
|
372
|
+
* if the source should be removed or [const@GLib.SOURCE_CONTINUE] to keep it.
|
|
373
|
+
*
|
|
374
|
+
* Returns: [const@GLib.SOURCE_REMOVE] if the source should be removed,
|
|
375
|
+
* [const@GLib.SOURCE_CONTINUE] otherwise.
|
|
376
|
+
*
|
|
377
|
+
* Since: 2.82
|
|
378
|
+
*/
|
|
379
|
+
typedef gboolean (*GSourceFuncsDispatchFunc) (GSource *source,
|
|
380
|
+
GSourceFunc callback,
|
|
381
|
+
gpointer user_data);
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* GSourceFuncsFinalizeFunc:
|
|
385
|
+
* @source: The #GSource
|
|
386
|
+
*
|
|
387
|
+
* Finalizes the source.
|
|
388
|
+
*
|
|
389
|
+
* Called when the source is finalized. At this point, the source
|
|
390
|
+
* will have been destroyed, had its callback cleared, and have been removed
|
|
391
|
+
* from its [type@GLib.MainContext], but it will still have its final reference
|
|
392
|
+
* count, so methods can be called on it from within this function.
|
|
393
|
+
*
|
|
394
|
+
* Since: 2.82
|
|
395
|
+
*/
|
|
396
|
+
typedef void (*GSourceFuncsFinalizeFunc) (GSource *source);
|
|
397
|
+
|
|
304
398
|
struct _GSourceFuncs
|
|
305
399
|
{
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
GSourceFunc callback,
|
|
311
|
-
gpointer user_data);
|
|
312
|
-
void (*finalize) (GSource *source); /* Can be NULL */
|
|
400
|
+
GSourceFuncsPrepareFunc prepare; /* Can be NULL */
|
|
401
|
+
GSourceFuncsCheckFunc check; /* Can be NULL */
|
|
402
|
+
GSourceFuncsDispatchFunc dispatch;
|
|
403
|
+
GSourceFuncsFinalizeFunc finalize; /* Can be NULL */
|
|
313
404
|
|
|
314
405
|
/*< private >*/
|
|
315
406
|
/* For use by g_source_set_closure */
|
|
@@ -334,7 +425,7 @@ struct _GSourceFuncs
|
|
|
334
425
|
* Use this for default priority event sources.
|
|
335
426
|
*
|
|
336
427
|
* In GLib this priority is used when adding timeout functions
|
|
337
|
-
* with
|
|
428
|
+
* with [func@GLib.timeout_add]. In GDK this priority is used for events
|
|
338
429
|
* from the X server.
|
|
339
430
|
*/
|
|
340
431
|
#define G_PRIORITY_DEFAULT 0
|
|
@@ -357,7 +448,7 @@ struct _GSourceFuncs
|
|
|
357
448
|
* Use this for default priority idle functions.
|
|
358
449
|
*
|
|
359
450
|
* In GLib this priority is used when adding idle functions with
|
|
360
|
-
*
|
|
451
|
+
* [func@GLib.idle_add].
|
|
361
452
|
*/
|
|
362
453
|
#define G_PRIORITY_DEFAULT_IDLE 200
|
|
363
454
|
|
|
@@ -373,8 +464,8 @@ struct _GSourceFuncs
|
|
|
373
464
|
/**
|
|
374
465
|
* G_SOURCE_REMOVE:
|
|
375
466
|
*
|
|
376
|
-
* Use this macro as the return value of a
|
|
377
|
-
* the
|
|
467
|
+
* Use this macro as the return value of a [callback@GLib.SourceFunc] to remove
|
|
468
|
+
* the [struct@GLib.Source] from the main loop.
|
|
378
469
|
*
|
|
379
470
|
* Since: 2.32
|
|
380
471
|
*/
|
|
@@ -383,8 +474,8 @@ struct _GSourceFuncs
|
|
|
383
474
|
/**
|
|
384
475
|
* G_SOURCE_CONTINUE:
|
|
385
476
|
*
|
|
386
|
-
* Use this macro as the return value of a
|
|
387
|
-
* the
|
|
477
|
+
* Use this macro as the return value of a [callback@GLib.SourceFunc] to leave
|
|
478
|
+
* the [struct@GLib.Source] in the main loop.
|
|
388
479
|
*
|
|
389
480
|
* Since: 2.32
|
|
390
481
|
*/
|
|
@@ -502,13 +593,13 @@ typedef void GMainContextPusher GLIB_AVAILABLE_TYPE_IN_2_64;
|
|
|
502
593
|
* @main_context: (transfer none): a main context to push
|
|
503
594
|
*
|
|
504
595
|
* Push @main_context as the new thread-default main context for the current
|
|
505
|
-
* thread, using
|
|
506
|
-
*
|
|
507
|
-
*
|
|
508
|
-
*
|
|
596
|
+
* thread, using [method@GLib.MainContext.push_thread_default], and return a
|
|
597
|
+
* new [alias@GLib.MainContextPusher]. Pop with g_main_context_pusher_free().
|
|
598
|
+
* Using [method@GLib.MainContext.pop_thread_default] on @main_context while a
|
|
599
|
+
* [alias@GLib.MainContextPusher] exists for it can lead to undefined behaviour.
|
|
509
600
|
*
|
|
510
|
-
* Using two
|
|
511
|
-
* to an undefined pop order.
|
|
601
|
+
* Using two [alias@GLib.MainContextPusher]s in the same scope is not allowed,
|
|
602
|
+
* as it leads to an undefined pop order.
|
|
512
603
|
*
|
|
513
604
|
* This is intended to be used with g_autoptr(). Note that g_autoptr()
|
|
514
605
|
* is only available when using GCC or clang, so the following example
|
|
@@ -543,6 +634,9 @@ typedef void GMainContextPusher GLIB_AVAILABLE_TYPE_IN_2_64;
|
|
|
543
634
|
* Since: 2.64
|
|
544
635
|
*/
|
|
545
636
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
|
637
|
+
GLIB_AVAILABLE_STATIC_INLINE_IN_2_64
|
|
638
|
+
static inline GMainContextPusher *g_main_context_pusher_new (GMainContext *main_context);
|
|
639
|
+
|
|
546
640
|
GLIB_AVAILABLE_STATIC_INLINE_IN_2_64
|
|
547
641
|
static inline GMainContextPusher *
|
|
548
642
|
g_main_context_pusher_new (GMainContext *main_context)
|
|
@@ -559,12 +653,15 @@ G_GNUC_END_IGNORE_DEPRECATIONS
|
|
|
559
653
|
* Pop @pusher’s main context as the thread default main context.
|
|
560
654
|
* See g_main_context_pusher_new() for details.
|
|
561
655
|
*
|
|
562
|
-
* This will pop the
|
|
563
|
-
* but will not call
|
|
656
|
+
* This will pop the [struct@GLib.MainContext] as the current thread-default
|
|
657
|
+
* main context, but will not call [method@GLib.MainContext.unref] on it.
|
|
564
658
|
*
|
|
565
659
|
* Since: 2.64
|
|
566
660
|
*/
|
|
567
661
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
|
662
|
+
GLIB_AVAILABLE_STATIC_INLINE_IN_2_64
|
|
663
|
+
static inline void g_main_context_pusher_free (GMainContextPusher *pusher);
|
|
664
|
+
|
|
568
665
|
GLIB_AVAILABLE_STATIC_INLINE_IN_2_64
|
|
569
666
|
static inline void
|
|
570
667
|
g_main_context_pusher_free (GMainContextPusher *pusher)
|
|
@@ -747,10 +844,10 @@ gboolean g_source_remove_by_funcs_user_data (GSourceFuncs *funcs,
|
|
|
747
844
|
* GClearHandleFunc:
|
|
748
845
|
* @handle_id: the handle ID to clear
|
|
749
846
|
*
|
|
750
|
-
* Specifies the type of function passed to
|
|
751
|
-
*
|
|
752
|
-
*
|
|
753
|
-
*
|
|
847
|
+
* Specifies the type of function passed to [func@GLib.clear_handle_id] The
|
|
848
|
+
* implementation is expected to free the resource identified by @handle_id;
|
|
849
|
+
* for instance, if @handle_id is a [struct@GLib.Source] ID,
|
|
850
|
+
* [func@GLib.Source.remove] can be used.
|
|
754
851
|
*
|
|
755
852
|
* Since: 2.56
|
|
756
853
|
*/
|
|
@@ -775,6 +872,54 @@ void g_clear_handle_id (guint *tag_ptr,
|
|
|
775
872
|
} G_STMT_END \
|
|
776
873
|
GLIB_AVAILABLE_MACRO_IN_2_56
|
|
777
874
|
|
|
875
|
+
/**
|
|
876
|
+
* g_steal_handle_id:
|
|
877
|
+
* @handle_pointer: (inout) (not optional): a pointer to a handle ID
|
|
878
|
+
*
|
|
879
|
+
* Sets @handle_pointer to `0`, returning the value that was there before.
|
|
880
|
+
*
|
|
881
|
+
* Conceptually, this transfers the ownership of the handle ID from the
|
|
882
|
+
* referenced variable to the ‘caller’ of the macro (ie: ‘steals’ the
|
|
883
|
+
* handle ID).
|
|
884
|
+
*
|
|
885
|
+
* This can be very useful to make ownership transfer explicit, or to prevent
|
|
886
|
+
* a handle from being released multiple times. For example:
|
|
887
|
+
*
|
|
888
|
+
* ```c
|
|
889
|
+
* void
|
|
890
|
+
* maybe_unsubscribe_signal (ContextStruct *data)
|
|
891
|
+
* {
|
|
892
|
+
* if (some_complex_logic (data))
|
|
893
|
+
* {
|
|
894
|
+
* g_dbus_connection_signal_unsubscribe (data->connection,
|
|
895
|
+
* g_steal_handle_id (&data->subscription_id));
|
|
896
|
+
* // now data->subscription_id isn’t a dangling handle
|
|
897
|
+
* }
|
|
898
|
+
* }
|
|
899
|
+
* ```
|
|
900
|
+
*
|
|
901
|
+
* While [func@GLib.clear_handle_id] can be used in many of the same situations
|
|
902
|
+
* as `g_steal_handle_id()`, this is one situation where it cannot be used, as
|
|
903
|
+
* there is no way to pass the `GDBusConnection` to a
|
|
904
|
+
* [type@GLib.ClearHandleFunc].
|
|
905
|
+
*
|
|
906
|
+
* Since: 2.84
|
|
907
|
+
*/
|
|
908
|
+
GLIB_AVAILABLE_STATIC_INLINE_IN_2_84
|
|
909
|
+
static inline unsigned int g_steal_handle_id (unsigned int *handle_pointer);
|
|
910
|
+
|
|
911
|
+
GLIB_AVAILABLE_STATIC_INLINE_IN_2_84
|
|
912
|
+
static inline unsigned int
|
|
913
|
+
g_steal_handle_id (unsigned int *handle_pointer)
|
|
914
|
+
{
|
|
915
|
+
unsigned int handle;
|
|
916
|
+
|
|
917
|
+
handle = *handle_pointer;
|
|
918
|
+
*handle_pointer = 0;
|
|
919
|
+
|
|
920
|
+
return handle;
|
|
921
|
+
}
|
|
922
|
+
|
|
778
923
|
/* Idles, child watchers and timeouts */
|
|
779
924
|
GLIB_AVAILABLE_IN_ALL
|
|
780
925
|
guint g_timeout_add_full (gint priority,
|
|
@@ -839,6 +984,30 @@ void g_main_context_invoke (GMainContext *context,
|
|
|
839
984
|
GSourceFunc function,
|
|
840
985
|
gpointer data);
|
|
841
986
|
|
|
987
|
+
/**
|
|
988
|
+
* g_steal_fd:
|
|
989
|
+
* @fd_ptr: (not optional) (inout): A pointer to a file descriptor
|
|
990
|
+
*
|
|
991
|
+
* Sets @fd_ptr to `-1`, returning the value that was there before.
|
|
992
|
+
*
|
|
993
|
+
* Conceptually, this transfers the ownership of the file descriptor
|
|
994
|
+
* from the referenced variable to the caller of the function (i.e.
|
|
995
|
+
* ‘steals’ the reference). This is very similar to [func@GLib.steal_pointer],
|
|
996
|
+
* but for file descriptors.
|
|
997
|
+
*
|
|
998
|
+
* On POSIX platforms, this function is async-signal safe
|
|
999
|
+
* (see [`signal(7)`](man:signal(7)) and
|
|
1000
|
+
* [`signal-safety(7)`](man:signal-safety(7))), making it safe to call from a
|
|
1001
|
+
* signal handler or a #GSpawnChildSetupFunc.
|
|
1002
|
+
*
|
|
1003
|
+
* This function preserves the value of `errno`.
|
|
1004
|
+
*
|
|
1005
|
+
* Returns: the value that @fd_ptr previously had
|
|
1006
|
+
* Since: 2.70
|
|
1007
|
+
*/
|
|
1008
|
+
GLIB_AVAILABLE_STATIC_INLINE_IN_2_70
|
|
1009
|
+
static inline int g_steal_fd (int *fd_ptr);
|
|
1010
|
+
|
|
842
1011
|
GLIB_AVAILABLE_STATIC_INLINE_IN_2_70
|
|
843
1012
|
static inline int
|
|
844
1013
|
g_steal_fd (int *fd_ptr)
|
|
@@ -229,6 +229,9 @@ void g_aligned_free_sized (gpointer mem,
|
|
|
229
229
|
*
|
|
230
230
|
* Since: 2.44
|
|
231
231
|
*/
|
|
232
|
+
GLIB_AVAILABLE_STATIC_INLINE_IN_2_44
|
|
233
|
+
static inline gpointer g_steal_pointer (gpointer pp);
|
|
234
|
+
|
|
232
235
|
GLIB_AVAILABLE_STATIC_INLINE_IN_2_44
|
|
233
236
|
static inline gpointer
|
|
234
237
|
g_steal_pointer (gpointer pp)
|
|
@@ -35,13 +35,20 @@
|
|
|
35
35
|
|
|
36
36
|
G_BEGIN_DECLS
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
GLIB_DEPRECATED_IN_2_82_FOR(g_sort_array)
|
|
39
39
|
void g_qsort_with_data (gconstpointer pbase,
|
|
40
40
|
gint total_elems,
|
|
41
41
|
gsize size,
|
|
42
42
|
GCompareDataFunc compare_func,
|
|
43
43
|
gpointer user_data);
|
|
44
44
|
|
|
45
|
+
GLIB_AVAILABLE_IN_2_82
|
|
46
|
+
void g_sort_array (const void *array,
|
|
47
|
+
size_t n_elements,
|
|
48
|
+
size_t element_size,
|
|
49
|
+
GCompareDataFunc compare_func,
|
|
50
|
+
void *user_data);
|
|
51
|
+
|
|
45
52
|
G_END_DECLS
|
|
46
53
|
|
|
47
54
|
#endif /* __G_QSORT_H__ */
|
|
@@ -179,6 +179,71 @@ GLIB_AVAILABLE_IN_2_36
|
|
|
179
179
|
gboolean g_close (gint fd,
|
|
180
180
|
GError **error);
|
|
181
181
|
|
|
182
|
+
/**
|
|
183
|
+
* g_clear_fd: (skip)
|
|
184
|
+
* @fd_ptr: (not optional) (inout) (transfer full): a pointer to a file descriptor
|
|
185
|
+
* @error: Used to return an error on failure
|
|
186
|
+
*
|
|
187
|
+
* If @fd_ptr points to a file descriptor, close it and return
|
|
188
|
+
* whether closing it was successful, like g_close().
|
|
189
|
+
* If @fd_ptr points to a negative number, return %TRUE without closing
|
|
190
|
+
* anything.
|
|
191
|
+
* In both cases, set @fd_ptr to `-1` before returning.
|
|
192
|
+
*
|
|
193
|
+
* Like g_close(), if closing the file descriptor fails, the error is
|
|
194
|
+
* stored in both %errno and @error. If this function succeeds,
|
|
195
|
+
* %errno is undefined.
|
|
196
|
+
*
|
|
197
|
+
* On POSIX platforms, this function is async-signal safe
|
|
198
|
+
* if @error is %NULL and @fd_ptr points to either a negative number or a
|
|
199
|
+
* valid open file descriptor.
|
|
200
|
+
* This makes it safe to call from a signal handler or a #GSpawnChildSetupFunc
|
|
201
|
+
* under those conditions.
|
|
202
|
+
* See [`signal(7)`](man:signal(7)) and
|
|
203
|
+
* [`signal-safety(7)`](man:signal-safety(7)) for more details.
|
|
204
|
+
*
|
|
205
|
+
* It is a programming error for @fd_ptr to point to a non-negative
|
|
206
|
+
* number that is not a valid file descriptor.
|
|
207
|
+
*
|
|
208
|
+
* A typical use of this function is to clean up a file descriptor at
|
|
209
|
+
* the end of its scope, whether it has been set successfully or not:
|
|
210
|
+
*
|
|
211
|
+
* |[
|
|
212
|
+
* gboolean
|
|
213
|
+
* operate_on_fd (GError **error)
|
|
214
|
+
* {
|
|
215
|
+
* gboolean ret = FALSE;
|
|
216
|
+
* int fd = -1;
|
|
217
|
+
*
|
|
218
|
+
* fd = open_a_fd (error);
|
|
219
|
+
*
|
|
220
|
+
* if (fd < 0)
|
|
221
|
+
* goto out;
|
|
222
|
+
*
|
|
223
|
+
* if (!do_something (fd, error))
|
|
224
|
+
* goto out;
|
|
225
|
+
*
|
|
226
|
+
* if (!g_clear_fd (&fd, error))
|
|
227
|
+
* goto out;
|
|
228
|
+
*
|
|
229
|
+
* ret = TRUE;
|
|
230
|
+
*
|
|
231
|
+
* out:
|
|
232
|
+
* // OK to call even if fd was never opened or was already closed
|
|
233
|
+
* g_clear_fd (&fd, NULL);
|
|
234
|
+
* return ret;
|
|
235
|
+
* }
|
|
236
|
+
* ]|
|
|
237
|
+
*
|
|
238
|
+
* This function is also useful in conjunction with #g_autofd.
|
|
239
|
+
*
|
|
240
|
+
* Returns: %TRUE on success
|
|
241
|
+
* Since: 2.76
|
|
242
|
+
*/
|
|
243
|
+
GLIB_AVAILABLE_STATIC_INLINE_IN_2_76
|
|
244
|
+
static inline gboolean g_clear_fd (int *fd_ptr,
|
|
245
|
+
GError **error);
|
|
246
|
+
|
|
182
247
|
GLIB_AVAILABLE_STATIC_INLINE_IN_2_76
|
|
183
248
|
static inline gboolean
|
|
184
249
|
g_clear_fd (int *fd_ptr,
|
|
@@ -476,6 +476,10 @@ gboolean g_ascii_string_to_unsigned (const gchar *str,
|
|
|
476
476
|
* Since: 2.76
|
|
477
477
|
*/
|
|
478
478
|
GLIB_AVAILABLE_STATIC_INLINE_IN_2_76
|
|
479
|
+
static inline gboolean g_set_str (char **str_pointer,
|
|
480
|
+
const char *new_str);
|
|
481
|
+
|
|
482
|
+
GLIB_AVAILABLE_STATIC_INLINE_IN_2_76
|
|
479
483
|
static inline gboolean
|
|
480
484
|
g_set_str (char **str_pointer,
|
|
481
485
|
const char *new_str)
|
|
@@ -66,6 +66,8 @@ gchar* g_string_free_and_steal (GString *string) G_GNUC_WARN_UN
|
|
|
66
66
|
|
|
67
67
|
#if G_GNUC_CHECK_VERSION (2, 0) && (GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_76)
|
|
68
68
|
|
|
69
|
+
#if !defined(__cplusplus) || !G_GNUC_CHECK_VERSION (6, 1) || G_GNUC_CHECK_VERSION (7, 3)
|
|
70
|
+
|
|
69
71
|
#define g_string_free(str, free_segment) \
|
|
70
72
|
(__builtin_constant_p (free_segment) ? \
|
|
71
73
|
((free_segment) ? \
|
|
@@ -74,6 +76,8 @@ gchar* g_string_free_and_steal (GString *string) G_GNUC_WARN_UN
|
|
|
74
76
|
: \
|
|
75
77
|
(g_string_free) ((str), (free_segment)))
|
|
76
78
|
|
|
79
|
+
#endif /* !defined(__cplusplus) || !G_GNUC_CHECK_VERSION (6, 1) || G_GNUC_CHECK_VERSION (7, 3) */
|
|
80
|
+
|
|
77
81
|
#endif /* G_GNUC_CHECK_VERSION (2, 0) && (GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_76) */
|
|
78
82
|
|
|
79
83
|
GLIB_AVAILABLE_IN_2_34
|