@girs/glib-2.0 2.76.1-3.2.3 → 2.77.0-3.2.8
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/README.md +14 -1
- package/glib-2.0-ambient.d.ts +0 -1
- package/glib-2.0-ambient.js +2 -0
- package/glib-2.0-import.d.ts +0 -1
- package/glib-2.0-import.js +3 -0
- package/glib-2.0.d.cts +967 -527
- package/glib-2.0.d.ts +967 -527
- package/package.json +13 -7
package/glib-2.0.d.ts
CHANGED
|
@@ -1390,7 +1390,7 @@ enum TraverseType {
|
|
|
1390
1390
|
* Since new unicode versions may add new types here, applications should be ready
|
|
1391
1391
|
* to handle unknown values. They may be regarded as %G_UNICODE_BREAK_UNKNOWN.
|
|
1392
1392
|
*
|
|
1393
|
-
* See [Unicode Line Breaking Algorithm](
|
|
1393
|
+
* See [Unicode Line Breaking Algorithm](https://www.unicode.org/reports/tr14/).
|
|
1394
1394
|
*/
|
|
1395
1395
|
enum UnicodeBreakType {
|
|
1396
1396
|
/**
|
|
@@ -3649,6 +3649,29 @@ const ANALYZER_ANALYZING: number
|
|
|
3649
3649
|
*
|
|
3650
3650
|
*/
|
|
3651
3651
|
const ASCII_DTOSTR_BUF_SIZE: number
|
|
3652
|
+
/**
|
|
3653
|
+
* Evaluates to the initial reference count for `gatomicrefcount`.
|
|
3654
|
+
*
|
|
3655
|
+
* This macro is useful for initializing `gatomicrefcount` fields inside
|
|
3656
|
+
* structures, for instance:
|
|
3657
|
+
*
|
|
3658
|
+
*
|
|
3659
|
+
* ```c
|
|
3660
|
+
* typedef struct {
|
|
3661
|
+
* gatomicrefcount ref_count;
|
|
3662
|
+
* char *name;
|
|
3663
|
+
* char *address;
|
|
3664
|
+
* } Person;
|
|
3665
|
+
*
|
|
3666
|
+
* static const Person default_person = {
|
|
3667
|
+
* .ref_count = G_ATOMIC_REF_COUNT_INIT,
|
|
3668
|
+
* .name = "Default name",
|
|
3669
|
+
* .address = "Default address",
|
|
3670
|
+
* };
|
|
3671
|
+
* ```
|
|
3672
|
+
*
|
|
3673
|
+
*/
|
|
3674
|
+
const ATOMIC_REF_COUNT_INIT: number
|
|
3652
3675
|
/**
|
|
3653
3676
|
* Specifies one of the possible types of byte order.
|
|
3654
3677
|
* See %G_BYTE_ORDER.
|
|
@@ -3659,19 +3682,19 @@ const BIG_ENDIAN: number
|
|
|
3659
3682
|
* Used for specifying valid identifier characters
|
|
3660
3683
|
* in #GScannerConfig.
|
|
3661
3684
|
*/
|
|
3662
|
-
const CSET_A_2_Z: string
|
|
3685
|
+
const CSET_A_2_Z: string
|
|
3663
3686
|
/**
|
|
3664
3687
|
* The set of ASCII digits.
|
|
3665
3688
|
* Used for specifying valid identifier characters
|
|
3666
3689
|
* in #GScannerConfig.
|
|
3667
3690
|
*/
|
|
3668
|
-
const CSET_DIGITS: string
|
|
3691
|
+
const CSET_DIGITS: string
|
|
3669
3692
|
/**
|
|
3670
3693
|
* The set of lowercase ASCII alphabet characters.
|
|
3671
3694
|
* Used for specifying valid identifier characters
|
|
3672
3695
|
* in #GScannerConfig.
|
|
3673
3696
|
*/
|
|
3674
|
-
const CSET_a_2_z: string
|
|
3697
|
+
const CSET_a_2_z: string
|
|
3675
3698
|
/**
|
|
3676
3699
|
* The C standard version the code is compiling against, it's normally
|
|
3677
3700
|
* defined with the same value of `__STDC_VERSION__` for C standard
|
|
@@ -3711,7 +3734,7 @@ const DIR_SEPARATOR: number
|
|
|
3711
3734
|
* The directory separator as a string.
|
|
3712
3735
|
* This is "/" on UNIX machines and "\" under Windows.
|
|
3713
3736
|
*/
|
|
3714
|
-
const DIR_SEPARATOR_S: string
|
|
3737
|
+
const DIR_SEPARATOR_S: string
|
|
3715
3738
|
/**
|
|
3716
3739
|
* The base of natural logarithms.
|
|
3717
3740
|
*/
|
|
@@ -3736,7 +3759,7 @@ const E: number
|
|
|
3736
3759
|
* ```
|
|
3737
3760
|
*
|
|
3738
3761
|
*/
|
|
3739
|
-
const GINT16_FORMAT: string
|
|
3762
|
+
const GINT16_FORMAT: string
|
|
3740
3763
|
/**
|
|
3741
3764
|
* The platform dependent length modifier for conversion specifiers
|
|
3742
3765
|
* for scanning and printing values of type #gint16 or #guint16. It
|
|
@@ -3756,7 +3779,7 @@ const GINT16_FORMAT: string | null
|
|
|
3756
3779
|
* `int16_t` values, even though the in-memory representation is the same.
|
|
3757
3780
|
* Standard C macros like `PRId16` and `SCNd16` should be used for `int16_t`.
|
|
3758
3781
|
*/
|
|
3759
|
-
const GINT16_MODIFIER: string
|
|
3782
|
+
const GINT16_MODIFIER: string
|
|
3760
3783
|
/**
|
|
3761
3784
|
* This is the platform dependent conversion specifier for scanning
|
|
3762
3785
|
* and printing values of type #gint32. See also %G_GINT16_FORMAT.
|
|
@@ -3765,7 +3788,7 @@ const GINT16_MODIFIER: string | null
|
|
|
3765
3788
|
* `int32_t` values, even though the in-memory representation is the same.
|
|
3766
3789
|
* Standard C macros like `PRId32` and `SCNd32` should be used for `int32_t`.
|
|
3767
3790
|
*/
|
|
3768
|
-
const GINT32_FORMAT: string
|
|
3791
|
+
const GINT32_FORMAT: string
|
|
3769
3792
|
/**
|
|
3770
3793
|
* The platform dependent length modifier for conversion specifiers
|
|
3771
3794
|
* for scanning and printing values of type #gint32 or #guint32. It
|
|
@@ -3775,7 +3798,7 @@ const GINT32_FORMAT: string | null
|
|
|
3775
3798
|
* `int32_t` values, even though the in-memory representation is the same.
|
|
3776
3799
|
* Standard C macros like `PRId32` and `SCNd32` should be used for `int32_t`.
|
|
3777
3800
|
*/
|
|
3778
|
-
const GINT32_MODIFIER: string
|
|
3801
|
+
const GINT32_MODIFIER: string
|
|
3779
3802
|
/**
|
|
3780
3803
|
* This is the platform dependent conversion specifier for scanning
|
|
3781
3804
|
* and printing values of type #gint64. See also %G_GINT16_FORMAT.
|
|
@@ -3791,7 +3814,7 @@ const GINT32_MODIFIER: string | null
|
|
|
3791
3814
|
* `int64_t` values, even though the in-memory representation is the same.
|
|
3792
3815
|
* Standard C macros like `PRId64` and `SCNd64` should be used for `int64_t`.
|
|
3793
3816
|
*/
|
|
3794
|
-
const GINT64_FORMAT: string
|
|
3817
|
+
const GINT64_FORMAT: string
|
|
3795
3818
|
/**
|
|
3796
3819
|
* The platform dependent length modifier for conversion specifiers
|
|
3797
3820
|
* for scanning and printing values of type #gint64 or #guint64.
|
|
@@ -3805,7 +3828,7 @@ const GINT64_FORMAT: string | null
|
|
|
3805
3828
|
* `int64_t` values, even though the in-memory representation is the same.
|
|
3806
3829
|
* Standard C macros like `PRId64` and `SCNd64` should be used for `int64_t`.
|
|
3807
3830
|
*/
|
|
3808
|
-
const GINT64_MODIFIER: string
|
|
3831
|
+
const GINT64_MODIFIER: string
|
|
3809
3832
|
/**
|
|
3810
3833
|
* This is the platform dependent conversion specifier for scanning
|
|
3811
3834
|
* and printing values of type #gintptr.
|
|
@@ -3816,7 +3839,7 @@ const GINT64_MODIFIER: string | null
|
|
|
3816
3839
|
* Standard C macros like `PRIdPTR` and `SCNdPTR` should be used for
|
|
3817
3840
|
* `intptr_t`.
|
|
3818
3841
|
*/
|
|
3819
|
-
const GINTPTR_FORMAT: string
|
|
3842
|
+
const GINTPTR_FORMAT: string
|
|
3820
3843
|
/**
|
|
3821
3844
|
* The platform dependent length modifier for conversion specifiers
|
|
3822
3845
|
* for scanning and printing values of type #gintptr or #guintptr.
|
|
@@ -3828,17 +3851,17 @@ const GINTPTR_FORMAT: string | null
|
|
|
3828
3851
|
* Standard C macros like `PRIdPTR` and `SCNdPTR` should be used for
|
|
3829
3852
|
* `intptr_t`.
|
|
3830
3853
|
*/
|
|
3831
|
-
const GINTPTR_MODIFIER: string
|
|
3854
|
+
const GINTPTR_MODIFIER: string
|
|
3832
3855
|
/**
|
|
3833
3856
|
* Expands to "" on all modern compilers, and to __FUNCTION__ on gcc
|
|
3834
3857
|
* version 2.x. Don't use it.
|
|
3835
3858
|
*/
|
|
3836
|
-
const GNUC_FUNCTION: string
|
|
3859
|
+
const GNUC_FUNCTION: string
|
|
3837
3860
|
/**
|
|
3838
3861
|
* Expands to "" on all modern compilers, and to __PRETTY_FUNCTION__
|
|
3839
3862
|
* on gcc version 2.x. Don't use it.
|
|
3840
3863
|
*/
|
|
3841
|
-
const GNUC_PRETTY_FUNCTION: string
|
|
3864
|
+
const GNUC_PRETTY_FUNCTION: string
|
|
3842
3865
|
/**
|
|
3843
3866
|
* This is the platform dependent conversion specifier for scanning
|
|
3844
3867
|
* and printing values of type #gsize. See also %G_GINT16_FORMAT.
|
|
@@ -3848,7 +3871,7 @@ const GNUC_PRETTY_FUNCTION: string | null
|
|
|
3848
3871
|
* same. The standard C `"zu"` format should be used for `size_t`,
|
|
3849
3872
|
* assuming a C99-compliant `printf` implementation is available.
|
|
3850
3873
|
*/
|
|
3851
|
-
const GSIZE_FORMAT: string
|
|
3874
|
+
const GSIZE_FORMAT: string
|
|
3852
3875
|
/**
|
|
3853
3876
|
* The platform dependent length modifier for conversion specifiers
|
|
3854
3877
|
* for scanning and printing values of type #gsize. It
|
|
@@ -3859,7 +3882,7 @@ const GSIZE_FORMAT: string | null
|
|
|
3859
3882
|
* same. The Standard C `"z"` modifier should be used for `size_t`,
|
|
3860
3883
|
* assuming a C99-compliant `printf` implementation is available.
|
|
3861
3884
|
*/
|
|
3862
|
-
const GSIZE_MODIFIER: string
|
|
3885
|
+
const GSIZE_MODIFIER: string
|
|
3863
3886
|
/**
|
|
3864
3887
|
* This is the platform dependent conversion specifier for scanning
|
|
3865
3888
|
* and printing values of type #gssize. See also %G_GINT16_FORMAT.
|
|
@@ -3869,7 +3892,7 @@ const GSIZE_MODIFIER: string | null
|
|
|
3869
3892
|
* representation is the same.
|
|
3870
3893
|
* On POSIX platforms, the `"zd"` format should be used for `ssize_t`.
|
|
3871
3894
|
*/
|
|
3872
|
-
const GSSIZE_FORMAT: string
|
|
3895
|
+
const GSSIZE_FORMAT: string
|
|
3873
3896
|
/**
|
|
3874
3897
|
* The platform dependent length modifier for conversion specifiers
|
|
3875
3898
|
* for scanning and printing values of type #gssize. It
|
|
@@ -3880,7 +3903,7 @@ const GSSIZE_FORMAT: string | null
|
|
|
3880
3903
|
* representation is the same.
|
|
3881
3904
|
* On POSIX platforms, the `"z"` modifier should be used for `ssize_t`.
|
|
3882
3905
|
*/
|
|
3883
|
-
const GSSIZE_MODIFIER: string
|
|
3906
|
+
const GSSIZE_MODIFIER: string
|
|
3884
3907
|
/**
|
|
3885
3908
|
* This is the platform dependent conversion specifier for scanning
|
|
3886
3909
|
* and printing values of type #guint16. See also %G_GINT16_FORMAT
|
|
@@ -3889,7 +3912,7 @@ const GSSIZE_MODIFIER: string | null
|
|
|
3889
3912
|
* `uint16_t` values, even though the in-memory representation is the same.
|
|
3890
3913
|
* Standard C macros like `PRIu16` and `SCNu16` should be used for `uint16_t`.
|
|
3891
3914
|
*/
|
|
3892
|
-
const GUINT16_FORMAT: string
|
|
3915
|
+
const GUINT16_FORMAT: string
|
|
3893
3916
|
/**
|
|
3894
3917
|
* This is the platform dependent conversion specifier for scanning
|
|
3895
3918
|
* and printing values of type #guint32. See also %G_GINT16_FORMAT.
|
|
@@ -3898,7 +3921,7 @@ const GUINT16_FORMAT: string | null
|
|
|
3898
3921
|
* `uint32_t` values, even though the in-memory representation is the same.
|
|
3899
3922
|
* Standard C macros like `PRIu32` and `SCNu32` should be used for `uint32_t`.
|
|
3900
3923
|
*/
|
|
3901
|
-
const GUINT32_FORMAT: string
|
|
3924
|
+
const GUINT32_FORMAT: string
|
|
3902
3925
|
/**
|
|
3903
3926
|
* This is the platform dependent conversion specifier for scanning
|
|
3904
3927
|
* and printing values of type #guint64. See also %G_GINT16_FORMAT.
|
|
@@ -3914,7 +3937,7 @@ const GUINT32_FORMAT: string | null
|
|
|
3914
3937
|
* `uint64_t` values, even though the in-memory representation is the same.
|
|
3915
3938
|
* Standard C macros like `PRIu64` and `SCNu64` should be used for `uint64_t`.
|
|
3916
3939
|
*/
|
|
3917
|
-
const GUINT64_FORMAT: string
|
|
3940
|
+
const GUINT64_FORMAT: string
|
|
3918
3941
|
/**
|
|
3919
3942
|
* This is the platform dependent conversion specifier
|
|
3920
3943
|
* for scanning and printing values of type #guintptr.
|
|
@@ -3925,7 +3948,7 @@ const GUINT64_FORMAT: string | null
|
|
|
3925
3948
|
* Standard C macros like `PRIuPTR` and `SCNuPTR` should be used for
|
|
3926
3949
|
* `uintptr_t`.
|
|
3927
3950
|
*/
|
|
3928
|
-
const GUINTPTR_FORMAT: string
|
|
3951
|
+
const GUINTPTR_FORMAT: string
|
|
3929
3952
|
const HAVE_GINT64: number
|
|
3930
3953
|
const HAVE_GNUC_VARARGS: number
|
|
3931
3954
|
/**
|
|
@@ -3955,110 +3978,110 @@ const IEEE754_FLOAT_BIAS: number
|
|
|
3955
3978
|
* Consult the specification for more
|
|
3956
3979
|
* details about the meanings of the keys below.
|
|
3957
3980
|
*/
|
|
3958
|
-
const KEY_FILE_DESKTOP_GROUP: string
|
|
3981
|
+
const KEY_FILE_DESKTOP_GROUP: string
|
|
3959
3982
|
/**
|
|
3960
3983
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a string list
|
|
3961
3984
|
* giving the available application actions.
|
|
3962
3985
|
*/
|
|
3963
|
-
const KEY_FILE_DESKTOP_KEY_ACTIONS: string
|
|
3986
|
+
const KEY_FILE_DESKTOP_KEY_ACTIONS: string
|
|
3964
3987
|
/**
|
|
3965
3988
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a list
|
|
3966
3989
|
* of strings giving the categories in which the desktop entry
|
|
3967
3990
|
* should be shown in a menu.
|
|
3968
3991
|
*/
|
|
3969
|
-
const KEY_FILE_DESKTOP_KEY_CATEGORIES: string
|
|
3992
|
+
const KEY_FILE_DESKTOP_KEY_CATEGORIES: string
|
|
3970
3993
|
/**
|
|
3971
3994
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a localized
|
|
3972
3995
|
* string giving the tooltip for the desktop entry.
|
|
3973
3996
|
*/
|
|
3974
|
-
const KEY_FILE_DESKTOP_KEY_COMMENT: string
|
|
3997
|
+
const KEY_FILE_DESKTOP_KEY_COMMENT: string
|
|
3975
3998
|
/**
|
|
3976
3999
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a boolean
|
|
3977
4000
|
* set to true if the application is D-Bus activatable.
|
|
3978
4001
|
*/
|
|
3979
|
-
const KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE: string
|
|
4002
|
+
const KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE: string
|
|
3980
4003
|
/**
|
|
3981
4004
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a string
|
|
3982
4005
|
* giving the command line to execute. It is only valid for desktop
|
|
3983
4006
|
* entries with the `Application` type.
|
|
3984
4007
|
*/
|
|
3985
|
-
const KEY_FILE_DESKTOP_KEY_EXEC: string
|
|
4008
|
+
const KEY_FILE_DESKTOP_KEY_EXEC: string
|
|
3986
4009
|
/**
|
|
3987
4010
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a localized
|
|
3988
4011
|
* string giving the generic name of the desktop entry.
|
|
3989
4012
|
*/
|
|
3990
|
-
const KEY_FILE_DESKTOP_KEY_GENERIC_NAME: string
|
|
4013
|
+
const KEY_FILE_DESKTOP_KEY_GENERIC_NAME: string
|
|
3991
4014
|
/**
|
|
3992
4015
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a boolean
|
|
3993
4016
|
* stating whether the desktop entry has been deleted by the user.
|
|
3994
4017
|
*/
|
|
3995
|
-
const KEY_FILE_DESKTOP_KEY_HIDDEN: string
|
|
4018
|
+
const KEY_FILE_DESKTOP_KEY_HIDDEN: string
|
|
3996
4019
|
/**
|
|
3997
4020
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a localized
|
|
3998
4021
|
* string giving the name of the icon to be displayed for the desktop
|
|
3999
4022
|
* entry.
|
|
4000
4023
|
*/
|
|
4001
|
-
const KEY_FILE_DESKTOP_KEY_ICON: string
|
|
4024
|
+
const KEY_FILE_DESKTOP_KEY_ICON: string
|
|
4002
4025
|
/**
|
|
4003
4026
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a list
|
|
4004
4027
|
* of strings giving the MIME types supported by this desktop entry.
|
|
4005
4028
|
*/
|
|
4006
|
-
const KEY_FILE_DESKTOP_KEY_MIME_TYPE: string
|
|
4029
|
+
const KEY_FILE_DESKTOP_KEY_MIME_TYPE: string
|
|
4007
4030
|
/**
|
|
4008
4031
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a localized
|
|
4009
4032
|
* string giving the specific name of the desktop entry.
|
|
4010
4033
|
*/
|
|
4011
|
-
const KEY_FILE_DESKTOP_KEY_NAME: string
|
|
4034
|
+
const KEY_FILE_DESKTOP_KEY_NAME: string
|
|
4012
4035
|
/**
|
|
4013
4036
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a list of
|
|
4014
4037
|
* strings identifying the environments that should not display the
|
|
4015
4038
|
* desktop entry.
|
|
4016
4039
|
*/
|
|
4017
|
-
const KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN: string
|
|
4040
|
+
const KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN: string
|
|
4018
4041
|
/**
|
|
4019
4042
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a boolean
|
|
4020
4043
|
* stating whether the desktop entry should be shown in menus.
|
|
4021
4044
|
*/
|
|
4022
|
-
const KEY_FILE_DESKTOP_KEY_NO_DISPLAY: string
|
|
4045
|
+
const KEY_FILE_DESKTOP_KEY_NO_DISPLAY: string
|
|
4023
4046
|
/**
|
|
4024
4047
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a list of
|
|
4025
4048
|
* strings identifying the environments that should display the
|
|
4026
4049
|
* desktop entry.
|
|
4027
4050
|
*/
|
|
4028
|
-
const KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN: string
|
|
4051
|
+
const KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN: string
|
|
4029
4052
|
/**
|
|
4030
4053
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a string
|
|
4031
4054
|
* containing the working directory to run the program in. It is only
|
|
4032
4055
|
* valid for desktop entries with the `Application` type.
|
|
4033
4056
|
*/
|
|
4034
|
-
const KEY_FILE_DESKTOP_KEY_PATH: string
|
|
4057
|
+
const KEY_FILE_DESKTOP_KEY_PATH: string
|
|
4035
4058
|
/**
|
|
4036
4059
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a boolean
|
|
4037
4060
|
* stating whether the application supports the
|
|
4038
4061
|
* [Startup Notification Protocol Specification](http://www.freedesktop.org/Standards/startup-notification-spec).
|
|
4039
4062
|
*/
|
|
4040
|
-
const KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY: string
|
|
4063
|
+
const KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY: string
|
|
4041
4064
|
/**
|
|
4042
4065
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is string
|
|
4043
4066
|
* identifying the WM class or name hint of a window that the application
|
|
4044
4067
|
* will create, which can be used to emulate Startup Notification with
|
|
4045
4068
|
* older applications.
|
|
4046
4069
|
*/
|
|
4047
|
-
const KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS: string
|
|
4070
|
+
const KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS: string
|
|
4048
4071
|
/**
|
|
4049
4072
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a boolean
|
|
4050
4073
|
* stating whether the program should be run in a terminal window.
|
|
4051
4074
|
*
|
|
4052
4075
|
* It is only valid for desktop entries with the `Application` type.
|
|
4053
4076
|
*/
|
|
4054
|
-
const KEY_FILE_DESKTOP_KEY_TERMINAL: string
|
|
4077
|
+
const KEY_FILE_DESKTOP_KEY_TERMINAL: string
|
|
4055
4078
|
/**
|
|
4056
4079
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a string
|
|
4057
4080
|
* giving the file name of a binary on disk used to determine if the
|
|
4058
4081
|
* program is actually installed. It is only valid for desktop entries
|
|
4059
4082
|
* with the `Application` type.
|
|
4060
4083
|
*/
|
|
4061
|
-
const KEY_FILE_DESKTOP_KEY_TRY_EXEC: string
|
|
4084
|
+
const KEY_FILE_DESKTOP_KEY_TRY_EXEC: string
|
|
4062
4085
|
/**
|
|
4063
4086
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a string
|
|
4064
4087
|
* giving the type of the desktop entry.
|
|
@@ -4067,34 +4090,34 @@ const KEY_FILE_DESKTOP_KEY_TRY_EXEC: string | null
|
|
|
4067
4090
|
* %G_KEY_FILE_DESKTOP_TYPE_LINK, or
|
|
4068
4091
|
* %G_KEY_FILE_DESKTOP_TYPE_DIRECTORY.
|
|
4069
4092
|
*/
|
|
4070
|
-
const KEY_FILE_DESKTOP_KEY_TYPE: string
|
|
4093
|
+
const KEY_FILE_DESKTOP_KEY_TYPE: string
|
|
4071
4094
|
/**
|
|
4072
4095
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a string
|
|
4073
4096
|
* giving the URL to access. It is only valid for desktop entries
|
|
4074
4097
|
* with the `Link` type.
|
|
4075
4098
|
*/
|
|
4076
|
-
const KEY_FILE_DESKTOP_KEY_URL: string
|
|
4099
|
+
const KEY_FILE_DESKTOP_KEY_URL: string
|
|
4077
4100
|
/**
|
|
4078
4101
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a string
|
|
4079
4102
|
* giving the version of the Desktop Entry Specification used for
|
|
4080
4103
|
* the desktop entry file.
|
|
4081
4104
|
*/
|
|
4082
|
-
const KEY_FILE_DESKTOP_KEY_VERSION: string
|
|
4105
|
+
const KEY_FILE_DESKTOP_KEY_VERSION: string
|
|
4083
4106
|
/**
|
|
4084
4107
|
* The value of the %G_KEY_FILE_DESKTOP_KEY_TYPE, key for desktop
|
|
4085
4108
|
* entries representing applications.
|
|
4086
4109
|
*/
|
|
4087
|
-
const KEY_FILE_DESKTOP_TYPE_APPLICATION: string
|
|
4110
|
+
const KEY_FILE_DESKTOP_TYPE_APPLICATION: string
|
|
4088
4111
|
/**
|
|
4089
4112
|
* The value of the %G_KEY_FILE_DESKTOP_KEY_TYPE, key for desktop
|
|
4090
4113
|
* entries representing directories.
|
|
4091
4114
|
*/
|
|
4092
|
-
const KEY_FILE_DESKTOP_TYPE_DIRECTORY: string
|
|
4115
|
+
const KEY_FILE_DESKTOP_TYPE_DIRECTORY: string
|
|
4093
4116
|
/**
|
|
4094
4117
|
* The value of the %G_KEY_FILE_DESKTOP_KEY_TYPE, key for desktop
|
|
4095
4118
|
* entries representing links to documents.
|
|
4096
4119
|
*/
|
|
4097
|
-
const KEY_FILE_DESKTOP_TYPE_LINK: string
|
|
4120
|
+
const KEY_FILE_DESKTOP_TYPE_LINK: string
|
|
4098
4121
|
/**
|
|
4099
4122
|
* Specifies one of the possible types of byte order.
|
|
4100
4123
|
* See %G_BYTE_ORDER.
|
|
@@ -4128,7 +4151,7 @@ const LOG_2_BASE_10: number
|
|
|
4128
4151
|
* not advisable, as it cannot be filtered against using the `G_MESSAGES_DEBUG`
|
|
4129
4152
|
* environment variable.
|
|
4130
4153
|
*
|
|
4131
|
-
* For example, GTK
|
|
4154
|
+
* For example, GTK uses this in its `Makefile.am`:
|
|
4132
4155
|
*
|
|
4133
4156
|
* ```
|
|
4134
4157
|
* AM_CPPFLAGS = -DG_LOG_DOMAIN=\"Gtk\"
|
|
@@ -4245,7 +4268,7 @@ const MININT8: number
|
|
|
4245
4268
|
* linked against at application run time.
|
|
4246
4269
|
*/
|
|
4247
4270
|
const MINOR_VERSION: number
|
|
4248
|
-
const MODULE_SUFFIX: string
|
|
4271
|
+
const MODULE_SUFFIX: string
|
|
4249
4272
|
/**
|
|
4250
4273
|
* If a long option in the main group has this name, it is not treated as a
|
|
4251
4274
|
* regular option. Instead it collects all non-option arguments which would
|
|
@@ -4258,7 +4281,7 @@ const MODULE_SUFFIX: string | null
|
|
|
4258
4281
|
* for leftover arguments has the advantage that GOption takes care of
|
|
4259
4282
|
* necessary encoding conversions for strings or filenames.
|
|
4260
4283
|
*/
|
|
4261
|
-
const OPTION_REMAINING: string
|
|
4284
|
+
const OPTION_REMAINING: string
|
|
4262
4285
|
/**
|
|
4263
4286
|
* Specifies one of the possible types of byte order
|
|
4264
4287
|
* (currently unused). See %G_BYTE_ORDER.
|
|
@@ -4272,7 +4295,7 @@ const PI: number
|
|
|
4272
4295
|
* A format specifier that can be used in printf()-style format strings
|
|
4273
4296
|
* when printing a #GPid.
|
|
4274
4297
|
*/
|
|
4275
|
-
const PID_FORMAT: string
|
|
4298
|
+
const PID_FORMAT: string
|
|
4276
4299
|
/**
|
|
4277
4300
|
* Pi divided by 2.
|
|
4278
4301
|
*/
|
|
@@ -4285,7 +4308,7 @@ const PI_4: number
|
|
|
4285
4308
|
* A format specifier that can be used in printf()-style format strings
|
|
4286
4309
|
* when printing the `fd` member of a #GPollFD.
|
|
4287
4310
|
*/
|
|
4288
|
-
const POLLFD_FORMAT: string
|
|
4311
|
+
const POLLFD_FORMAT: string
|
|
4289
4312
|
/**
|
|
4290
4313
|
* Use this for default priority event sources.
|
|
4291
4314
|
*
|
|
@@ -4304,13 +4327,13 @@ const PRIORITY_DEFAULT_IDLE: number
|
|
|
4304
4327
|
/**
|
|
4305
4328
|
* Use this for high priority event sources.
|
|
4306
4329
|
*
|
|
4307
|
-
* It is not used within GLib or GTK
|
|
4330
|
+
* It is not used within GLib or GTK.
|
|
4308
4331
|
*/
|
|
4309
4332
|
const PRIORITY_HIGH: number
|
|
4310
4333
|
/**
|
|
4311
4334
|
* Use this for high priority idle functions.
|
|
4312
4335
|
*
|
|
4313
|
-
* GTK
|
|
4336
|
+
* GTK uses %G_PRIORITY_HIGH_IDLE + 10 for resizing operations,
|
|
4314
4337
|
* and %G_PRIORITY_HIGH_IDLE + 20 for redrawing operations. (This is
|
|
4315
4338
|
* done to ensure that any pending resizes are processed before any
|
|
4316
4339
|
* pending redraws, so that widgets are not redrawn twice unnecessarily.)
|
|
@@ -4319,9 +4342,32 @@ const PRIORITY_HIGH_IDLE: number
|
|
|
4319
4342
|
/**
|
|
4320
4343
|
* Use this for very low priority background tasks.
|
|
4321
4344
|
*
|
|
4322
|
-
* It is not used within GLib or GTK
|
|
4345
|
+
* It is not used within GLib or GTK.
|
|
4323
4346
|
*/
|
|
4324
4347
|
const PRIORITY_LOW: number
|
|
4348
|
+
/**
|
|
4349
|
+
* Evaluates to the initial reference count for `grefcount`.
|
|
4350
|
+
*
|
|
4351
|
+
* This macro is useful for initializing `grefcount` fields inside
|
|
4352
|
+
* structures, for instance:
|
|
4353
|
+
*
|
|
4354
|
+
*
|
|
4355
|
+
* ```c
|
|
4356
|
+
* typedef struct {
|
|
4357
|
+
* grefcount ref_count;
|
|
4358
|
+
* char *name;
|
|
4359
|
+
* char *address;
|
|
4360
|
+
* } Person;
|
|
4361
|
+
*
|
|
4362
|
+
* static const Person default_person = {
|
|
4363
|
+
* .ref_count = G_REF_COUNT_INIT,
|
|
4364
|
+
* .name = "Default name",
|
|
4365
|
+
* .address = "Default address",
|
|
4366
|
+
* };
|
|
4367
|
+
* ```
|
|
4368
|
+
*
|
|
4369
|
+
*/
|
|
4370
|
+
const REF_COUNT_INIT: number
|
|
4325
4371
|
/**
|
|
4326
4372
|
* The search path separator character.
|
|
4327
4373
|
* This is ':' on UNIX machines and ';' under Windows.
|
|
@@ -4331,7 +4377,7 @@ const SEARCHPATH_SEPARATOR: number
|
|
|
4331
4377
|
* The search path separator as a string.
|
|
4332
4378
|
* This is ":" on UNIX machines and ";" under Windows.
|
|
4333
4379
|
*/
|
|
4334
|
-
const SEARCHPATH_SEPARATOR_S: string
|
|
4380
|
+
const SEARCHPATH_SEPARATOR_S: string
|
|
4335
4381
|
const SIZEOF_LONG: number
|
|
4336
4382
|
const SIZEOF_SIZE_T: number
|
|
4337
4383
|
const SIZEOF_SSIZE_T: number
|
|
@@ -4353,7 +4399,7 @@ const SQRT2: number
|
|
|
4353
4399
|
/**
|
|
4354
4400
|
* The standard delimiters, used in g_strdelimit().
|
|
4355
4401
|
*/
|
|
4356
|
-
const STR_DELIMITERS: string
|
|
4402
|
+
const STR_DELIMITERS: string
|
|
4357
4403
|
const SYSDEF_AF_INET: number
|
|
4358
4404
|
const SYSDEF_AF_INET6: number
|
|
4359
4405
|
const SYSDEF_AF_UNIX: number
|
|
@@ -4385,7 +4431,7 @@ const SYSDEF_MSG_PEEK: number
|
|
|
4385
4431
|
* calls to functions like g_get_user_cache_dir(), the caller must be prepared
|
|
4386
4432
|
* to create the directory if it doesn’t exist.
|
|
4387
4433
|
*/
|
|
4388
|
-
const TEST_OPTION_ISOLATE_DIRS: string
|
|
4434
|
+
const TEST_OPTION_ISOLATE_DIRS: string
|
|
4389
4435
|
/**
|
|
4390
4436
|
* Evaluates to a time span of one day.
|
|
4391
4437
|
*/
|
|
@@ -4417,12 +4463,12 @@ const UNICHAR_MAX_DECOMPOSITION_LENGTH: number
|
|
|
4417
4463
|
* Generic delimiters characters as defined in
|
|
4418
4464
|
* [RFC 3986](https://tools.ietf.org/html/rfc3986). Includes `:/?#[]```.
|
|
4419
4465
|
*/
|
|
4420
|
-
const URI_RESERVED_CHARS_GENERIC_DELIMITERS: string
|
|
4466
|
+
const URI_RESERVED_CHARS_GENERIC_DELIMITERS: string
|
|
4421
4467
|
/**
|
|
4422
4468
|
* Subcomponent delimiter characters as defined in
|
|
4423
4469
|
* [RFC 3986](https://tools.ietf.org/html/rfc3986). Includes `!$&'()*+,;=`.
|
|
4424
4470
|
*/
|
|
4425
|
-
const URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS: string
|
|
4471
|
+
const URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS: string
|
|
4426
4472
|
/**
|
|
4427
4473
|
* Number of microseconds in one second (1 million).
|
|
4428
4474
|
* This macro is provided for code readability.
|
|
@@ -4553,7 +4599,7 @@ function ascii_dtostr(buffer: string | null, buf_len: number, d: number): string
|
|
|
4553
4599
|
* @param d The #gdouble to convert
|
|
4554
4600
|
* @returns The pointer to the buffer with the converted string.
|
|
4555
4601
|
*/
|
|
4556
|
-
function ascii_formatd(buffer: string | null, buf_len: number, format: string
|
|
4602
|
+
function ascii_formatd(buffer: string | null, buf_len: number, format: string, d: number): string | null
|
|
4557
4603
|
/**
|
|
4558
4604
|
* Compare two strings, ignoring the case of ASCII characters.
|
|
4559
4605
|
*
|
|
@@ -4574,14 +4620,14 @@ function ascii_formatd(buffer: string | null, buf_len: number, format: string |
|
|
|
4574
4620
|
* @param s2 string to compare with `s1`
|
|
4575
4621
|
* @returns 0 if the strings match, a negative value if @s1 < @s2, or a positive value if @s1 > @s2.
|
|
4576
4622
|
*/
|
|
4577
|
-
function ascii_strcasecmp(s1: string
|
|
4623
|
+
function ascii_strcasecmp(s1: string, s2: string): number
|
|
4578
4624
|
/**
|
|
4579
4625
|
* Converts all upper case ASCII letters to lower case ASCII letters.
|
|
4580
4626
|
* @param str a string
|
|
4581
4627
|
* @param len length of `str` in bytes, or -1 if `str` is nul-terminated
|
|
4582
4628
|
* @returns a newly-allocated string, with all the upper case characters in @str converted to lower case, with semantics that exactly match g_ascii_tolower(). (Note that this is unlike the old g_strdown(), which modified the string in place.)
|
|
4583
4629
|
*/
|
|
4584
|
-
function ascii_strdown(str: string
|
|
4630
|
+
function ascii_strdown(str: string, len: number): string | null
|
|
4585
4631
|
/**
|
|
4586
4632
|
* A convenience function for converting a string to a signed number.
|
|
4587
4633
|
*
|
|
@@ -4610,7 +4656,7 @@ function ascii_strdown(str: string | null, len: number): string | null
|
|
|
4610
4656
|
* @param max an upper bound (inclusive)
|
|
4611
4657
|
* @returns %TRUE if @str was a number, otherwise %FALSE.
|
|
4612
4658
|
*/
|
|
4613
|
-
function ascii_string_to_signed(str: string
|
|
4659
|
+
function ascii_string_to_signed(str: string, base: number, min: number, max: number): [ /* returnType */ boolean, /* out_num */ number ]
|
|
4614
4660
|
/**
|
|
4615
4661
|
* A convenience function for converting a string to an unsigned number.
|
|
4616
4662
|
*
|
|
@@ -4640,7 +4686,7 @@ function ascii_string_to_signed(str: string | null, base: number, min: number, m
|
|
|
4640
4686
|
* @param max an upper bound (inclusive)
|
|
4641
4687
|
* @returns %TRUE if @str was a number, otherwise %FALSE.
|
|
4642
4688
|
*/
|
|
4643
|
-
function ascii_string_to_unsigned(str: string
|
|
4689
|
+
function ascii_string_to_unsigned(str: string, base: number, min: number, max: number): [ /* returnType */ boolean, /* out_num */ number ]
|
|
4644
4690
|
/**
|
|
4645
4691
|
* Compare `s1` and `s2`, ignoring the case of ASCII characters and any
|
|
4646
4692
|
* characters after the first `n` in each string. If either string is
|
|
@@ -4659,7 +4705,7 @@ function ascii_string_to_unsigned(str: string | null, base: number, min: number,
|
|
|
4659
4705
|
* @param n number of characters to compare
|
|
4660
4706
|
* @returns 0 if the strings match, a negative value if @s1 < @s2, or a positive value if @s1 > @s2.
|
|
4661
4707
|
*/
|
|
4662
|
-
function ascii_strncasecmp(s1: string
|
|
4708
|
+
function ascii_strncasecmp(s1: string, s2: string, n: number): number
|
|
4663
4709
|
/**
|
|
4664
4710
|
* Converts a string to a #gdouble value.
|
|
4665
4711
|
*
|
|
@@ -4687,7 +4733,7 @@ function ascii_strncasecmp(s1: string | null, s2: string | null, n: number): num
|
|
|
4687
4733
|
* @param nptr the string to convert to a numeric value.
|
|
4688
4734
|
* @returns the #gdouble value.
|
|
4689
4735
|
*/
|
|
4690
|
-
function ascii_strtod(nptr: string
|
|
4736
|
+
function ascii_strtod(nptr: string): [ /* returnType */ number, /* endptr */ string ]
|
|
4691
4737
|
/**
|
|
4692
4738
|
* Converts a string to a #gint64 value.
|
|
4693
4739
|
* This function behaves like the standard strtoll() function
|
|
@@ -4710,7 +4756,7 @@ function ascii_strtod(nptr: string | null): [ /* returnType */ number, /* endptr
|
|
|
4710
4756
|
* @param base to be used for the conversion, 2..36 or 0
|
|
4711
4757
|
* @returns the #gint64 value or zero on error.
|
|
4712
4758
|
*/
|
|
4713
|
-
function ascii_strtoll(nptr: string
|
|
4759
|
+
function ascii_strtoll(nptr: string, base: number): [ /* returnType */ number, /* endptr */ string ]
|
|
4714
4760
|
/**
|
|
4715
4761
|
* Converts a string to a #guint64 value.
|
|
4716
4762
|
* This function behaves like the standard strtoull() function
|
|
@@ -4738,14 +4784,14 @@ function ascii_strtoll(nptr: string | null, base: number): [ /* returnType */ nu
|
|
|
4738
4784
|
* @param base to be used for the conversion, 2..36 or 0
|
|
4739
4785
|
* @returns the #guint64 value or zero on error.
|
|
4740
4786
|
*/
|
|
4741
|
-
function ascii_strtoull(nptr: string
|
|
4787
|
+
function ascii_strtoull(nptr: string, base: number): [ /* returnType */ number, /* endptr */ string ]
|
|
4742
4788
|
/**
|
|
4743
4789
|
* Converts all lower case ASCII letters to upper case ASCII letters.
|
|
4744
4790
|
* @param str a string
|
|
4745
4791
|
* @param len length of `str` in bytes, or -1 if `str` is nul-terminated
|
|
4746
4792
|
* @returns a newly allocated string, with all the lower case characters in @str converted to upper case, with semantics that exactly match g_ascii_toupper(). (Note that this is unlike the old g_strup(), which modified the string in place.)
|
|
4747
4793
|
*/
|
|
4748
|
-
function ascii_strup(str: string
|
|
4794
|
+
function ascii_strup(str: string, len: number): string | null
|
|
4749
4795
|
/**
|
|
4750
4796
|
* Convert a character to ASCII lower case.
|
|
4751
4797
|
*
|
|
@@ -4783,11 +4829,12 @@ function ascii_toupper(c: number): number
|
|
|
4783
4829
|
* @returns If @c is a hex digit (according to g_ascii_isxdigit()), its numeric value. Otherwise, -1.
|
|
4784
4830
|
*/
|
|
4785
4831
|
function ascii_xdigit_value(c: number): number
|
|
4786
|
-
function assert_warning(log_domain: string
|
|
4787
|
-
function assertion_message(domain: string
|
|
4788
|
-
function
|
|
4789
|
-
function
|
|
4790
|
-
function
|
|
4832
|
+
function assert_warning(log_domain: string, file: string, line: number, pretty_function: string, expression: string): void
|
|
4833
|
+
function assertion_message(domain: string, file: string, line: number, func: string, message: string): void
|
|
4834
|
+
function assertion_message_cmpint(domain: string, file: string, line: number, func: string, expr: string, arg1: number, cmp: string, arg2: number, numtype: number): void
|
|
4835
|
+
function assertion_message_cmpstr(domain: string, file: string, line: number, func: string, expr: string, arg1: string, cmp: string, arg2: string): void
|
|
4836
|
+
function assertion_message_cmpstrv(domain: string, file: string, line: number, func: string, expr: string, arg1: string, arg2: string, first_wrong_idx: number): void
|
|
4837
|
+
function assertion_message_error(domain: string, file: string, line: number, func: string, expr: string, error: Error, error_domain: Quark, error_code: number): void
|
|
4791
4838
|
/**
|
|
4792
4839
|
* Specifies a function to be called at normal program termination.
|
|
4793
4840
|
*
|
|
@@ -5239,7 +5286,7 @@ function atomic_ref_count_init(arc: number): void
|
|
|
5239
5286
|
* @param text zero-terminated string with base64 text to decode
|
|
5240
5287
|
* @returns newly allocated buffer containing the binary data that @text represents. The returned buffer must be freed with g_free().
|
|
5241
5288
|
*/
|
|
5242
|
-
function base64_decode(text: string
|
|
5289
|
+
function base64_decode(text: string): Uint8Array
|
|
5243
5290
|
/**
|
|
5244
5291
|
* Decode a sequence of Base-64 encoded text into binary data
|
|
5245
5292
|
* by overwriting the input data.
|
|
@@ -5406,7 +5453,7 @@ function build_filenamev(args: string[]): string
|
|
|
5406
5453
|
* @param args %NULL-terminated array of strings containing the path elements.
|
|
5407
5454
|
* @returns a newly-allocated string that must be freed with g_free().
|
|
5408
5455
|
*/
|
|
5409
|
-
function build_pathv(separator: string
|
|
5456
|
+
function build_pathv(separator: string, args: string[]): string
|
|
5410
5457
|
/**
|
|
5411
5458
|
* Frees the memory allocated by the #GByteArray. If `free_segment` is
|
|
5412
5459
|
* %TRUE it frees the actual byte data. If the reference count of
|
|
@@ -5436,8 +5483,10 @@ function byte_array_free_to_bytes(array: Uint8Array): Bytes
|
|
|
5436
5483
|
*/
|
|
5437
5484
|
function byte_array_new(): Uint8Array
|
|
5438
5485
|
/**
|
|
5439
|
-
*
|
|
5440
|
-
*
|
|
5486
|
+
* Creates a byte array containing the `data`.
|
|
5487
|
+
* After this call, `data` belongs to the #GByteArray and may no longer be
|
|
5488
|
+
* modified by the caller. The memory of `data` has to be dynamically
|
|
5489
|
+
* allocated and will eventually be freed with g_free().
|
|
5441
5490
|
*
|
|
5442
5491
|
* Do not use it if `len` is greater than %G_MAXUINT. #GByteArray
|
|
5443
5492
|
* stores the length of its data in #guint, which may be shorter than
|
|
@@ -5576,6 +5625,14 @@ function child_watch_add(priority: number, pid: Pid, function_: ChildWatchFunc):
|
|
|
5576
5625
|
* mechanism, including `waitpid(pid, ...)` or a second child-watch
|
|
5577
5626
|
* source for the same `pid`
|
|
5578
5627
|
* * the application must not ignore `SIGCHLD`
|
|
5628
|
+
* * Before 2.78, the application could not send a signal (`kill()`) to the
|
|
5629
|
+
* watched `pid` in a race free manner. Since 2.78, you can do that while the
|
|
5630
|
+
* associated #GMainContext is acquired.
|
|
5631
|
+
* * Before 2.78, even after destroying the #GSource, you could not
|
|
5632
|
+
* be sure that `pid` wasn't already reaped. Hence, it was also not
|
|
5633
|
+
* safe to `kill()` or `waitpid()` on the process ID after the child watch
|
|
5634
|
+
* source was gone. Destroying the source before it fired made it
|
|
5635
|
+
* impossible to reliably reap the process.
|
|
5579
5636
|
*
|
|
5580
5637
|
* If any of those conditions are not met, this and related APIs will
|
|
5581
5638
|
* not work correctly. This can often be diagnosed via a GLib warning
|
|
@@ -5604,8 +5661,12 @@ function clear_error(): void
|
|
|
5604
5661
|
*
|
|
5605
5662
|
* It is a bug to call this function with an invalid file descriptor.
|
|
5606
5663
|
*
|
|
5607
|
-
*
|
|
5608
|
-
* if) `error` is %NULL and `fd` is a valid open file descriptor.
|
|
5664
|
+
* On POSIX platforms since GLib 2.76, this function is async-signal safe
|
|
5665
|
+
* if (and only if) `error` is %NULL and `fd` is a valid open file descriptor.
|
|
5666
|
+
* This makes it safe to call from a signal handler or a #GSpawnChildSetupFunc
|
|
5667
|
+
* under those conditions.
|
|
5668
|
+
* See [`signal(7)`](man:signal(7)) and
|
|
5669
|
+
* [`signal-safety(7)`](man:signal-safety(7)) for more details.
|
|
5609
5670
|
* @param fd A file descriptor
|
|
5610
5671
|
* @returns %TRUE on success, %FALSE if there was an error.
|
|
5611
5672
|
*/
|
|
@@ -5641,7 +5702,7 @@ function compute_checksum_for_data(checksum_type: ChecksumType, data: Uint8Array
|
|
|
5641
5702
|
* @param length the length of the string, or -1 if the string is null-terminated.
|
|
5642
5703
|
* @returns the checksum as a hexadecimal string, or %NULL if g_checksum_new() fails for @checksum_type. The returned string should be freed with g_free() when done using it.
|
|
5643
5704
|
*/
|
|
5644
|
-
function compute_checksum_for_string(checksum_type: ChecksumType, str: string
|
|
5705
|
+
function compute_checksum_for_string(checksum_type: ChecksumType, str: string, length: number): string | null
|
|
5645
5706
|
/**
|
|
5646
5707
|
* Computes the HMAC for a binary `data`. This is a
|
|
5647
5708
|
* convenience wrapper for g_hmac_new(), g_hmac_get_string()
|
|
@@ -5676,7 +5737,7 @@ function compute_hmac_for_data(digest_type: ChecksumType, key: Uint8Array, data:
|
|
|
5676
5737
|
* @param length the length of the string, or -1 if the string is nul-terminated
|
|
5677
5738
|
* @returns the HMAC as a hexadecimal string. The returned string should be freed with g_free() when done using it.
|
|
5678
5739
|
*/
|
|
5679
|
-
function compute_hmac_for_string(digest_type: ChecksumType, key: Uint8Array, str: string
|
|
5740
|
+
function compute_hmac_for_string(digest_type: ChecksumType, key: Uint8Array, str: string, length: number): string | null
|
|
5680
5741
|
/**
|
|
5681
5742
|
* Converts a string from one character set to another.
|
|
5682
5743
|
*
|
|
@@ -5697,7 +5758,7 @@ function compute_hmac_for_string(digest_type: ChecksumType, key: Uint8Array, str
|
|
|
5697
5758
|
* @param from_codeset character set of `str`.
|
|
5698
5759
|
* @returns If the conversion was successful, a newly allocated buffer containing the converted string, which must be freed with g_free(). Otherwise %NULL and @error will be set.
|
|
5699
5760
|
*/
|
|
5700
|
-
function convert(str: Uint8Array, to_codeset: string
|
|
5761
|
+
function convert(str: Uint8Array, to_codeset: string, from_codeset: string): [ /* returnType */ Uint8Array, /* bytes_read */ number ]
|
|
5701
5762
|
function convert_error_quark(): Quark
|
|
5702
5763
|
/**
|
|
5703
5764
|
* Converts a string from one character set to another, possibly
|
|
@@ -5723,7 +5784,7 @@ function convert_error_quark(): Quark
|
|
|
5723
5784
|
* @param fallback UTF-8 string to use in place of characters not present in the target encoding. (The string must be representable in the target encoding). If %NULL, characters not in the target encoding will be represented as Unicode escapes \uxxxx or \Uxxxxyyyy.
|
|
5724
5785
|
* @returns If the conversion was successful, a newly allocated buffer containing the converted string, which must be freed with g_free(). Otherwise %NULL and @error will be set.
|
|
5725
5786
|
*/
|
|
5726
|
-
function convert_with_fallback(str: Uint8Array, to_codeset: string
|
|
5787
|
+
function convert_with_fallback(str: Uint8Array, to_codeset: string, from_codeset: string, fallback: string): [ /* returnType */ Uint8Array, /* bytes_read */ number ]
|
|
5727
5788
|
/**
|
|
5728
5789
|
* Calls the given function for each data element of the datalist. The
|
|
5729
5790
|
* function is called with each data element's #GQuark id and data,
|
|
@@ -5746,7 +5807,7 @@ function datalist_foreach(datalist: Data, func: DataForeachFunc): void
|
|
|
5746
5807
|
* @param key the string identifying a data element.
|
|
5747
5808
|
* @returns the data element, or %NULL if it is not found.
|
|
5748
5809
|
*/
|
|
5749
|
-
function datalist_get_data(datalist: Data, key: string
|
|
5810
|
+
function datalist_get_data(datalist: Data, key: string): any | null
|
|
5750
5811
|
/**
|
|
5751
5812
|
* Gets flags values packed in together with the datalist.
|
|
5752
5813
|
* See g_datalist_set_flags().
|
|
@@ -5876,7 +5937,7 @@ function date_is_leap_year(year: DateYear): boolean
|
|
|
5876
5937
|
* @param date valid #GDate
|
|
5877
5938
|
* @returns number of characters written to the buffer, or 0 the buffer was too small
|
|
5878
5939
|
*/
|
|
5879
|
-
function date_strftime(s: string | null, slen: number, format: string
|
|
5940
|
+
function date_strftime(s: string | null, slen: number, format: string, date: Date): number
|
|
5880
5941
|
/**
|
|
5881
5942
|
* Returns %TRUE if the day of the month is valid (a day is valid if it's
|
|
5882
5943
|
* between 1 and 31 inclusive).
|
|
@@ -5932,19 +5993,19 @@ function date_valid_year(year: DateYear): boolean
|
|
|
5932
5993
|
* @param category a locale category
|
|
5933
5994
|
* @returns the translated string for the given locale category
|
|
5934
5995
|
*/
|
|
5935
|
-
function dcgettext(domain: string | null, msgid: string
|
|
5996
|
+
function dcgettext(domain: string | null, msgid: string, category: number): string
|
|
5936
5997
|
/**
|
|
5937
5998
|
* This function is a wrapper of dgettext() which does not translate
|
|
5938
5999
|
* the message if the default domain as set with textdomain() has no
|
|
5939
6000
|
* translations for the current locale.
|
|
5940
6001
|
*
|
|
5941
6002
|
* The advantage of using this function over dgettext() proper is that
|
|
5942
|
-
* libraries using this function (like GTK
|
|
6003
|
+
* libraries using this function (like GTK) will not use translations
|
|
5943
6004
|
* if the application using the library does not have translations for
|
|
5944
6005
|
* the current locale. This results in a consistent English-only
|
|
5945
6006
|
* interface instead of one having partial translations. For this
|
|
5946
6007
|
* feature to work, the call to textdomain() and setlocale() should
|
|
5947
|
-
* precede any g_dgettext() invocations. For GTK
|
|
6008
|
+
* precede any g_dgettext() invocations. For GTK, it means calling
|
|
5948
6009
|
* textdomain() before gtk_init or its variants.
|
|
5949
6010
|
*
|
|
5950
6011
|
* This function disables translations if and only if upon its first
|
|
@@ -5962,7 +6023,7 @@ function dcgettext(domain: string | null, msgid: string | null, category: number
|
|
|
5962
6023
|
*
|
|
5963
6024
|
* Note that this behavior may not be desired for example if an application
|
|
5964
6025
|
* has its untranslated messages in a language other than English. In those
|
|
5965
|
-
* cases the application should call textdomain() after initializing GTK
|
|
6026
|
+
* cases the application should call textdomain() after initializing GTK.
|
|
5966
6027
|
*
|
|
5967
6028
|
* Applications should normally not use this function directly,
|
|
5968
6029
|
* but use the _() macro for translations.
|
|
@@ -5970,7 +6031,7 @@ function dcgettext(domain: string | null, msgid: string | null, category: number
|
|
|
5970
6031
|
* @param msgid message to translate
|
|
5971
6032
|
* @returns The translated string
|
|
5972
6033
|
*/
|
|
5973
|
-
function dgettext(domain: string | null, msgid: string
|
|
6034
|
+
function dgettext(domain: string | null, msgid: string): string
|
|
5974
6035
|
/**
|
|
5975
6036
|
* Creates a subdirectory in the preferred directory for temporary
|
|
5976
6037
|
* files (as returned by g_get_tmp_dir()).
|
|
@@ -6025,7 +6086,7 @@ function direct_hash(v: any | null): number
|
|
|
6025
6086
|
* @param n the quantity for which translation is needed
|
|
6026
6087
|
* @returns The translated string
|
|
6027
6088
|
*/
|
|
6028
|
-
function dngettext(domain: string | null, msgid: string
|
|
6089
|
+
function dngettext(domain: string | null, msgid: string, msgid_plural: string, n: number): string
|
|
6029
6090
|
/**
|
|
6030
6091
|
* Compares the two #gdouble values being pointed to and returns
|
|
6031
6092
|
* %TRUE if they are equal.
|
|
@@ -6065,7 +6126,7 @@ function double_hash(v: any): number
|
|
|
6065
6126
|
* @param msgidoffset the offset of the message id in `msgctxid`
|
|
6066
6127
|
* @returns The translated string
|
|
6067
6128
|
*/
|
|
6068
|
-
function dpgettext(domain: string | null, msgctxtid: string
|
|
6129
|
+
function dpgettext(domain: string | null, msgctxtid: string, msgidoffset: number): string
|
|
6069
6130
|
/**
|
|
6070
6131
|
* This function is a variant of g_dgettext() which supports
|
|
6071
6132
|
* a disambiguating message context. GNU gettext uses the
|
|
@@ -6082,7 +6143,7 @@ function dpgettext(domain: string | null, msgctxtid: string | null, msgidoffset:
|
|
|
6082
6143
|
* @param msgid the message
|
|
6083
6144
|
* @returns The translated string
|
|
6084
6145
|
*/
|
|
6085
|
-
function dpgettext2(domain: string | null, context: string
|
|
6146
|
+
function dpgettext2(domain: string | null, context: string, msgid: string): string
|
|
6086
6147
|
/**
|
|
6087
6148
|
* Returns the value of the environment variable `variable` in the
|
|
6088
6149
|
* provided list `envp`.
|
|
@@ -6376,7 +6437,7 @@ function filename_display_name(filename: string): string | null
|
|
|
6376
6437
|
* @param uri a uri describing a filename (escaped, encoded in ASCII).
|
|
6377
6438
|
* @returns a newly-allocated string holding the resulting filename, or %NULL on an error.
|
|
6378
6439
|
*/
|
|
6379
|
-
function filename_from_uri(uri: string
|
|
6440
|
+
function filename_from_uri(uri: string): [ /* returnType */ string, /* hostname */ string | null ]
|
|
6380
6441
|
/**
|
|
6381
6442
|
* Converts a string from UTF-8 to the encoding GLib uses for
|
|
6382
6443
|
* filenames. Note that on Windows GLib uses UTF-8 for filenames;
|
|
@@ -6392,7 +6453,7 @@ function filename_from_uri(uri: string | null): [ /* returnType */ string, /* ho
|
|
|
6392
6453
|
* @param len the length of the string, or -1 if the string is nul-terminated.
|
|
6393
6454
|
* @returns The converted string, or %NULL on an error.
|
|
6394
6455
|
*/
|
|
6395
|
-
function filename_from_utf8(utf8string: string
|
|
6456
|
+
function filename_from_utf8(utf8string: string, len: number): [ /* returnType */ string, /* bytes_read */ number, /* bytes_written */ number ]
|
|
6396
6457
|
/**
|
|
6397
6458
|
* Converts an absolute filename to an escaped ASCII-encoded URI, with the path
|
|
6398
6459
|
* component following Section 3.3. of RFC 2396.
|
|
@@ -6489,6 +6550,12 @@ function format_size_full(size: number, flags: FormatSizeFlags): string | null
|
|
|
6489
6550
|
* If you know the allocated size of `mem,` calling g_free_sized() may be faster,
|
|
6490
6551
|
* depending on the libc implementation in use.
|
|
6491
6552
|
*
|
|
6553
|
+
* Starting from GLib 2.78, this may happen automatically in case a GCC
|
|
6554
|
+
* compatible compiler is used with some optimization level and the allocated
|
|
6555
|
+
* size is known at compile time (see [documentation of
|
|
6556
|
+
* `__builtin_object_size()`](https://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html)
|
|
6557
|
+
* to understand its caveats).
|
|
6558
|
+
*
|
|
6492
6559
|
* If `mem` is %NULL it simply returns, so there is no need to check `mem`
|
|
6493
6560
|
* against %NULL before calling this function.
|
|
6494
6561
|
* @param mem the memory to free
|
|
@@ -6502,6 +6569,10 @@ function free(mem: any | null): void
|
|
|
6502
6569
|
* It is an error if `size` doesn’t match the size passed when `mem` was
|
|
6503
6570
|
* allocated. `size` is passed to this function to allow optimizations in the
|
|
6504
6571
|
* allocator. If you don’t know the allocation size, use g_free() instead.
|
|
6572
|
+
*
|
|
6573
|
+
* In case a GCC compatible compiler is used, this function may be used
|
|
6574
|
+
* automatically via g_free() if the allocated size is known at compile time,
|
|
6575
|
+
* since GLib 2.78.
|
|
6505
6576
|
* @param mem the memory to free
|
|
6506
6577
|
* @param size size of `mem,` in bytes
|
|
6507
6578
|
*/
|
|
@@ -6541,7 +6612,7 @@ function get_application_name(): string | null
|
|
|
6541
6612
|
* freed.
|
|
6542
6613
|
* @returns %TRUE if the returned charset is UTF-8
|
|
6543
6614
|
*/
|
|
6544
|
-
function get_charset(): [ /* returnType */ boolean, /* charset */ string
|
|
6615
|
+
function get_charset(): [ /* returnType */ boolean, /* charset */ string ]
|
|
6545
6616
|
/**
|
|
6546
6617
|
* Gets the character set for the current locale.
|
|
6547
6618
|
* @returns a newly allocated string containing the name of the character set. This string must be freed with g_free().
|
|
@@ -6567,7 +6638,7 @@ function get_codeset(): string | null
|
|
|
6567
6638
|
* freed.
|
|
6568
6639
|
* @returns %TRUE if the returned charset is UTF-8
|
|
6569
6640
|
*/
|
|
6570
|
-
function get_console_charset(): [ /* returnType */ boolean, /* charset */ string
|
|
6641
|
+
function get_console_charset(): [ /* returnType */ boolean, /* charset */ string ]
|
|
6571
6642
|
/**
|
|
6572
6643
|
* Gets the current directory.
|
|
6573
6644
|
*
|
|
@@ -6672,7 +6743,7 @@ function get_home_dir(): string
|
|
|
6672
6743
|
* The encoding of the returned string is UTF-8.
|
|
6673
6744
|
* @returns the host name of the machine.
|
|
6674
6745
|
*/
|
|
6675
|
-
function get_host_name(): string
|
|
6746
|
+
function get_host_name(): string
|
|
6676
6747
|
/**
|
|
6677
6748
|
* Computes a list of applicable locale names, which can be used to
|
|
6678
6749
|
* e.g. construct locale-dependent filenames or search paths. The returned
|
|
@@ -6702,7 +6773,7 @@ function get_language_names(): string[]
|
|
|
6702
6773
|
* @param category_name a locale category name
|
|
6703
6774
|
* @returns a %NULL-terminated array of strings owned by the thread g_get_language_names_with_category was called from. It must not be modified or freed. It must be copied if planned to be used in another thread.
|
|
6704
6775
|
*/
|
|
6705
|
-
function get_language_names_with_category(category_name: string
|
|
6776
|
+
function get_language_names_with_category(category_name: string): string[]
|
|
6706
6777
|
/**
|
|
6707
6778
|
* Returns a list of derived variants of `locale,` which can be used to
|
|
6708
6779
|
* e.g. construct locale-dependent filenames or search paths. The returned
|
|
@@ -6722,7 +6793,7 @@ function get_language_names_with_category(category_name: string | null): string[
|
|
|
6722
6793
|
* @param locale a locale identifier
|
|
6723
6794
|
* @returns a newly allocated array of newly allocated strings with the locale variants. Free with g_strfreev().
|
|
6724
6795
|
*/
|
|
6725
|
-
function get_locale_variants(locale: string
|
|
6796
|
+
function get_locale_variants(locale: string): string[]
|
|
6726
6797
|
/**
|
|
6727
6798
|
* Queries the system monotonic time.
|
|
6728
6799
|
*
|
|
@@ -6757,13 +6828,13 @@ function get_num_processors(): number
|
|
|
6757
6828
|
* @param key_name a key for the OS info being requested, for example %G_OS_INFO_KEY_NAME.
|
|
6758
6829
|
* @returns The associated value for the requested key or %NULL if this information is not provided.
|
|
6759
6830
|
*/
|
|
6760
|
-
function get_os_info(key_name: string
|
|
6831
|
+
function get_os_info(key_name: string): string | null
|
|
6761
6832
|
/**
|
|
6762
6833
|
* Gets the name of the program. This name should not be localized,
|
|
6763
6834
|
* in contrast to g_get_application_name().
|
|
6764
6835
|
*
|
|
6765
6836
|
* If you are using #GApplication the program name is set in
|
|
6766
|
-
* g_application_run(). In case of GDK or GTK
|
|
6837
|
+
* g_application_run(). In case of GDK or GTK it is set in
|
|
6767
6838
|
* gdk_init(), which is called by gtk_init() and the
|
|
6768
6839
|
* #GtkApplication::startup handler. The program name is found by
|
|
6769
6840
|
* taking the last component of `argv[`0].
|
|
@@ -7245,7 +7316,7 @@ function hook_unref(hook_list: HookList, hook: Hook): void
|
|
|
7245
7316
|
* @param hostname a hostname
|
|
7246
7317
|
* @returns %TRUE if @hostname contains any ASCII-encoded segments.
|
|
7247
7318
|
*/
|
|
7248
|
-
function hostname_is_ascii_encoded(hostname: string
|
|
7319
|
+
function hostname_is_ascii_encoded(hostname: string): boolean
|
|
7249
7320
|
/**
|
|
7250
7321
|
* Tests if `hostname` is the string form of an IPv4 or IPv6 address.
|
|
7251
7322
|
* (Eg, "192.168.0.1".)
|
|
@@ -7254,7 +7325,7 @@ function hostname_is_ascii_encoded(hostname: string | null): boolean
|
|
|
7254
7325
|
* @param hostname a hostname (or IP address in string form)
|
|
7255
7326
|
* @returns %TRUE if @hostname is an IP address
|
|
7256
7327
|
*/
|
|
7257
|
-
function hostname_is_ip_address(hostname: string
|
|
7328
|
+
function hostname_is_ip_address(hostname: string): boolean
|
|
7258
7329
|
/**
|
|
7259
7330
|
* Tests if `hostname` contains Unicode characters. If this returns
|
|
7260
7331
|
* %TRUE, you need to encode the hostname with g_hostname_to_ascii()
|
|
@@ -7266,7 +7337,7 @@ function hostname_is_ip_address(hostname: string | null): boolean
|
|
|
7266
7337
|
* @param hostname a hostname
|
|
7267
7338
|
* @returns %TRUE if @hostname contains any non-ASCII characters
|
|
7268
7339
|
*/
|
|
7269
|
-
function hostname_is_non_ascii(hostname: string
|
|
7340
|
+
function hostname_is_non_ascii(hostname: string): boolean
|
|
7270
7341
|
/**
|
|
7271
7342
|
* Converts `hostname` to its canonical ASCII form; an ASCII-only
|
|
7272
7343
|
* string containing no uppercase letters and not ending with a
|
|
@@ -7274,7 +7345,7 @@ function hostname_is_non_ascii(hostname: string | null): boolean
|
|
|
7274
7345
|
* @param hostname a valid UTF-8 or ASCII hostname
|
|
7275
7346
|
* @returns an ASCII hostname, which must be freed, or %NULL if @hostname is in some way invalid.
|
|
7276
7347
|
*/
|
|
7277
|
-
function hostname_to_ascii(hostname: string
|
|
7348
|
+
function hostname_to_ascii(hostname: string): string | null
|
|
7278
7349
|
/**
|
|
7279
7350
|
* Converts `hostname` to its canonical presentation form; a UTF-8
|
|
7280
7351
|
* string in Unicode normalization form C, containing no uppercase
|
|
@@ -7286,7 +7357,7 @@ function hostname_to_ascii(hostname: string | null): string | null
|
|
|
7286
7357
|
* @param hostname a valid UTF-8 or ASCII hostname
|
|
7287
7358
|
* @returns a UTF-8 hostname, which must be freed, or %NULL if @hostname is in some way invalid.
|
|
7288
7359
|
*/
|
|
7289
|
-
function hostname_to_unicode(hostname: string
|
|
7360
|
+
function hostname_to_unicode(hostname: string): string | null
|
|
7290
7361
|
/**
|
|
7291
7362
|
* Adds a function to be called whenever there are no higher priority
|
|
7292
7363
|
* events pending.
|
|
@@ -7384,7 +7455,7 @@ function int_hash(v: any): number
|
|
|
7384
7455
|
* @param string a static string
|
|
7385
7456
|
* @returns a canonical representation for the string
|
|
7386
7457
|
*/
|
|
7387
|
-
function intern_static_string(string: string | null): string
|
|
7458
|
+
function intern_static_string(string: string | null): string
|
|
7388
7459
|
/**
|
|
7389
7460
|
* Returns a canonical representation for `string`. Interned strings
|
|
7390
7461
|
* can be compared for equality by comparing the pointers, instead of
|
|
@@ -7396,7 +7467,7 @@ function intern_static_string(string: string | null): string | null
|
|
|
7396
7467
|
* @param string a string
|
|
7397
7468
|
* @returns a canonical representation for the string
|
|
7398
7469
|
*/
|
|
7399
|
-
function intern_string(string: string | null): string
|
|
7470
|
+
function intern_string(string: string | null): string
|
|
7400
7471
|
/**
|
|
7401
7472
|
* Adds the #GIOChannel into the default main loop context
|
|
7402
7473
|
* with the given priority.
|
|
@@ -7465,7 +7536,7 @@ function listenv(): string[]
|
|
|
7465
7536
|
* @param len the length of the string, or -1 if the string is nul-terminated.
|
|
7466
7537
|
* @returns A newly-allocated buffer containing the converted string, or %NULL on an error, and error will be set.
|
|
7467
7538
|
*/
|
|
7468
|
-
function locale_from_utf8(utf8string: string
|
|
7539
|
+
function locale_from_utf8(utf8string: string, len: number): [ /* returnType */ Uint8Array, /* bytes_read */ number ]
|
|
7469
7540
|
/**
|
|
7470
7541
|
* Converts a string which is in the encoding used for strings by
|
|
7471
7542
|
* the C runtime (usually the same as that used by the operating
|
|
@@ -7535,7 +7606,7 @@ function log_get_debug_enabled(): boolean
|
|
|
7535
7606
|
* @param log_domain the log domain
|
|
7536
7607
|
* @param handler_id the id of the handler, which was returned in g_log_set_handler()
|
|
7537
7608
|
*/
|
|
7538
|
-
function log_remove_handler(log_domain: string
|
|
7609
|
+
function log_remove_handler(log_domain: string, handler_id: number): void
|
|
7539
7610
|
/**
|
|
7540
7611
|
* Sets the message levels which are always fatal, in any log domain.
|
|
7541
7612
|
* When a message with any of these levels is logged the program terminates.
|
|
@@ -7585,7 +7656,7 @@ function log_set_debug_enabled(enabled: boolean): void
|
|
|
7585
7656
|
* @param fatal_mask the new fatal mask
|
|
7586
7657
|
* @returns the old fatal mask for the log domain
|
|
7587
7658
|
*/
|
|
7588
|
-
function log_set_fatal_mask(log_domain: string
|
|
7659
|
+
function log_set_fatal_mask(log_domain: string, fatal_mask: LogLevelFlags): LogLevelFlags
|
|
7589
7660
|
/**
|
|
7590
7661
|
* Like g_log_set_handler(), but takes a destroy notify for the `user_data`.
|
|
7591
7662
|
*
|
|
@@ -7841,7 +7912,7 @@ function main_current_source(): Source | null
|
|
|
7841
7912
|
/**
|
|
7842
7913
|
* Returns the depth of the stack of calls to
|
|
7843
7914
|
* g_main_context_dispatch() on any #GMainContext in the current thread.
|
|
7844
|
-
*
|
|
7915
|
+
* That is, when called from the toplevel, it gives 0. When
|
|
7845
7916
|
* called from within a callback from g_main_context_iteration()
|
|
7846
7917
|
* (or g_main_loop_run(), etc.) it returns 1. When called from within
|
|
7847
7918
|
* a callback to a recursive call to g_main_context_iteration(),
|
|
@@ -8009,7 +8080,7 @@ function markup_error_quark(): Quark
|
|
|
8009
8080
|
* @param length length of `text` in bytes, or -1 if the text is nul-terminated
|
|
8010
8081
|
* @returns a newly allocated string with the escaped text
|
|
8011
8082
|
*/
|
|
8012
|
-
function markup_escape_text(text: string
|
|
8083
|
+
function markup_escape_text(text: string, length: number): string | null
|
|
8013
8084
|
/**
|
|
8014
8085
|
* Checks whether the allocator used by g_malloc() is the system's
|
|
8015
8086
|
* malloc implementation. If it returns %TRUE memory allocated with
|
|
@@ -8117,7 +8188,7 @@ function number_parser_error_quark(): Quark
|
|
|
8117
8188
|
* calling g_on_error_stack_trace() instead.
|
|
8118
8189
|
* @param prg_name the program name, needed by gdb for the "[S]tack trace" option. If `prg_name` is %NULL, g_get_prgname() is called to get the program name (which will work correctly if gdk_init() or gtk_init() has been called)
|
|
8119
8190
|
*/
|
|
8120
|
-
function on_error_query(prg_name: string
|
|
8191
|
+
function on_error_query(prg_name: string): void
|
|
8121
8192
|
/**
|
|
8122
8193
|
* Invokes gdb, which attaches to the current process and shows a
|
|
8123
8194
|
* stack trace. Called by g_on_error_query() when the "[S]tack trace"
|
|
@@ -8134,7 +8205,7 @@ function on_error_query(prg_name: string | null): void
|
|
|
8134
8205
|
* handle that exception (see [Running GLib Applications](glib-running.html)).
|
|
8135
8206
|
* @param prg_name the program name, needed by gdb for the "[S]tack trace" option
|
|
8136
8207
|
*/
|
|
8137
|
-
function on_error_stack_trace(prg_name: string
|
|
8208
|
+
function on_error_stack_trace(prg_name: string): void
|
|
8138
8209
|
/**
|
|
8139
8210
|
* Function to be called when starting a critical initialization
|
|
8140
8211
|
* section. The argument `location` must point to a static
|
|
@@ -8184,7 +8255,7 @@ function option_error_quark(): Quark
|
|
|
8184
8255
|
/**
|
|
8185
8256
|
* Parses a string containing debugging options
|
|
8186
8257
|
* into a %guint containing bit flags. This is used
|
|
8187
|
-
* within GDK and GTK
|
|
8258
|
+
* within GDK and GTK to parse the debug options passed on the
|
|
8188
8259
|
* command line or through environment variables.
|
|
8189
8260
|
*
|
|
8190
8261
|
* If `string` is equal to "all", all flags are set. Any flags
|
|
@@ -8282,7 +8353,7 @@ function path_skip_root(file_name: string): string | null
|
|
|
8282
8353
|
* @param string the UTF-8 encoded string to match
|
|
8283
8354
|
* @returns %TRUE if @string matches @pspec
|
|
8284
8355
|
*/
|
|
8285
|
-
function pattern_match_simple(pattern: string
|
|
8356
|
+
function pattern_match_simple(pattern: string, string: string): boolean
|
|
8286
8357
|
/**
|
|
8287
8358
|
* This is equivalent to g_bit_lock, but working on pointers (or other
|
|
8288
8359
|
* pointer-sized values).
|
|
@@ -8353,7 +8424,7 @@ function poll(fds: PollFD, nfds: number, timeout: number): number
|
|
|
8353
8424
|
* @param err a return location for a #GError, or %NULL
|
|
8354
8425
|
* @param prefix string to prefix `err` with
|
|
8355
8426
|
*/
|
|
8356
|
-
function prefix_error_literal(err: Error | null, prefix: string
|
|
8427
|
+
function prefix_error_literal(err: Error | null, prefix: string): void
|
|
8357
8428
|
/**
|
|
8358
8429
|
* If `dest` is %NULL, free `src;` otherwise, moves `src` into *`dest`.
|
|
8359
8430
|
* The error variable `dest` points to must be %NULL.
|
|
@@ -8378,7 +8449,7 @@ function propagate_error(src: Error): /* dest */ Error | null
|
|
|
8378
8449
|
* with statically allocated strings in the main program, but not with
|
|
8379
8450
|
* statically allocated memory in dynamically loaded modules, if you
|
|
8380
8451
|
* expect to ever unload the module again (e.g. do not use this
|
|
8381
|
-
* function in GTK
|
|
8452
|
+
* function in GTK theme engines).
|
|
8382
8453
|
*
|
|
8383
8454
|
* This function must not be used before library constructors have finished
|
|
8384
8455
|
* running. In particular, this means it cannot be used to initialize global
|
|
@@ -8404,7 +8475,7 @@ function quark_from_string(string: string | null): Quark
|
|
|
8404
8475
|
* @param quark a #GQuark.
|
|
8405
8476
|
* @returns the string associated with the #GQuark
|
|
8406
8477
|
*/
|
|
8407
|
-
function quark_to_string(quark: Quark): string
|
|
8478
|
+
function quark_to_string(quark: Quark): string
|
|
8408
8479
|
/**
|
|
8409
8480
|
* Gets the #GQuark associated with the given string, or 0 if string is
|
|
8410
8481
|
* %NULL or it has no associated #GQuark.
|
|
@@ -8589,7 +8660,7 @@ function ref_string_length(str: string | null): number
|
|
|
8589
8660
|
* @param str a NUL-terminated string
|
|
8590
8661
|
* @returns the newly created reference counted string
|
|
8591
8662
|
*/
|
|
8592
|
-
function ref_string_new(str: string
|
|
8663
|
+
function ref_string_new(str: string): string | null
|
|
8593
8664
|
/**
|
|
8594
8665
|
* Creates a new reference counted string and copies the content of `str`
|
|
8595
8666
|
* into it.
|
|
@@ -8600,7 +8671,7 @@ function ref_string_new(str: string | null): string | null
|
|
|
8600
8671
|
* @param str a NUL-terminated string
|
|
8601
8672
|
* @returns the newly created reference counted string, or a new reference to an existing string
|
|
8602
8673
|
*/
|
|
8603
|
-
function ref_string_new_intern(str: string
|
|
8674
|
+
function ref_string_new_intern(str: string): string | null
|
|
8604
8675
|
/**
|
|
8605
8676
|
* Creates a new reference counted string and copies the contents of `str`
|
|
8606
8677
|
* into it, up to `len` bytes.
|
|
@@ -8611,7 +8682,7 @@ function ref_string_new_intern(str: string | null): string | null
|
|
|
8611
8682
|
* @param len length of `str` to use, or -1 if `str` is nul-terminated
|
|
8612
8683
|
* @returns the newly created reference counted string
|
|
8613
8684
|
*/
|
|
8614
|
-
function ref_string_new_len(str: string
|
|
8685
|
+
function ref_string_new_len(str: string, len: number): string | null
|
|
8615
8686
|
/**
|
|
8616
8687
|
* Releases a reference on a string; if it was the last reference, the
|
|
8617
8688
|
* resources allocated by the string are freed as well.
|
|
@@ -8631,7 +8702,7 @@ function ref_string_release(str: string | null): void
|
|
|
8631
8702
|
* @param replacement the replacement string
|
|
8632
8703
|
* @returns whether @replacement is a valid replacement string
|
|
8633
8704
|
*/
|
|
8634
|
-
function regex_check_replacement(replacement: string
|
|
8705
|
+
function regex_check_replacement(replacement: string): [ /* returnType */ boolean, /* has_references */ boolean ]
|
|
8635
8706
|
function regex_error_quark(): Quark
|
|
8636
8707
|
/**
|
|
8637
8708
|
* Escapes the nul characters in `string` to "\x00". It can be used
|
|
@@ -8643,7 +8714,7 @@ function regex_error_quark(): Quark
|
|
|
8643
8714
|
* @param length the length of `string`
|
|
8644
8715
|
* @returns a newly-allocated escaped string
|
|
8645
8716
|
*/
|
|
8646
|
-
function regex_escape_nul(string: string
|
|
8717
|
+
function regex_escape_nul(string: string, length: number): string | null
|
|
8647
8718
|
/**
|
|
8648
8719
|
* Escapes the special characters used for regular expressions
|
|
8649
8720
|
* in `string,` for instance "a.b*c" becomes "a\.b\*c". This
|
|
@@ -8656,7 +8727,7 @@ function regex_escape_nul(string: string | null, length: number): string | null
|
|
|
8656
8727
|
* @param length the length of `string,` in bytes, or -1 if `string` is nul-terminated
|
|
8657
8728
|
* @returns a newly-allocated escaped string
|
|
8658
8729
|
*/
|
|
8659
|
-
function regex_escape_string(string: string
|
|
8730
|
+
function regex_escape_string(string: string, length: number): string | null
|
|
8660
8731
|
/**
|
|
8661
8732
|
* Scans for a match in `string` for `pattern`.
|
|
8662
8733
|
*
|
|
@@ -8674,7 +8745,7 @@ function regex_escape_string(string: string | null, length: number): string | nu
|
|
|
8674
8745
|
* @param match_options match options, or 0
|
|
8675
8746
|
* @returns %TRUE if the string matched, %FALSE otherwise
|
|
8676
8747
|
*/
|
|
8677
|
-
function regex_match_simple(pattern: string
|
|
8748
|
+
function regex_match_simple(pattern: string, string: string, compile_options: RegexCompileFlags, match_options: RegexMatchFlags): boolean
|
|
8678
8749
|
/**
|
|
8679
8750
|
* Breaks the string on the pattern, and returns an array of
|
|
8680
8751
|
* the tokens. If the pattern contains capturing parentheses,
|
|
@@ -8709,7 +8780,7 @@ function regex_match_simple(pattern: string | null, string: string | null, compi
|
|
|
8709
8780
|
* @param match_options match options, or 0
|
|
8710
8781
|
* @returns a %NULL-terminated array of strings. Free it using g_strfreev()
|
|
8711
8782
|
*/
|
|
8712
|
-
function regex_split_simple(pattern: string
|
|
8783
|
+
function regex_split_simple(pattern: string, string: string, compile_options: RegexCompileFlags, match_options: RegexMatchFlags): string[]
|
|
8713
8784
|
/**
|
|
8714
8785
|
* Resets the cache used for g_get_user_special_dir(), so
|
|
8715
8786
|
* that the latest on-disk version is used. Call this only
|
|
@@ -8826,7 +8897,7 @@ function sequence_swap(a: SequenceIter, b: SequenceIter): void
|
|
|
8826
8897
|
* or when displaying an application's name in the task list.
|
|
8827
8898
|
* @param application_name localized name of the application
|
|
8828
8899
|
*/
|
|
8829
|
-
function set_application_name(application_name: string
|
|
8900
|
+
function set_application_name(application_name: string): void
|
|
8830
8901
|
/**
|
|
8831
8902
|
* Does nothing if `err` is %NULL; if `err` is non-%NULL, then *`err`
|
|
8832
8903
|
* must be %NULL. A new #GError is created and assigned to *`err`.
|
|
@@ -8837,13 +8908,13 @@ function set_application_name(application_name: string | null): void
|
|
|
8837
8908
|
* @param code error code
|
|
8838
8909
|
* @param message error message
|
|
8839
8910
|
*/
|
|
8840
|
-
function set_error_literal(domain: Quark, code: number, message: string
|
|
8911
|
+
function set_error_literal(domain: Quark, code: number, message: string): /* err */ Error
|
|
8841
8912
|
/**
|
|
8842
8913
|
* Sets the name of the program. This name should not be localized,
|
|
8843
8914
|
* in contrast to g_set_application_name().
|
|
8844
8915
|
*
|
|
8845
8916
|
* If you are using #GApplication the program name is set in
|
|
8846
|
-
* g_application_run(). In case of GDK or GTK
|
|
8917
|
+
* g_application_run(). In case of GDK or GTK it is set in
|
|
8847
8918
|
* gdk_init(), which is called by gtk_init() and the
|
|
8848
8919
|
* #GtkApplication::startup handler. The program name is found by
|
|
8849
8920
|
* taking the last component of `argv[`0].
|
|
@@ -8853,7 +8924,7 @@ function set_error_literal(domain: Quark, code: number, message: string | null):
|
|
|
8853
8924
|
* could only be called once per process.
|
|
8854
8925
|
* @param prgname the name of the program.
|
|
8855
8926
|
*/
|
|
8856
|
-
function set_prgname(prgname: string
|
|
8927
|
+
function set_prgname(prgname: string): void
|
|
8857
8928
|
/**
|
|
8858
8929
|
* Sets an environment variable. On UNIX, both the variable's name and
|
|
8859
8930
|
* value can be arbitrary byte strings, except that the variable's name
|
|
@@ -9086,7 +9157,7 @@ function source_remove_by_user_data(user_data: any | null): boolean
|
|
|
9086
9157
|
* @param tag a #GSource ID
|
|
9087
9158
|
* @param name debug name for the source
|
|
9088
9159
|
*/
|
|
9089
|
-
function source_set_name_by_id(tag: number, name: string
|
|
9160
|
+
function source_set_name_by_id(tag: number, name: string): void
|
|
9090
9161
|
/**
|
|
9091
9162
|
* Gets the smallest prime number from a built-in array of primes which
|
|
9092
9163
|
* is larger than `num`. This is used within GLib to calculate the optimum
|
|
@@ -9515,7 +9586,7 @@ function spawn_sync(working_directory: string | null, argv: string[], envp: stri
|
|
|
9515
9586
|
* @param src source string.
|
|
9516
9587
|
* @returns a pointer to the trailing nul byte in `dest`.
|
|
9517
9588
|
*/
|
|
9518
|
-
function stpcpy(dest: string | null, src: string
|
|
9589
|
+
function stpcpy(dest: string | null, src: string): string | null
|
|
9519
9590
|
/**
|
|
9520
9591
|
* Compares two strings for byte-by-byte equality and returns %TRUE
|
|
9521
9592
|
* if they are equal. It can be passed to g_hash_table_new() as the
|
|
@@ -9536,14 +9607,14 @@ function str_equal(v1: any, v2: any): boolean
|
|
|
9536
9607
|
* @param prefix the nul-terminated prefix to look for
|
|
9537
9608
|
* @returns %TRUE if @str begins with @prefix, %FALSE otherwise.
|
|
9538
9609
|
*/
|
|
9539
|
-
function str_has_prefix(str: string
|
|
9610
|
+
function str_has_prefix(str: string, prefix: string): boolean
|
|
9540
9611
|
/**
|
|
9541
9612
|
* Looks whether the string `str` ends with `suffix`.
|
|
9542
9613
|
* @param str a nul-terminated string
|
|
9543
9614
|
* @param suffix the nul-terminated suffix to look for
|
|
9544
9615
|
* @returns %TRUE if @str end with @suffix, %FALSE otherwise.
|
|
9545
9616
|
*/
|
|
9546
|
-
function str_has_suffix(str: string
|
|
9617
|
+
function str_has_suffix(str: string, suffix: string): boolean
|
|
9547
9618
|
/**
|
|
9548
9619
|
* Converts a string to a hash value.
|
|
9549
9620
|
*
|
|
@@ -9569,7 +9640,7 @@ function str_hash(v: any): number
|
|
|
9569
9640
|
* @param str a string
|
|
9570
9641
|
* @returns %TRUE if @str is ASCII
|
|
9571
9642
|
*/
|
|
9572
|
-
function str_is_ascii(str: string
|
|
9643
|
+
function str_is_ascii(str: string): boolean
|
|
9573
9644
|
/**
|
|
9574
9645
|
* Checks if a search conducted for `search_term` should match
|
|
9575
9646
|
* `potential_hit`.
|
|
@@ -9598,7 +9669,7 @@ function str_is_ascii(str: string | null): boolean
|
|
|
9598
9669
|
* @param accept_alternates %TRUE to accept ASCII alternates
|
|
9599
9670
|
* @returns %TRUE if @potential_hit is a hit
|
|
9600
9671
|
*/
|
|
9601
|
-
function str_match_string(search_term: string
|
|
9672
|
+
function str_match_string(search_term: string, potential_hit: string, accept_alternates: boolean): boolean
|
|
9602
9673
|
/**
|
|
9603
9674
|
* Transliterate `str` to plain ASCII.
|
|
9604
9675
|
*
|
|
@@ -9622,7 +9693,7 @@ function str_match_string(search_term: string | null, potential_hit: string | nu
|
|
|
9622
9693
|
* @param from_locale the source locale, if known
|
|
9623
9694
|
* @returns a string in plain ASCII
|
|
9624
9695
|
*/
|
|
9625
|
-
function str_to_ascii(str: string
|
|
9696
|
+
function str_to_ascii(str: string, from_locale: string | null): string | null
|
|
9626
9697
|
/**
|
|
9627
9698
|
* Tokenises `string` and performs folding on each token.
|
|
9628
9699
|
*
|
|
@@ -9643,7 +9714,7 @@ function str_to_ascii(str: string | null, from_locale: string | null): string |
|
|
|
9643
9714
|
* @param translit_locale the language code (like 'de' or 'en_GB') from which `string` originates
|
|
9644
9715
|
* @returns the folded tokens
|
|
9645
9716
|
*/
|
|
9646
|
-
function str_tokenize_and_fold(string: string
|
|
9717
|
+
function str_tokenize_and_fold(string: string, translit_locale: string | null): [ /* returnType */ string[], /* ascii_alternates */ string[] ]
|
|
9647
9718
|
/**
|
|
9648
9719
|
* For each character in `string,` if the character is not in `valid_chars,`
|
|
9649
9720
|
* replaces the character with `substitutor`.
|
|
@@ -9671,7 +9742,7 @@ function str_tokenize_and_fold(string: string | null, translit_locale: string |
|
|
|
9671
9742
|
* @param substitutor replacement character for disallowed bytes
|
|
9672
9743
|
* @returns the modified @string
|
|
9673
9744
|
*/
|
|
9674
|
-
function strcanon(string: string | null, valid_chars: string
|
|
9745
|
+
function strcanon(string: string | null, valid_chars: string, substitutor: number): string | null
|
|
9675
9746
|
/**
|
|
9676
9747
|
* A case-insensitive string comparison, corresponding to the standard
|
|
9677
9748
|
* strcasecmp() function on platforms which support it.
|
|
@@ -9679,7 +9750,7 @@ function strcanon(string: string | null, valid_chars: string | null, substitutor
|
|
|
9679
9750
|
* @param s2 a string to compare with `s1`
|
|
9680
9751
|
* @returns 0 if the strings match, a negative value if @s1 < @s2, or a positive value if @s1 > @s2.
|
|
9681
9752
|
*/
|
|
9682
|
-
function strcasecmp(s1: string
|
|
9753
|
+
function strcasecmp(s1: string, s2: string): number
|
|
9683
9754
|
/**
|
|
9684
9755
|
* Removes trailing whitespace from a string.
|
|
9685
9756
|
*
|
|
@@ -9725,7 +9796,7 @@ function strcmp0(str1: string | null, str2: string | null): number
|
|
|
9725
9796
|
* @param source a string to compress
|
|
9726
9797
|
* @returns a newly-allocated copy of @source with all escaped character compressed
|
|
9727
9798
|
*/
|
|
9728
|
-
function strcompress(source: string
|
|
9799
|
+
function strcompress(source: string): string | null
|
|
9729
9800
|
/**
|
|
9730
9801
|
* Converts any delimiter characters in `string` to `new_delimiter`.
|
|
9731
9802
|
*
|
|
@@ -9794,7 +9865,7 @@ function strdup(str: string | null): string | null
|
|
|
9794
9865
|
* @param errnum the system error number. See the standard C %errno documentation
|
|
9795
9866
|
* @returns a UTF-8 string describing the error code. If the error code is unknown, it returns a string like "Unknown error: <code>".
|
|
9796
9867
|
*/
|
|
9797
|
-
function strerror(errnum: number): string
|
|
9868
|
+
function strerror(errnum: number): string
|
|
9798
9869
|
/**
|
|
9799
9870
|
* Escapes the special characters '\b', '\f', '\n', '\r', '\t', '\v', '\'
|
|
9800
9871
|
* and '"' in the string `source` by inserting a '\' before
|
|
@@ -9808,7 +9879,7 @@ function strerror(errnum: number): string | null
|
|
|
9808
9879
|
* @param exceptions a string of characters not to escape in `source`
|
|
9809
9880
|
* @returns a newly-allocated copy of @source with certain characters escaped. See above.
|
|
9810
9881
|
*/
|
|
9811
|
-
function strescape(source: string
|
|
9882
|
+
function strescape(source: string, exceptions: string | null): string | null
|
|
9812
9883
|
/**
|
|
9813
9884
|
* Frees a %NULL-terminated array of strings, as well as each
|
|
9814
9885
|
* string it contains.
|
|
@@ -9823,7 +9894,7 @@ function strfreev(str_array: string | null): void
|
|
|
9823
9894
|
* @param msgval another string
|
|
9824
9895
|
* @returns @msgval, unless @msgval is identical to @msgid and contains a '|' character, in which case a pointer to the substring of msgid after the first '|' character is returned.
|
|
9825
9896
|
*/
|
|
9826
|
-
function strip_context(msgid: string
|
|
9897
|
+
function strip_context(msgid: string, msgval: string): string
|
|
9827
9898
|
/**
|
|
9828
9899
|
* Joins a number of strings together to form one long string, with the
|
|
9829
9900
|
* optional `separator` inserted between each of them. The returned string
|
|
@@ -9856,7 +9927,7 @@ function strjoinv(separator: string | null, str_array: string | null): string |
|
|
|
9856
9927
|
* @param dest_size length of `dest` buffer in bytes (not length of existing string inside `dest)`
|
|
9857
9928
|
* @returns size of attempted result, which is MIN (dest_size, strlen (original dest)) + strlen (src), so if retval >= dest_size, truncation occurred.
|
|
9858
9929
|
*/
|
|
9859
|
-
function strlcat(dest: string | null, src: string
|
|
9930
|
+
function strlcat(dest: string | null, src: string, dest_size: number): number
|
|
9860
9931
|
/**
|
|
9861
9932
|
* Portability wrapper that calls strlcpy() on systems which have it,
|
|
9862
9933
|
* and emulates strlcpy() otherwise. Copies `src` to `dest;` `dest` is
|
|
@@ -9877,7 +9948,7 @@ function strlcat(dest: string | null, src: string | null, dest_size: number): nu
|
|
|
9877
9948
|
* @param dest_size length of `dest` in bytes
|
|
9878
9949
|
* @returns length of @src
|
|
9879
9950
|
*/
|
|
9880
|
-
function strlcpy(dest: string | null, src: string
|
|
9951
|
+
function strlcpy(dest: string | null, src: string, dest_size: number): number
|
|
9881
9952
|
/**
|
|
9882
9953
|
* A case-insensitive string comparison, corresponding to the standard
|
|
9883
9954
|
* strncasecmp() function on platforms which support it. It is similar
|
|
@@ -9888,7 +9959,7 @@ function strlcpy(dest: string | null, src: string | null, dest_size: number): nu
|
|
|
9888
9959
|
* @param n the maximum number of characters to compare
|
|
9889
9960
|
* @returns 0 if the strings match, a negative value if @s1 < @s2, or a positive value if @s1 > @s2.
|
|
9890
9961
|
*/
|
|
9891
|
-
function strncasecmp(s1: string
|
|
9962
|
+
function strncasecmp(s1: string, s2: string, n: number): number
|
|
9892
9963
|
/**
|
|
9893
9964
|
* Duplicates the first `n` bytes of a string, returning a newly-allocated
|
|
9894
9965
|
* buffer `n` + 1 bytes long which will always be nul-terminated. If `str`
|
|
@@ -9902,7 +9973,7 @@ function strncasecmp(s1: string | null, s2: string | null, n: number): number
|
|
|
9902
9973
|
* @param n the maximum number of bytes to copy from `str`
|
|
9903
9974
|
* @returns a newly-allocated buffer containing the first @n bytes of @str, nul-terminated
|
|
9904
9975
|
*/
|
|
9905
|
-
function strndup(str: string
|
|
9976
|
+
function strndup(str: string, n: number): string | null
|
|
9906
9977
|
/**
|
|
9907
9978
|
* Creates a new string `length` bytes long filled with `fill_char`.
|
|
9908
9979
|
* The returned string should be freed when no longer needed.
|
|
@@ -9929,7 +10000,7 @@ function strreverse(string: string | null): string | null
|
|
|
9929
10000
|
* @param needle the nul-terminated string to search for
|
|
9930
10001
|
* @returns a pointer to the found occurrence, or %NULL if not found.
|
|
9931
10002
|
*/
|
|
9932
|
-
function strrstr(haystack: string
|
|
10003
|
+
function strrstr(haystack: string, needle: string): string | null
|
|
9933
10004
|
/**
|
|
9934
10005
|
* Searches the string `haystack` for the last occurrence
|
|
9935
10006
|
* of the string `needle,` limiting the length of the search
|
|
@@ -9939,7 +10010,7 @@ function strrstr(haystack: string | null, needle: string | null): string | null
|
|
|
9939
10010
|
* @param needle the nul-terminated string to search for
|
|
9940
10011
|
* @returns a pointer to the found occurrence, or %NULL if not found.
|
|
9941
10012
|
*/
|
|
9942
|
-
function strrstr_len(haystack: string
|
|
10013
|
+
function strrstr_len(haystack: string, haystack_len: number, needle: string): string | null
|
|
9943
10014
|
/**
|
|
9944
10015
|
* Returns a string describing the given signal, e.g. "Segmentation fault".
|
|
9945
10016
|
* You should use this function in preference to strsignal(), because it
|
|
@@ -9948,17 +10019,17 @@ function strrstr_len(haystack: string | null, haystack_len: number, needle: stri
|
|
|
9948
10019
|
* @param signum the signal number. See the `signal` documentation
|
|
9949
10020
|
* @returns a UTF-8 string describing the signal. If the signal is unknown, it returns "unknown signal (<signum>)".
|
|
9950
10021
|
*/
|
|
9951
|
-
function strsignal(signum: number): string
|
|
10022
|
+
function strsignal(signum: number): string
|
|
9952
10023
|
/**
|
|
9953
10024
|
* Searches the string `haystack` for the first occurrence
|
|
9954
10025
|
* of the string `needle,` limiting the length of the search
|
|
9955
|
-
* to `haystack_len
|
|
10026
|
+
* to `haystack_len` or a nul terminator byte (whichever is reached first).
|
|
9956
10027
|
* @param haystack a nul-terminated string
|
|
9957
10028
|
* @param haystack_len the maximum length of `haystack` in bytes. A length of -1 can be used to mean "search the entire string", like `strstr()`.
|
|
9958
10029
|
* @param needle the string to search for
|
|
9959
10030
|
* @returns a pointer to the found occurrence, or %NULL if not found.
|
|
9960
10031
|
*/
|
|
9961
|
-
function strstr_len(haystack: string
|
|
10032
|
+
function strstr_len(haystack: string, haystack_len: number, needle: string): string | null
|
|
9962
10033
|
/**
|
|
9963
10034
|
* Converts a string to a #gdouble value.
|
|
9964
10035
|
* It calls the standard strtod() function to handle the conversion, but
|
|
@@ -9974,7 +10045,7 @@ function strstr_len(haystack: string | null, haystack_len: number, needle: strin
|
|
|
9974
10045
|
* @param nptr the string to convert to a numeric value.
|
|
9975
10046
|
* @returns the #gdouble value.
|
|
9976
10047
|
*/
|
|
9977
|
-
function strtod(nptr: string
|
|
10048
|
+
function strtod(nptr: string): [ /* returnType */ number, /* endptr */ string ]
|
|
9978
10049
|
/**
|
|
9979
10050
|
* Converts a string to upper case.
|
|
9980
10051
|
* @param string the string to convert
|
|
@@ -9987,7 +10058,7 @@ function strup(string: string | null): string | null
|
|
|
9987
10058
|
* @param str a string
|
|
9988
10059
|
* @returns %TRUE if @str is an element of @strv, according to g_str_equal().
|
|
9989
10060
|
*/
|
|
9990
|
-
function strv_contains(strv: string
|
|
10061
|
+
function strv_contains(strv: string, str: string): boolean
|
|
9991
10062
|
/**
|
|
9992
10063
|
* Checks if `strv1` and `strv2` contain exactly the same elements in exactly the
|
|
9993
10064
|
* same order. Elements are compared using g_str_equal(). To match independently
|
|
@@ -9999,7 +10070,7 @@ function strv_contains(strv: string | null, str: string | null): boolean
|
|
|
9999
10070
|
* @param strv2 another %NULL-terminated array of strings
|
|
10000
10071
|
* @returns %TRUE if @strv1 and @strv2 are equal
|
|
10001
10072
|
*/
|
|
10002
|
-
function strv_equal(strv1: string
|
|
10073
|
+
function strv_equal(strv1: string, strv2: string): boolean
|
|
10003
10074
|
function strv_get_type(): GObject.GType
|
|
10004
10075
|
/**
|
|
10005
10076
|
* Returns the length of the given %NULL-terminated
|
|
@@ -10026,7 +10097,7 @@ function strv_length(str_array: string | null): number
|
|
|
10026
10097
|
* @param test_data Test data argument for the test function.
|
|
10027
10098
|
* @param test_func The test function to invoke for this test.
|
|
10028
10099
|
*/
|
|
10029
|
-
function test_add_data_func(testpath: string
|
|
10100
|
+
function test_add_data_func(testpath: string, test_data: any | null, test_func: TestDataFunc): void
|
|
10030
10101
|
/**
|
|
10031
10102
|
* Create a new test case, as with g_test_add_data_func(), but freeing
|
|
10032
10103
|
* `test_data` after the test run is complete.
|
|
@@ -10034,7 +10105,7 @@ function test_add_data_func(testpath: string | null, test_data: any | null, test
|
|
|
10034
10105
|
* @param test_data Test data argument for the test function.
|
|
10035
10106
|
* @param test_func The test function to invoke for this test.
|
|
10036
10107
|
*/
|
|
10037
|
-
function test_add_data_func_full(testpath: string
|
|
10108
|
+
function test_add_data_func_full(testpath: string, test_data: any | null, test_func: TestDataFunc): void
|
|
10038
10109
|
/**
|
|
10039
10110
|
* Create a new test case, similar to g_test_create_case(). However
|
|
10040
10111
|
* the test is assumed to use no fixture, and test suites are automatically
|
|
@@ -10051,8 +10122,8 @@ function test_add_data_func_full(testpath: string | null, test_data: any | null,
|
|
|
10051
10122
|
* @param testpath /-separated test case path name for the test.
|
|
10052
10123
|
* @param test_func The test function to invoke for this test.
|
|
10053
10124
|
*/
|
|
10054
|
-
function test_add_func(testpath: string
|
|
10055
|
-
function test_assert_expected_messages_internal(domain: string
|
|
10125
|
+
function test_add_func(testpath: string, test_func: TestFunc): void
|
|
10126
|
+
function test_assert_expected_messages_internal(domain: string, file: string, line: number, func: string): void
|
|
10056
10127
|
/**
|
|
10057
10128
|
* This function adds a message to test reports that
|
|
10058
10129
|
* associates a bug URI with a test case.
|
|
@@ -10066,7 +10137,7 @@ function test_assert_expected_messages_internal(domain: string | null, file: str
|
|
|
10066
10137
|
* is already a valid URI.
|
|
10067
10138
|
* @param bug_uri_snippet Bug specific bug tracker URI or URI portion.
|
|
10068
10139
|
*/
|
|
10069
|
-
function test_bug(bug_uri_snippet: string
|
|
10140
|
+
function test_bug(bug_uri_snippet: string): void
|
|
10070
10141
|
/**
|
|
10071
10142
|
* Specify the base URI for bug reports.
|
|
10072
10143
|
*
|
|
@@ -10084,7 +10155,7 @@ function test_bug(bug_uri_snippet: string | null): void
|
|
|
10084
10155
|
* from the value provided by g_test_bug().
|
|
10085
10156
|
* @param uri_pattern the base pattern for bug URIs
|
|
10086
10157
|
*/
|
|
10087
|
-
function test_bug_base(uri_pattern: string
|
|
10158
|
+
function test_bug_base(uri_pattern: string): void
|
|
10088
10159
|
/**
|
|
10089
10160
|
* Indicates that a message with the given `log_domain` and `log_level,`
|
|
10090
10161
|
* with text matching `pattern,` is expected to be logged. When this
|
|
@@ -10126,7 +10197,7 @@ function test_bug_base(uri_pattern: string | null): void
|
|
|
10126
10197
|
* @param log_level the log level of the message
|
|
10127
10198
|
* @param pattern a glob-style [pattern][glib-Glob-style-pattern-matching]
|
|
10128
10199
|
*/
|
|
10129
|
-
function test_expect_message(log_domain: string | null, log_level: LogLevelFlags, pattern: string
|
|
10200
|
+
function test_expect_message(log_domain: string | null, log_level: LogLevelFlags, pattern: string): void
|
|
10130
10201
|
/**
|
|
10131
10202
|
* Indicates that a test failed. This function can be called
|
|
10132
10203
|
* multiple times from the same test. You can use this function
|
|
@@ -10184,7 +10255,7 @@ function test_get_dir(file_type: TestFileType): string
|
|
|
10184
10255
|
* Note that this is a test path, not a file system path.
|
|
10185
10256
|
* @returns the test path for the test currently being run
|
|
10186
10257
|
*/
|
|
10187
|
-
function test_get_path(): string
|
|
10258
|
+
function test_get_path(): string
|
|
10188
10259
|
/**
|
|
10189
10260
|
* Indicates that a test failed because of some incomplete
|
|
10190
10261
|
* functionality. This function can be called multiple times
|
|
@@ -10199,7 +10270,7 @@ function test_get_path(): string | null
|
|
|
10199
10270
|
* @param msg explanation
|
|
10200
10271
|
*/
|
|
10201
10272
|
function test_incomplete(msg: string | null): void
|
|
10202
|
-
function test_log_type_name(log_type: TestLogType): string
|
|
10273
|
+
function test_log_type_name(log_type: TestLogType): string
|
|
10203
10274
|
/**
|
|
10204
10275
|
* This function enqueus a callback `destroy_func` to be executed
|
|
10205
10276
|
* during the next test case teardown phase. This is most useful
|
|
@@ -10357,7 +10428,7 @@ function test_subprocess(): boolean
|
|
|
10357
10428
|
*
|
|
10358
10429
|
* @param summary One or two sentences summarising what the test checks, and how it checks it.
|
|
10359
10430
|
*/
|
|
10360
|
-
function test_summary(summary: string
|
|
10431
|
+
function test_summary(summary: string): void
|
|
10361
10432
|
/**
|
|
10362
10433
|
* Get the number of seconds since the last start of the timer with
|
|
10363
10434
|
* g_test_timer_start().
|
|
@@ -10374,7 +10445,7 @@ function test_timer_last(): number
|
|
|
10374
10445
|
* to be done. Call this function again to restart the timer.
|
|
10375
10446
|
*/
|
|
10376
10447
|
function test_timer_start(): void
|
|
10377
|
-
function test_trap_assertions(domain: string
|
|
10448
|
+
function test_trap_assertions(domain: string, file: string, line: number, func: string, assertion_flags: number, pattern: string): void
|
|
10378
10449
|
/**
|
|
10379
10450
|
* Fork the current test program to execute a test case that might
|
|
10380
10451
|
* not return or that might abort.
|
|
@@ -10599,7 +10670,7 @@ function thread_yield(): void
|
|
|
10599
10670
|
* @param iso_date an ISO 8601 encoded date string
|
|
10600
10671
|
* @returns %TRUE if the conversion was successful.
|
|
10601
10672
|
*/
|
|
10602
|
-
function time_val_from_iso8601(iso_date: string
|
|
10673
|
+
function time_val_from_iso8601(iso_date: string): [ /* returnType */ boolean, /* time_ */ TimeVal ]
|
|
10603
10674
|
/**
|
|
10604
10675
|
* Sets a function to be called at regular intervals, with the given
|
|
10605
10676
|
* priority. The function is called repeatedly until it returns
|
|
@@ -11089,7 +11160,7 @@ function unichar_iszerowidth(c: string): boolean
|
|
|
11089
11160
|
* @param c a Unicode character code
|
|
11090
11161
|
* @returns number of bytes written
|
|
11091
11162
|
*/
|
|
11092
|
-
function unichar_to_utf8(c: string): [ /* returnType */ number, /* outbuf */ string
|
|
11163
|
+
function unichar_to_utf8(c: string): [ /* returnType */ number, /* outbuf */ string ]
|
|
11093
11164
|
/**
|
|
11094
11165
|
* Converts a character to lower case.
|
|
11095
11166
|
* @param c a Unicode character.
|
|
@@ -11188,12 +11259,15 @@ function unix_error_quark(): Quark
|
|
|
11188
11259
|
*/
|
|
11189
11260
|
function unix_fd_add_full(priority: number, fd: number, condition: IOCondition, function_: UnixFDSourceFunc): number
|
|
11190
11261
|
/**
|
|
11191
|
-
* Creates a #GSource to watch for a particular
|
|
11262
|
+
* Creates a #GSource to watch for a particular I/O condition on a file
|
|
11192
11263
|
* descriptor.
|
|
11193
11264
|
*
|
|
11194
|
-
* The source will never close the fd
|
|
11265
|
+
* The source will never close the `fd` — you must do it yourself.
|
|
11266
|
+
*
|
|
11267
|
+
* Any callback attached to the returned #GSource must have type
|
|
11268
|
+
* #GUnixFDSourceFunc.
|
|
11195
11269
|
* @param fd a file descriptor
|
|
11196
|
-
* @param condition
|
|
11270
|
+
* @param condition I/O conditions to watch for on `fd`
|
|
11197
11271
|
* @returns the newly created #GSource
|
|
11198
11272
|
*/
|
|
11199
11273
|
function unix_fd_source_new(fd: number, condition: IOCondition): Source
|
|
@@ -11212,15 +11286,20 @@ function unix_fd_source_new(fd: number, condition: IOCondition): Source
|
|
|
11212
11286
|
* @param user_name the username to get the passwd file entry for
|
|
11213
11287
|
* @returns passwd entry, or %NULL on error; free the returned value with g_free()
|
|
11214
11288
|
*/
|
|
11215
|
-
function unix_get_passwd_entry(user_name: string
|
|
11289
|
+
function unix_get_passwd_entry(user_name: string): any | null
|
|
11216
11290
|
/**
|
|
11217
11291
|
* Similar to the UNIX pipe() call, but on modern systems like Linux
|
|
11218
11292
|
* uses the pipe2() system call, which atomically creates a pipe with
|
|
11219
|
-
* the configured flags.
|
|
11220
|
-
*
|
|
11221
|
-
*
|
|
11293
|
+
* the configured flags.
|
|
11294
|
+
*
|
|
11295
|
+
* As of GLib 2.78, the supported flags are `FD_CLOEXEC` and `O_NONBLOCK`. Prior
|
|
11296
|
+
* to GLib 2.78, only `FD_CLOEXEC` was supported — if you wanted to configure
|
|
11297
|
+
* `O_NONBLOCK` then that had to be done separately with `fcntl()`.
|
|
11222
11298
|
*
|
|
11223
|
-
*
|
|
11299
|
+
* It is a programmer error to call this function with unsupported flags, and a
|
|
11300
|
+
* critical warning will be raised.
|
|
11301
|
+
*
|
|
11302
|
+
* This function does not take `O_CLOEXEC`, it takes `FD_CLOEXEC` as if
|
|
11224
11303
|
* for fcntl(); these are different on Linux/glibc.
|
|
11225
11304
|
* @param fds Array of two integers
|
|
11226
11305
|
* @param flags Bitfield of file descriptor flags, as for fcntl()
|
|
@@ -11323,7 +11402,7 @@ function unsetenv(variable: string): void
|
|
|
11323
11402
|
* @param fragment the fragment, or %NULL
|
|
11324
11403
|
* @returns a new #GUri
|
|
11325
11404
|
*/
|
|
11326
|
-
function uri_build(flags: UriFlags, scheme: string
|
|
11405
|
+
function uri_build(flags: UriFlags, scheme: string, userinfo: string | null, host: string | null, port: number, path: string, query: string | null, fragment: string | null): Uri
|
|
11327
11406
|
/**
|
|
11328
11407
|
* Creates a new #GUri from the given components according to `flags`
|
|
11329
11408
|
* (%G_URI_FLAGS_HAS_PASSWORD is added unconditionally). The `flags` must be
|
|
@@ -11345,7 +11424,7 @@ function uri_build(flags: UriFlags, scheme: string | null, userinfo: string | nu
|
|
|
11345
11424
|
* @param fragment the fragment, or %NULL
|
|
11346
11425
|
* @returns a new #GUri
|
|
11347
11426
|
*/
|
|
11348
|
-
function uri_build_with_user(flags: UriFlags, scheme: string
|
|
11427
|
+
function uri_build_with_user(flags: UriFlags, scheme: string, user: string | null, password: string | null, auth_params: string | null, host: string | null, port: number, path: string, query: string | null, fragment: string | null): Uri
|
|
11349
11428
|
function uri_error_quark(): Quark
|
|
11350
11429
|
/**
|
|
11351
11430
|
* Escapes arbitrary data for use in a URI.
|
|
@@ -11378,7 +11457,7 @@ function uri_escape_bytes(unescaped: Uint8Array, reserved_chars_allowed: string
|
|
|
11378
11457
|
* @param allow_utf8 %TRUE if the result can include UTF-8 characters.
|
|
11379
11458
|
* @returns an escaped version of @unescaped. The returned string should be freed when no longer needed.
|
|
11380
11459
|
*/
|
|
11381
|
-
function uri_escape_string(unescaped: string
|
|
11460
|
+
function uri_escape_string(unescaped: string, reserved_chars_allowed: string | null, allow_utf8: boolean): string | null
|
|
11382
11461
|
/**
|
|
11383
11462
|
* Parses `uri_string` according to `flags,` to determine whether it is a valid
|
|
11384
11463
|
* [absolute URI][relative-absolute-uris], i.e. it does not need to be resolved
|
|
@@ -11392,7 +11471,7 @@ function uri_escape_string(unescaped: string | null, reserved_chars_allowed: str
|
|
|
11392
11471
|
* @param flags flags for parsing `uri_string`
|
|
11393
11472
|
* @returns %TRUE if @uri_string is a valid absolute URI, %FALSE on error.
|
|
11394
11473
|
*/
|
|
11395
|
-
function uri_is_valid(uri_string: string
|
|
11474
|
+
function uri_is_valid(uri_string: string, flags: UriFlags): boolean
|
|
11396
11475
|
/**
|
|
11397
11476
|
* Joins the given components together according to `flags` to create
|
|
11398
11477
|
* an absolute URI string. `path` may not be %NULL (though it may be the empty
|
|
@@ -11400,7 +11479,7 @@ function uri_is_valid(uri_string: string | null, flags: UriFlags): boolean
|
|
|
11400
11479
|
*
|
|
11401
11480
|
* When `host` is present, `path` must either be empty or begin with a slash (`/`)
|
|
11402
11481
|
* character. When `host` is not present, `path` cannot begin with two slash
|
|
11403
|
-
*
|
|
11482
|
+
* characters (`//`). See
|
|
11404
11483
|
* [RFC 3986, section 3](https://tools.ietf.org/html/rfc3986#section-3).
|
|
11405
11484
|
*
|
|
11406
11485
|
* See also g_uri_join_with_user(), which allows specifying the
|
|
@@ -11418,7 +11497,7 @@ function uri_is_valid(uri_string: string | null, flags: UriFlags): boolean
|
|
|
11418
11497
|
* @param fragment the fragment, or %NULL
|
|
11419
11498
|
* @returns an absolute URI string
|
|
11420
11499
|
*/
|
|
11421
|
-
function uri_join(flags: UriFlags, scheme: string | null, userinfo: string | null, host: string | null, port: number, path: string
|
|
11500
|
+
function uri_join(flags: UriFlags, scheme: string | null, userinfo: string | null, host: string | null, port: number, path: string, query: string | null, fragment: string | null): string | null
|
|
11422
11501
|
/**
|
|
11423
11502
|
* Joins the given components together according to `flags` to create
|
|
11424
11503
|
* an absolute URI string. `path` may not be %NULL (though it may be the empty
|
|
@@ -11441,7 +11520,7 @@ function uri_join(flags: UriFlags, scheme: string | null, userinfo: string | nul
|
|
|
11441
11520
|
* @param fragment the fragment, or %NULL
|
|
11442
11521
|
* @returns an absolute URI string
|
|
11443
11522
|
*/
|
|
11444
|
-
function uri_join_with_user(flags: UriFlags, scheme: string | null, user: string | null, password: string | null, auth_params: string | null, host: string | null, port: number, path: string
|
|
11523
|
+
function uri_join_with_user(flags: UriFlags, scheme: string | null, user: string | null, password: string | null, auth_params: string | null, host: string | null, port: number, path: string, query: string | null, fragment: string | null): string | null
|
|
11445
11524
|
/**
|
|
11446
11525
|
* Splits an URI list conforming to the text/uri-list
|
|
11447
11526
|
* mime type defined in RFC 2483 into individual URIs,
|
|
@@ -11449,7 +11528,7 @@ function uri_join_with_user(flags: UriFlags, scheme: string | null, user: string
|
|
|
11449
11528
|
* @param uri_list an URI list
|
|
11450
11529
|
* @returns a newly allocated %NULL-terminated list of strings holding the individual URIs. The array should be freed with g_strfreev().
|
|
11451
11530
|
*/
|
|
11452
|
-
function uri_list_extract_uris(uri_list: string
|
|
11531
|
+
function uri_list_extract_uris(uri_list: string): string[]
|
|
11453
11532
|
/**
|
|
11454
11533
|
* Parses `uri_string` according to `flags`. If the result is not a
|
|
11455
11534
|
* valid [absolute URI][relative-absolute-uris], it will be discarded, and an
|
|
@@ -11458,7 +11537,7 @@ function uri_list_extract_uris(uri_list: string | null): string[]
|
|
|
11458
11537
|
* @param flags flags describing how to parse `uri_string`
|
|
11459
11538
|
* @returns a new #GUri, or NULL on error.
|
|
11460
11539
|
*/
|
|
11461
|
-
function uri_parse(uri_string: string
|
|
11540
|
+
function uri_parse(uri_string: string, flags: UriFlags): Uri
|
|
11462
11541
|
/**
|
|
11463
11542
|
* Many URI schemes include one or more attribute/value pairs as part of the URI
|
|
11464
11543
|
* value. This method can be used to parse them into a hash table. When an
|
|
@@ -11490,7 +11569,7 @@ function uri_parse(uri_string: string | null, flags: UriFlags): Uri
|
|
|
11490
11569
|
* @param flags flags to modify the way the parameters are handled.
|
|
11491
11570
|
* @returns A hash table of attribute/value pairs, with both names and values fully-decoded; or %NULL on error.
|
|
11492
11571
|
*/
|
|
11493
|
-
function uri_parse_params(params: string
|
|
11572
|
+
function uri_parse_params(params: string, length: number, separators: string, flags: UriParamsFlags): HashTable
|
|
11494
11573
|
/**
|
|
11495
11574
|
* Gets the scheme portion of a URI string.
|
|
11496
11575
|
* [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) decodes the scheme
|
|
@@ -11504,7 +11583,7 @@ function uri_parse_params(params: string | null, length: number, separators: str
|
|
|
11504
11583
|
* @param uri a valid URI.
|
|
11505
11584
|
* @returns The ‘scheme’ component of the URI, or %NULL on error. The returned string should be freed when no longer needed.
|
|
11506
11585
|
*/
|
|
11507
|
-
function uri_parse_scheme(uri: string
|
|
11586
|
+
function uri_parse_scheme(uri: string): string | null
|
|
11508
11587
|
/**
|
|
11509
11588
|
* Gets the scheme portion of a URI string.
|
|
11510
11589
|
* [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) decodes the scheme
|
|
@@ -11521,7 +11600,7 @@ function uri_parse_scheme(uri: string | null): string | null
|
|
|
11521
11600
|
* @param uri a valid URI.
|
|
11522
11601
|
* @returns The ‘scheme’ component of the URI, or %NULL on error. The returned string is normalized to all-lowercase, and interned via g_intern_string(), so it does not need to be freed.
|
|
11523
11602
|
*/
|
|
11524
|
-
function uri_peek_scheme(uri: string
|
|
11603
|
+
function uri_peek_scheme(uri: string): string | null
|
|
11525
11604
|
/**
|
|
11526
11605
|
* Parses `uri_ref` according to `flags` and, if it is a
|
|
11527
11606
|
* [relative URI][relative-absolute-uris], resolves it relative to
|
|
@@ -11535,7 +11614,7 @@ function uri_peek_scheme(uri: string | null): string | null
|
|
|
11535
11614
|
* @param flags flags describing how to parse `uri_ref`
|
|
11536
11615
|
* @returns the resolved URI string, or NULL on error.
|
|
11537
11616
|
*/
|
|
11538
|
-
function uri_resolve_relative(base_uri_string: string | null, uri_ref: string
|
|
11617
|
+
function uri_resolve_relative(base_uri_string: string | null, uri_ref: string, flags: UriFlags): string | null
|
|
11539
11618
|
/**
|
|
11540
11619
|
* Parses `uri_ref` (which can be an
|
|
11541
11620
|
* [absolute or relative URI][relative-absolute-uris]) according to `flags,` and
|
|
@@ -11557,7 +11636,7 @@ function uri_resolve_relative(base_uri_string: string | null, uri_ref: string |
|
|
|
11557
11636
|
* @param flags flags for parsing `uri_ref`
|
|
11558
11637
|
* @returns %TRUE if @uri_ref parsed successfully, %FALSE on error.
|
|
11559
11638
|
*/
|
|
11560
|
-
function uri_split(uri_ref: string
|
|
11639
|
+
function uri_split(uri_ref: string, flags: UriFlags): [ /* returnType */ boolean, /* scheme */ string | null, /* userinfo */ string | null, /* host */ string | null, /* port */ number, /* path */ string, /* query */ string | null, /* fragment */ string | null ]
|
|
11561
11640
|
/**
|
|
11562
11641
|
* Parses `uri_string` (which must be an [absolute URI][relative-absolute-uris])
|
|
11563
11642
|
* according to `flags,` and returns the pieces relevant to connecting to a host.
|
|
@@ -11569,7 +11648,7 @@ function uri_split(uri_ref: string | null, flags: UriFlags): [ /* returnType */
|
|
|
11569
11648
|
* @param flags flags for parsing `uri_string`
|
|
11570
11649
|
* @returns %TRUE if @uri_string parsed successfully, %FALSE on error.
|
|
11571
11650
|
*/
|
|
11572
|
-
function uri_split_network(uri_string: string
|
|
11651
|
+
function uri_split_network(uri_string: string, flags: UriFlags): [ /* returnType */ boolean, /* scheme */ string | null, /* host */ string | null, /* port */ number ]
|
|
11573
11652
|
/**
|
|
11574
11653
|
* Parses `uri_ref` (which can be an
|
|
11575
11654
|
* [absolute or relative URI][relative-absolute-uris]) according to `flags,` and
|
|
@@ -11586,7 +11665,7 @@ function uri_split_network(uri_string: string | null, flags: UriFlags): [ /* ret
|
|
|
11586
11665
|
* @param flags flags for parsing `uri_ref`
|
|
11587
11666
|
* @returns %TRUE if @uri_ref parsed successfully, %FALSE on error.
|
|
11588
11667
|
*/
|
|
11589
|
-
function uri_split_with_user(uri_ref: string
|
|
11668
|
+
function uri_split_with_user(uri_ref: string, flags: UriFlags): [ /* returnType */ boolean, /* scheme */ string | null, /* user */ string | null, /* password */ string | null, /* auth_params */ string | null, /* host */ string | null, /* port */ number, /* path */ string, /* query */ string | null, /* fragment */ string | null ]
|
|
11590
11669
|
/**
|
|
11591
11670
|
* Unescapes a segment of an escaped string as binary data.
|
|
11592
11671
|
*
|
|
@@ -11603,7 +11682,7 @@ function uri_split_with_user(uri_ref: string | null, flags: UriFlags): [ /* retu
|
|
|
11603
11682
|
* @param illegal_characters a string of illegal characters not to be allowed, or %NULL.
|
|
11604
11683
|
* @returns an unescaped version of @escaped_string or %NULL on error (if decoding failed, using %G_URI_ERROR_FAILED error code). The returned #GBytes should be unreffed when no longer needed.
|
|
11605
11684
|
*/
|
|
11606
|
-
function uri_unescape_bytes(escaped_string: string
|
|
11685
|
+
function uri_unescape_bytes(escaped_string: string, length: number, illegal_characters: string | null): Bytes
|
|
11607
11686
|
/**
|
|
11608
11687
|
* Unescapes a segment of an escaped string.
|
|
11609
11688
|
*
|
|
@@ -11633,7 +11712,7 @@ function uri_unescape_segment(escaped_string: string | null, escaped_string_end:
|
|
|
11633
11712
|
* @param illegal_characters a string of illegal characters not to be allowed, or %NULL.
|
|
11634
11713
|
* @returns an unescaped version of @escaped_string. The returned string should be freed when no longer needed.
|
|
11635
11714
|
*/
|
|
11636
|
-
function uri_unescape_string(escaped_string: string
|
|
11715
|
+
function uri_unescape_string(escaped_string: string, illegal_characters: string | null): string | null
|
|
11637
11716
|
/**
|
|
11638
11717
|
* Pauses the current thread for the given number of microseconds.
|
|
11639
11718
|
*
|
|
@@ -11685,7 +11764,7 @@ function utf16_to_utf8(str: number[]): [ /* returnType */ string | null, /* item
|
|
|
11685
11764
|
* @param len length of `str,` in bytes, or -1 if `str` is nul-terminated.
|
|
11686
11765
|
* @returns a newly allocated string, that is a case independent form of @str.
|
|
11687
11766
|
*/
|
|
11688
|
-
function utf8_casefold(str: string
|
|
11767
|
+
function utf8_casefold(str: string, len: number): string | null
|
|
11689
11768
|
/**
|
|
11690
11769
|
* Compares two strings for ordering using the linguistically
|
|
11691
11770
|
* correct rules for the [current locale][setlocale].
|
|
@@ -11701,7 +11780,7 @@ function utf8_casefold(str: string | null, len: number): string | null
|
|
|
11701
11780
|
* @param str2 a UTF-8 encoded string
|
|
11702
11781
|
* @returns < 0 if @str1 compares before @str2, 0 if they compare equal, > 0 if @str1 compares after @str2.
|
|
11703
11782
|
*/
|
|
11704
|
-
function utf8_collate(str1: string
|
|
11783
|
+
function utf8_collate(str1: string, str2: string): number
|
|
11705
11784
|
/**
|
|
11706
11785
|
* Converts a string into a collation key that can be compared
|
|
11707
11786
|
* with other collation keys produced by the same function using
|
|
@@ -11716,7 +11795,7 @@ function utf8_collate(str1: string | null, str2: string | null): number
|
|
|
11716
11795
|
* @param len length of `str,` in bytes, or -1 if `str` is nul-terminated.
|
|
11717
11796
|
* @returns a newly allocated string. This string should be freed with g_free() when you are done with it.
|
|
11718
11797
|
*/
|
|
11719
|
-
function utf8_collate_key(str: string
|
|
11798
|
+
function utf8_collate_key(str: string, len: number): string | null
|
|
11720
11799
|
/**
|
|
11721
11800
|
* Converts a string into a collation key that can be compared
|
|
11722
11801
|
* with other collation keys produced by the same function using strcmp().
|
|
@@ -11733,7 +11812,7 @@ function utf8_collate_key(str: string | null, len: number): string | null
|
|
|
11733
11812
|
* @param len length of `str,` in bytes, or -1 if `str` is nul-terminated.
|
|
11734
11813
|
* @returns a newly allocated string. This string should be freed with g_free() when you are done with it.
|
|
11735
11814
|
*/
|
|
11736
|
-
function utf8_collate_key_for_filename(str: string
|
|
11815
|
+
function utf8_collate_key_for_filename(str: string, len: number): string | null
|
|
11737
11816
|
/**
|
|
11738
11817
|
* Finds the start of the next UTF-8 character in the string after `p`.
|
|
11739
11818
|
*
|
|
@@ -11749,7 +11828,7 @@ function utf8_collate_key_for_filename(str: string | null, len: number): string
|
|
|
11749
11828
|
* @param end a pointer to the byte following the end of the string, or %NULL to indicate that the string is nul-terminated
|
|
11750
11829
|
* @returns a pointer to the found character or %NULL if @end is set and is reached
|
|
11751
11830
|
*/
|
|
11752
|
-
function utf8_find_next_char(p: string
|
|
11831
|
+
function utf8_find_next_char(p: string, end: string | null): string | null
|
|
11753
11832
|
/**
|
|
11754
11833
|
* Given a position `p` with a UTF-8 encoded string `str,` find the start
|
|
11755
11834
|
* of the previous UTF-8 character starting before `p`. Returns %NULL if no
|
|
@@ -11762,7 +11841,7 @@ function utf8_find_next_char(p: string | null, end: string | null): string | nul
|
|
|
11762
11841
|
* @param p pointer to some position within `str`
|
|
11763
11842
|
* @returns a pointer to the found character or %NULL.
|
|
11764
11843
|
*/
|
|
11765
|
-
function utf8_find_prev_char(str: string
|
|
11844
|
+
function utf8_find_prev_char(str: string, p: string): string | null
|
|
11766
11845
|
/**
|
|
11767
11846
|
* Converts a sequence of bytes encoded as UTF-8 to a Unicode character.
|
|
11768
11847
|
*
|
|
@@ -11773,7 +11852,7 @@ function utf8_find_prev_char(str: string | null, p: string | null): string | nul
|
|
|
11773
11852
|
* @param p a pointer to Unicode character encoded as UTF-8
|
|
11774
11853
|
* @returns the resulting character
|
|
11775
11854
|
*/
|
|
11776
|
-
function utf8_get_char(p: string
|
|
11855
|
+
function utf8_get_char(p: string): string
|
|
11777
11856
|
/**
|
|
11778
11857
|
* Convert a sequence of bytes encoded as UTF-8 to a Unicode character.
|
|
11779
11858
|
* This function checks for incomplete characters, for invalid characters
|
|
@@ -11787,7 +11866,7 @@ function utf8_get_char(p: string | null): string
|
|
|
11787
11866
|
* @param max_len the maximum number of bytes to read, or -1 if `p` is nul-terminated
|
|
11788
11867
|
* @returns the resulting character. If @p points to a partial sequence at the end of a string that could begin a valid character (or if @max_len is zero), returns (gunichar)-2; otherwise, if @p does not point to a valid UTF-8 encoded Unicode character, returns (gunichar)-1.
|
|
11789
11868
|
*/
|
|
11790
|
-
function utf8_get_char_validated(p: string
|
|
11869
|
+
function utf8_get_char_validated(p: string, max_len: number): string
|
|
11791
11870
|
/**
|
|
11792
11871
|
* If the provided string is valid UTF-8, return a copy of it. If not,
|
|
11793
11872
|
* return a copy in which bytes that could not be interpreted as valid Unicode
|
|
@@ -11802,7 +11881,7 @@ function utf8_get_char_validated(p: string | null, max_len: number): string
|
|
|
11802
11881
|
* @param len the maximum length of `str` to use, in bytes. If `len` < 0, then the string is nul-terminated.
|
|
11803
11882
|
* @returns a valid UTF-8 string whose content resembles @str
|
|
11804
11883
|
*/
|
|
11805
|
-
function utf8_make_valid(str: string
|
|
11884
|
+
function utf8_make_valid(str: string, len: number): string | null
|
|
11806
11885
|
/**
|
|
11807
11886
|
* Converts a string into canonical form, standardizing
|
|
11808
11887
|
* such issues as whether a character with an accent
|
|
@@ -11834,7 +11913,7 @@ function utf8_make_valid(str: string | null, len: number): string | null
|
|
|
11834
11913
|
* @param mode the type of normalization to perform.
|
|
11835
11914
|
* @returns a newly allocated string, that is the normalized form of @str, or %NULL if @str is not valid UTF-8.
|
|
11836
11915
|
*/
|
|
11837
|
-
function utf8_normalize(str: string
|
|
11916
|
+
function utf8_normalize(str: string, len: number, mode: NormalizeMode): string | null
|
|
11838
11917
|
/**
|
|
11839
11918
|
* Converts from an integer character offset to a pointer to a position
|
|
11840
11919
|
* within the string.
|
|
@@ -11853,7 +11932,7 @@ function utf8_normalize(str: string | null, len: number, mode: NormalizeMode): s
|
|
|
11853
11932
|
* @param offset a character offset within `str`
|
|
11854
11933
|
* @returns the resulting pointer
|
|
11855
11934
|
*/
|
|
11856
|
-
function utf8_offset_to_pointer(str: string
|
|
11935
|
+
function utf8_offset_to_pointer(str: string, offset: number): string | null
|
|
11857
11936
|
/**
|
|
11858
11937
|
* Converts from a pointer to position within a string to an integer
|
|
11859
11938
|
* character offset.
|
|
@@ -11864,7 +11943,7 @@ function utf8_offset_to_pointer(str: string | null, offset: number): string | nu
|
|
|
11864
11943
|
* @param pos a pointer to a position within `str`
|
|
11865
11944
|
* @returns the resulting character offset
|
|
11866
11945
|
*/
|
|
11867
|
-
function utf8_pointer_to_offset(str: string
|
|
11946
|
+
function utf8_pointer_to_offset(str: string, pos: string): number
|
|
11868
11947
|
/**
|
|
11869
11948
|
* Finds the previous UTF-8 character in the string before `p`.
|
|
11870
11949
|
*
|
|
@@ -11875,7 +11954,7 @@ function utf8_pointer_to_offset(str: string | null, pos: string | null): number
|
|
|
11875
11954
|
* @param p a pointer to a position within a UTF-8 encoded string
|
|
11876
11955
|
* @returns a pointer to the found character
|
|
11877
11956
|
*/
|
|
11878
|
-
function utf8_prev_char(p: string
|
|
11957
|
+
function utf8_prev_char(p: string): string | null
|
|
11879
11958
|
/**
|
|
11880
11959
|
* Finds the leftmost occurrence of the given Unicode character
|
|
11881
11960
|
* in a UTF-8 encoded string, while limiting the search to `len` bytes.
|
|
@@ -11885,7 +11964,7 @@ function utf8_prev_char(p: string | null): string | null
|
|
|
11885
11964
|
* @param c a Unicode character
|
|
11886
11965
|
* @returns %NULL if the string does not contain the character, otherwise, a pointer to the start of the leftmost occurrence of the character in the string.
|
|
11887
11966
|
*/
|
|
11888
|
-
function utf8_strchr(p: string
|
|
11967
|
+
function utf8_strchr(p: string, len: number, c: string): string | null
|
|
11889
11968
|
/**
|
|
11890
11969
|
* Converts all Unicode characters in the string that have a case
|
|
11891
11970
|
* to lowercase. The exact manner that this is done depends
|
|
@@ -11895,7 +11974,7 @@ function utf8_strchr(p: string | null, len: number, c: string): string | null
|
|
|
11895
11974
|
* @param len length of `str,` in bytes, or -1 if `str` is nul-terminated.
|
|
11896
11975
|
* @returns a newly allocated string, with all characters converted to lowercase.
|
|
11897
11976
|
*/
|
|
11898
|
-
function utf8_strdown(str: string
|
|
11977
|
+
function utf8_strdown(str: string, len: number): string | null
|
|
11899
11978
|
/**
|
|
11900
11979
|
* Computes the length of the string in characters, not including
|
|
11901
11980
|
* the terminating nul character. If the `max'`th byte falls in the
|
|
@@ -11904,7 +11983,7 @@ function utf8_strdown(str: string | null, len: number): string | null
|
|
|
11904
11983
|
* @param max the maximum number of bytes to examine. If `max` is less than 0, then the string is assumed to be nul-terminated. If `max` is 0, `p` will not be examined and may be %NULL. If `max` is greater than 0, up to `max` bytes are examined
|
|
11905
11984
|
* @returns the length of the string in characters
|
|
11906
11985
|
*/
|
|
11907
|
-
function utf8_strlen(p: string
|
|
11986
|
+
function utf8_strlen(p: string, max: number): number
|
|
11908
11987
|
/**
|
|
11909
11988
|
* Like the standard C strncpy() function, but copies a given number
|
|
11910
11989
|
* of characters instead of a given number of bytes. The `src` string
|
|
@@ -11918,7 +11997,7 @@ function utf8_strlen(p: string | null, max: number): number
|
|
|
11918
11997
|
* @param n character count
|
|
11919
11998
|
* @returns @dest
|
|
11920
11999
|
*/
|
|
11921
|
-
function utf8_strncpy(dest: string | null, src: string
|
|
12000
|
+
function utf8_strncpy(dest: string | null, src: string, n: number): string | null
|
|
11922
12001
|
/**
|
|
11923
12002
|
* Find the rightmost occurrence of the given Unicode character
|
|
11924
12003
|
* in a UTF-8 encoded string, while limiting the search to `len` bytes.
|
|
@@ -11928,7 +12007,7 @@ function utf8_strncpy(dest: string | null, src: string | null, n: number): strin
|
|
|
11928
12007
|
* @param c a Unicode character
|
|
11929
12008
|
* @returns %NULL if the string does not contain the character, otherwise, a pointer to the start of the rightmost occurrence of the character in the string.
|
|
11930
12009
|
*/
|
|
11931
|
-
function utf8_strrchr(p: string
|
|
12010
|
+
function utf8_strrchr(p: string, len: number, c: string): string | null
|
|
11932
12011
|
/**
|
|
11933
12012
|
* Reverses a UTF-8 string. `str` must be valid UTF-8 encoded text.
|
|
11934
12013
|
* (Use g_utf8_validate() on all text before trying to use UTF-8
|
|
@@ -11947,7 +12026,7 @@ function utf8_strrchr(p: string | null, len: number, c: string): string | null
|
|
|
11947
12026
|
* @param len the maximum length of `str` to use, in bytes. If `len` < 0, then the string is nul-terminated.
|
|
11948
12027
|
* @returns a newly-allocated string which is the reverse of @str
|
|
11949
12028
|
*/
|
|
11950
|
-
function utf8_strreverse(str: string
|
|
12029
|
+
function utf8_strreverse(str: string, len: number): string | null
|
|
11951
12030
|
/**
|
|
11952
12031
|
* Converts all Unicode characters in the string that have a case
|
|
11953
12032
|
* to uppercase. The exact manner that this is done depends
|
|
@@ -11958,7 +12037,7 @@ function utf8_strreverse(str: string | null, len: number): string | null
|
|
|
11958
12037
|
* @param len length of `str,` in bytes, or -1 if `str` is nul-terminated.
|
|
11959
12038
|
* @returns a newly allocated string, with all characters converted to uppercase.
|
|
11960
12039
|
*/
|
|
11961
|
-
function utf8_strup(str: string
|
|
12040
|
+
function utf8_strup(str: string, len: number): string | null
|
|
11962
12041
|
/**
|
|
11963
12042
|
* Copies a substring out of a UTF-8 encoded string.
|
|
11964
12043
|
* The substring will contain `end_pos` - `start_pos` characters.
|
|
@@ -11970,7 +12049,7 @@ function utf8_strup(str: string | null, len: number): string | null
|
|
|
11970
12049
|
* @param end_pos another character offset within `str,` or `-1` to indicate the end of the string
|
|
11971
12050
|
* @returns a newly allocated copy of the requested substring. Free with g_free() when no longer needed.
|
|
11972
12051
|
*/
|
|
11973
|
-
function utf8_substring(str: string
|
|
12052
|
+
function utf8_substring(str: string, start_pos: number, end_pos: number): string | null
|
|
11974
12053
|
/**
|
|
11975
12054
|
* Convert a string from UTF-8 to a 32-bit fixed width
|
|
11976
12055
|
* representation as UCS-4. A trailing 0 character will be added to the
|
|
@@ -11979,7 +12058,7 @@ function utf8_substring(str: string | null, start_pos: number, end_pos: number):
|
|
|
11979
12058
|
* @param len the maximum length of `str` to use, in bytes. If `len` < 0, then the string is nul-terminated.
|
|
11980
12059
|
* @returns a pointer to a newly allocated UCS-4 string. This value must be freed with g_free(). If an error occurs, %NULL will be returned and @error set.
|
|
11981
12060
|
*/
|
|
11982
|
-
function utf8_to_ucs4(str: string
|
|
12061
|
+
function utf8_to_ucs4(str: string, len: number): [ /* returnType */ string, /* items_read */ number, /* items_written */ number ]
|
|
11983
12062
|
/**
|
|
11984
12063
|
* Convert a string from UTF-8 to a 32-bit fixed width
|
|
11985
12064
|
* representation as UCS-4, assuming valid UTF-8 input.
|
|
@@ -11990,7 +12069,7 @@ function utf8_to_ucs4(str: string | null, len: number): [ /* returnType */ strin
|
|
|
11990
12069
|
* @param len the maximum length of `str` to use, in bytes. If `len` < 0, then the string is nul-terminated.
|
|
11991
12070
|
* @returns a pointer to a newly allocated UCS-4 string. This value must be freed with g_free().
|
|
11992
12071
|
*/
|
|
11993
|
-
function utf8_to_ucs4_fast(str: string
|
|
12072
|
+
function utf8_to_ucs4_fast(str: string, len: number): [ /* returnType */ string, /* items_written */ number ]
|
|
11994
12073
|
/**
|
|
11995
12074
|
* Convert a string from UTF-8 to UTF-16. A 0 character will be
|
|
11996
12075
|
* added to the result after the converted text.
|
|
@@ -11998,7 +12077,18 @@ function utf8_to_ucs4_fast(str: string | null, len: number): [ /* returnType */
|
|
|
11998
12077
|
* @param len the maximum length (number of bytes) of `str` to use. If `len` < 0, then the string is nul-terminated.
|
|
11999
12078
|
* @returns a pointer to a newly allocated UTF-16 string. This value must be freed with g_free(). If an error occurs, %NULL will be returned and @error set.
|
|
12000
12079
|
*/
|
|
12001
|
-
function utf8_to_utf16(str: string
|
|
12080
|
+
function utf8_to_utf16(str: string, len: number): [ /* returnType */ number, /* items_read */ number, /* items_written */ number ]
|
|
12081
|
+
/**
|
|
12082
|
+
* Cuts off the middle of the string, preserving half of `truncate_length`
|
|
12083
|
+
* characters at the beginning and half at the end.
|
|
12084
|
+
*
|
|
12085
|
+
* If `string` is already short enough, this returns a copy of `string`.
|
|
12086
|
+
* If `truncate_length` is `0`, an empty string is returned.
|
|
12087
|
+
* @param string a nul-terminated UTF-8 encoded string
|
|
12088
|
+
* @param truncate_length the new size of `string,` in characters, including the ellipsis character
|
|
12089
|
+
* @returns a newly-allocated copy of @string ellipsized in the middle
|
|
12090
|
+
*/
|
|
12091
|
+
function utf8_truncate_middle(string: string, truncate_length: number): string | null
|
|
12002
12092
|
/**
|
|
12003
12093
|
* Validates UTF-8 encoded text. `str` is the text to validate;
|
|
12004
12094
|
* if `str` is nul-terminated, then `max_len` can be -1, otherwise
|
|
@@ -12011,14 +12101,14 @@ function utf8_to_utf16(str: string | null, len: number): [ /* returnType */ numb
|
|
|
12011
12101
|
* Note that g_utf8_validate() returns %FALSE if `max_len` is
|
|
12012
12102
|
* positive and any of the `max_len` bytes are nul.
|
|
12013
12103
|
*
|
|
12014
|
-
* Returns %TRUE if all of `str` was valid. Many GLib and GTK
|
|
12104
|
+
* Returns %TRUE if all of `str` was valid. Many GLib and GTK
|
|
12015
12105
|
* routines require valid UTF-8 as input; so data read from a file
|
|
12016
12106
|
* or the network should be checked with g_utf8_validate() before
|
|
12017
12107
|
* doing anything else with it.
|
|
12018
12108
|
* @param str a pointer to character data
|
|
12019
12109
|
* @returns %TRUE if the text was valid UTF-8
|
|
12020
12110
|
*/
|
|
12021
|
-
function utf8_validate(str: Uint8Array): [ /* returnType */ boolean, /* end */ string
|
|
12111
|
+
function utf8_validate(str: Uint8Array): [ /* returnType */ boolean, /* end */ string ]
|
|
12022
12112
|
/**
|
|
12023
12113
|
* Validates UTF-8 encoded text.
|
|
12024
12114
|
*
|
|
@@ -12027,7 +12117,7 @@ function utf8_validate(str: Uint8Array): [ /* returnType */ boolean, /* end */ s
|
|
|
12027
12117
|
* @param str a pointer to character data
|
|
12028
12118
|
* @returns %TRUE if the text was valid UTF-8
|
|
12029
12119
|
*/
|
|
12030
|
-
function utf8_validate_len(str: Uint8Array): [ /* returnType */ boolean, /* end */ string
|
|
12120
|
+
function utf8_validate_len(str: Uint8Array): [ /* returnType */ boolean, /* end */ string ]
|
|
12031
12121
|
/**
|
|
12032
12122
|
* Parses the string `str` and verify if it is a UUID.
|
|
12033
12123
|
*
|
|
@@ -12040,7 +12130,7 @@ function utf8_validate_len(str: Uint8Array): [ /* returnType */ boolean, /* end
|
|
|
12040
12130
|
* @param str a string representing a UUID
|
|
12041
12131
|
* @returns %TRUE if @str is a valid UUID, %FALSE otherwise.
|
|
12042
12132
|
*/
|
|
12043
|
-
function uuid_string_is_valid(str: string
|
|
12133
|
+
function uuid_string_is_valid(str: string): boolean
|
|
12044
12134
|
/**
|
|
12045
12135
|
* Generates a random UUID (RFC 4122 version 4) as a string. It has the same
|
|
12046
12136
|
* randomness guarantees as #GRand, so must not be used for cryptographic
|
|
@@ -12061,7 +12151,7 @@ function variant_get_gtype(): GObject.GType
|
|
|
12061
12151
|
* @param string a normal C nul-terminated string
|
|
12062
12152
|
* @returns %TRUE if @string is a D-Bus object path
|
|
12063
12153
|
*/
|
|
12064
|
-
function variant_is_object_path(string: string
|
|
12154
|
+
function variant_is_object_path(string: string): boolean
|
|
12065
12155
|
/**
|
|
12066
12156
|
* Determines if a given string is a valid D-Bus type signature. You
|
|
12067
12157
|
* should ensure that a string is a valid D-Bus type signature before
|
|
@@ -12072,7 +12162,7 @@ function variant_is_object_path(string: string | null): boolean
|
|
|
12072
12162
|
* @param string a normal C nul-terminated string
|
|
12073
12163
|
* @returns %TRUE if @string is a D-Bus type signature
|
|
12074
12164
|
*/
|
|
12075
|
-
function variant_is_signature(string: string
|
|
12165
|
+
function variant_is_signature(string: string): boolean
|
|
12076
12166
|
/**
|
|
12077
12167
|
* Parses a #GVariant from a text representation.
|
|
12078
12168
|
*
|
|
@@ -12115,7 +12205,7 @@ function variant_is_signature(string: string | null): boolean
|
|
|
12115
12205
|
* @param endptr a location to store the end pointer, or %NULL
|
|
12116
12206
|
* @returns a non-floating reference to a #GVariant, or %NULL
|
|
12117
12207
|
*/
|
|
12118
|
-
function variant_parse(type: VariantType | null, text: string
|
|
12208
|
+
function variant_parse(type: VariantType | null, text: string, limit: string | null, endptr: string | null): Variant
|
|
12119
12209
|
/**
|
|
12120
12210
|
* Pretty-prints a message showing the context of a #GVariant parse
|
|
12121
12211
|
* error within the string for which parsing was attempted.
|
|
@@ -12154,14 +12244,14 @@ function variant_parse(type: VariantType | null, text: string | null, limit: str
|
|
|
12154
12244
|
* @param source_str the string that was given to the parser
|
|
12155
12245
|
* @returns the printed message
|
|
12156
12246
|
*/
|
|
12157
|
-
function variant_parse_error_print_context(error: Error, source_str: string
|
|
12247
|
+
function variant_parse_error_print_context(error: Error, source_str: string): string | null
|
|
12158
12248
|
function variant_parse_error_quark(): Quark
|
|
12159
12249
|
/**
|
|
12160
12250
|
* Same as g_variant_error_quark().
|
|
12161
12251
|
*/
|
|
12162
12252
|
function variant_parser_get_error_quark(): Quark
|
|
12163
|
-
function variant_type_checked_(arg0: string
|
|
12164
|
-
function variant_type_string_get_depth_(type_string: string
|
|
12253
|
+
function variant_type_checked_(arg0: string): VariantType
|
|
12254
|
+
function variant_type_string_get_depth_(type_string: string): number
|
|
12165
12255
|
/**
|
|
12166
12256
|
* Checks if `type_string` is a valid GVariant type string. This call is
|
|
12167
12257
|
* equivalent to calling g_variant_type_string_scan() and confirming
|
|
@@ -12169,7 +12259,7 @@ function variant_type_string_get_depth_(type_string: string | null): number
|
|
|
12169
12259
|
* @param type_string a pointer to any string
|
|
12170
12260
|
* @returns %TRUE if @type_string is exactly one valid type string Since 2.24
|
|
12171
12261
|
*/
|
|
12172
|
-
function variant_type_string_is_valid(type_string: string
|
|
12262
|
+
function variant_type_string_is_valid(type_string: string): boolean
|
|
12173
12263
|
/**
|
|
12174
12264
|
* Scan for a single complete and valid GVariant type string in `string`.
|
|
12175
12265
|
* The memory pointed to by `limit` (or bytes beyond it) is never
|
|
@@ -12188,7 +12278,7 @@ function variant_type_string_is_valid(type_string: string | null): boolean
|
|
|
12188
12278
|
* @param limit the end of `string,` or %NULL
|
|
12189
12279
|
* @returns %TRUE if a valid type string was found
|
|
12190
12280
|
*/
|
|
12191
|
-
function variant_type_string_scan(string: string
|
|
12281
|
+
function variant_type_string_scan(string: string, limit: string | null): [ /* returnType */ boolean, /* endptr */ string ]
|
|
12192
12282
|
/**
|
|
12193
12283
|
* Prototype of a #GChildWatchSource callback, called when a child
|
|
12194
12284
|
* process has exited.
|
|
@@ -12358,7 +12448,7 @@ interface ErrorInitFunc {
|
|
|
12358
12448
|
/**
|
|
12359
12449
|
* Declares a type of function which takes an arbitrary
|
|
12360
12450
|
* data pointer argument and has no return value. It is
|
|
12361
|
-
* not currently used in GLib or GTK
|
|
12451
|
+
* not currently used in GLib or GTK.
|
|
12362
12452
|
* @callback
|
|
12363
12453
|
* @param data a data pointer
|
|
12364
12454
|
*/
|
|
@@ -12536,7 +12626,7 @@ interface IOFunc {
|
|
|
12536
12626
|
* @param message the message to process
|
|
12537
12627
|
*/
|
|
12538
12628
|
interface LogFunc {
|
|
12539
|
-
(log_domain: string
|
|
12629
|
+
(log_domain: string, log_level: LogLevelFlags, message: string): void
|
|
12540
12630
|
}
|
|
12541
12631
|
/**
|
|
12542
12632
|
* Writer function for log entries. A log entry is a collection of one or more
|
|
@@ -12599,7 +12689,7 @@ interface NodeTraverseFunc {
|
|
|
12599
12689
|
* @returns %TRUE if the option was successfully parsed, %FALSE if an error occurred, in which case @error should be set with g_set_error()
|
|
12600
12690
|
*/
|
|
12601
12691
|
interface OptionArgFunc {
|
|
12602
|
-
(option_name: string
|
|
12692
|
+
(option_name: string, value: string, data: any | null): boolean
|
|
12603
12693
|
}
|
|
12604
12694
|
/**
|
|
12605
12695
|
* The type of function to be used as callback when a parse error occurs.
|
|
@@ -12641,7 +12731,7 @@ interface PollFunc {
|
|
|
12641
12731
|
* @param string the message to output
|
|
12642
12732
|
*/
|
|
12643
12733
|
interface PrintFunc {
|
|
12644
|
-
(string: string
|
|
12734
|
+
(string: string): void
|
|
12645
12735
|
}
|
|
12646
12736
|
/**
|
|
12647
12737
|
* Specifies the type of the function passed to g_regex_replace_eval().
|
|
@@ -12797,7 +12887,7 @@ interface TestFunc {
|
|
|
12797
12887
|
* @returns %TRUE if the program should abort, %FALSE otherwise
|
|
12798
12888
|
*/
|
|
12799
12889
|
interface TestLogFatalFunc {
|
|
12800
|
-
(log_domain: string
|
|
12890
|
+
(log_domain: string, log_level: LogLevelFlags, message: string): boolean
|
|
12801
12891
|
}
|
|
12802
12892
|
/**
|
|
12803
12893
|
* Specifies the type of the `func` functions passed to g_thread_new()
|
|
@@ -12818,7 +12908,7 @@ interface ThreadFunc {
|
|
|
12818
12908
|
* @returns a translation of the string for the current locale. The returned string is owned by GLib and must not be freed.
|
|
12819
12909
|
*/
|
|
12820
12910
|
interface TranslateFunc {
|
|
12821
|
-
(str: string
|
|
12911
|
+
(str: string, data: any | null): string
|
|
12822
12912
|
}
|
|
12823
12913
|
/**
|
|
12824
12914
|
* Specifies the type of function passed to g_tree_traverse(). It is
|
|
@@ -13134,7 +13224,7 @@ interface BookmarkFile {
|
|
|
13134
13224
|
* @param name the name of the application registering the bookmark or %NULL
|
|
13135
13225
|
* @param exec command line to be used to launch the bookmark or %NULL
|
|
13136
13226
|
*/
|
|
13137
|
-
add_application(uri: string
|
|
13227
|
+
add_application(uri: string, name: string | null, exec: string | null): void
|
|
13138
13228
|
/**
|
|
13139
13229
|
* Adds `group` to the list of groups to which the bookmark for `uri`
|
|
13140
13230
|
* belongs to.
|
|
@@ -13143,7 +13233,7 @@ interface BookmarkFile {
|
|
|
13143
13233
|
* @param uri a valid URI
|
|
13144
13234
|
* @param group the group name to be added
|
|
13145
13235
|
*/
|
|
13146
|
-
add_group(uri: string
|
|
13236
|
+
add_group(uri: string, group: string): void
|
|
13147
13237
|
/**
|
|
13148
13238
|
* Deeply copies a `bookmark` #GBookmarkFile object to a new one.
|
|
13149
13239
|
* @returns the copy of @bookmark. Use g_bookmark_free() when finished using it.
|
|
@@ -13161,7 +13251,7 @@ interface BookmarkFile {
|
|
|
13161
13251
|
* @param uri a valid URI
|
|
13162
13252
|
* @returns a timestamp
|
|
13163
13253
|
*/
|
|
13164
|
-
get_added(uri: string
|
|
13254
|
+
get_added(uri: string): number
|
|
13165
13255
|
/**
|
|
13166
13256
|
* Gets the time the bookmark for `uri` was added to `bookmark`
|
|
13167
13257
|
*
|
|
@@ -13170,7 +13260,7 @@ interface BookmarkFile {
|
|
|
13170
13260
|
* @param uri a valid URI
|
|
13171
13261
|
* @returns a #GDateTime
|
|
13172
13262
|
*/
|
|
13173
|
-
get_added_date_time(uri: string
|
|
13263
|
+
get_added_date_time(uri: string): DateTime
|
|
13174
13264
|
/**
|
|
13175
13265
|
* Gets the registration information of `app_name` for the bookmark for
|
|
13176
13266
|
* `uri`. See g_bookmark_file_set_application_info() for more information about
|
|
@@ -13189,7 +13279,7 @@ interface BookmarkFile {
|
|
|
13189
13279
|
* @param name an application's name
|
|
13190
13280
|
* @returns %TRUE on success.
|
|
13191
13281
|
*/
|
|
13192
|
-
get_app_info(uri: string
|
|
13282
|
+
get_app_info(uri: string, name: string): [ /* returnType */ boolean, /* exec */ string, /* count */ number, /* stamp */ number ]
|
|
13193
13283
|
/**
|
|
13194
13284
|
* Gets the registration information of `app_name` for the bookmark for
|
|
13195
13285
|
* `uri`. See g_bookmark_file_set_application_info() for more information about
|
|
@@ -13208,7 +13298,7 @@ interface BookmarkFile {
|
|
|
13208
13298
|
* @param name an application's name
|
|
13209
13299
|
* @returns %TRUE on success.
|
|
13210
13300
|
*/
|
|
13211
|
-
get_application_info(uri: string
|
|
13301
|
+
get_application_info(uri: string, name: string): [ /* returnType */ boolean, /* exec */ string, /* count */ number, /* stamp */ DateTime ]
|
|
13212
13302
|
/**
|
|
13213
13303
|
* Retrieves the names of the applications that have registered the
|
|
13214
13304
|
* bookmark for `uri`.
|
|
@@ -13218,7 +13308,7 @@ interface BookmarkFile {
|
|
|
13218
13308
|
* @param uri a valid URI
|
|
13219
13309
|
* @returns a newly allocated %NULL-terminated array of strings. Use g_strfreev() to free it.
|
|
13220
13310
|
*/
|
|
13221
|
-
get_applications(uri: string
|
|
13311
|
+
get_applications(uri: string): string[]
|
|
13222
13312
|
/**
|
|
13223
13313
|
* Retrieves the description of the bookmark for `uri`.
|
|
13224
13314
|
*
|
|
@@ -13227,7 +13317,7 @@ interface BookmarkFile {
|
|
|
13227
13317
|
* @param uri a valid URI
|
|
13228
13318
|
* @returns a newly allocated string or %NULL if the specified URI cannot be found.
|
|
13229
13319
|
*/
|
|
13230
|
-
get_description(uri: string
|
|
13320
|
+
get_description(uri: string): string | null
|
|
13231
13321
|
/**
|
|
13232
13322
|
* Retrieves the list of group names of the bookmark for `uri`.
|
|
13233
13323
|
*
|
|
@@ -13239,7 +13329,7 @@ interface BookmarkFile {
|
|
|
13239
13329
|
* @param uri a valid URI
|
|
13240
13330
|
* @returns a newly allocated %NULL-terminated array of group names. Use g_strfreev() to free it.
|
|
13241
13331
|
*/
|
|
13242
|
-
get_groups(uri: string
|
|
13332
|
+
get_groups(uri: string): string[]
|
|
13243
13333
|
/**
|
|
13244
13334
|
* Gets the icon of the bookmark for `uri`.
|
|
13245
13335
|
*
|
|
@@ -13248,7 +13338,7 @@ interface BookmarkFile {
|
|
|
13248
13338
|
* @param uri a valid URI
|
|
13249
13339
|
* @returns %TRUE if the icon for the bookmark for the URI was found. You should free the returned strings.
|
|
13250
13340
|
*/
|
|
13251
|
-
get_icon(uri: string
|
|
13341
|
+
get_icon(uri: string): [ /* returnType */ boolean, /* href */ string, /* mime_type */ string ]
|
|
13252
13342
|
/**
|
|
13253
13343
|
* Gets whether the private flag of the bookmark for `uri` is set.
|
|
13254
13344
|
*
|
|
@@ -13259,7 +13349,7 @@ interface BookmarkFile {
|
|
|
13259
13349
|
* @param uri a valid URI
|
|
13260
13350
|
* @returns %TRUE if the private flag is set, %FALSE otherwise.
|
|
13261
13351
|
*/
|
|
13262
|
-
get_is_private(uri: string
|
|
13352
|
+
get_is_private(uri: string): boolean
|
|
13263
13353
|
/**
|
|
13264
13354
|
* Retrieves the MIME type of the resource pointed by `uri`.
|
|
13265
13355
|
*
|
|
@@ -13270,7 +13360,7 @@ interface BookmarkFile {
|
|
|
13270
13360
|
* @param uri a valid URI
|
|
13271
13361
|
* @returns a newly allocated string or %NULL if the specified URI cannot be found.
|
|
13272
13362
|
*/
|
|
13273
|
-
get_mime_type(uri: string
|
|
13363
|
+
get_mime_type(uri: string): string | null
|
|
13274
13364
|
/**
|
|
13275
13365
|
* Gets the time when the bookmark for `uri` was last modified.
|
|
13276
13366
|
*
|
|
@@ -13279,7 +13369,7 @@ interface BookmarkFile {
|
|
|
13279
13369
|
* @param uri a valid URI
|
|
13280
13370
|
* @returns a timestamp
|
|
13281
13371
|
*/
|
|
13282
|
-
get_modified(uri: string
|
|
13372
|
+
get_modified(uri: string): number
|
|
13283
13373
|
/**
|
|
13284
13374
|
* Gets the time when the bookmark for `uri` was last modified.
|
|
13285
13375
|
*
|
|
@@ -13288,7 +13378,7 @@ interface BookmarkFile {
|
|
|
13288
13378
|
* @param uri a valid URI
|
|
13289
13379
|
* @returns a #GDateTime
|
|
13290
13380
|
*/
|
|
13291
|
-
get_modified_date_time(uri: string
|
|
13381
|
+
get_modified_date_time(uri: string): DateTime
|
|
13292
13382
|
/**
|
|
13293
13383
|
* Gets the number of bookmarks inside `bookmark`.
|
|
13294
13384
|
* @returns the number of bookmarks
|
|
@@ -13320,7 +13410,7 @@ interface BookmarkFile {
|
|
|
13320
13410
|
* @param uri a valid URI
|
|
13321
13411
|
* @returns a timestamp.
|
|
13322
13412
|
*/
|
|
13323
|
-
get_visited(uri: string
|
|
13413
|
+
get_visited(uri: string): number
|
|
13324
13414
|
/**
|
|
13325
13415
|
* Gets the time the bookmark for `uri` was last visited.
|
|
13326
13416
|
*
|
|
@@ -13329,7 +13419,7 @@ interface BookmarkFile {
|
|
|
13329
13419
|
* @param uri a valid URI
|
|
13330
13420
|
* @returns a #GDateTime
|
|
13331
13421
|
*/
|
|
13332
|
-
get_visited_date_time(uri: string
|
|
13422
|
+
get_visited_date_time(uri: string): DateTime
|
|
13333
13423
|
/**
|
|
13334
13424
|
* Checks whether the bookmark for `uri` inside `bookmark` has been
|
|
13335
13425
|
* registered by application `name`.
|
|
@@ -13340,7 +13430,7 @@ interface BookmarkFile {
|
|
|
13340
13430
|
* @param name the name of the application
|
|
13341
13431
|
* @returns %TRUE if the application @name was found
|
|
13342
13432
|
*/
|
|
13343
|
-
has_application(uri: string
|
|
13433
|
+
has_application(uri: string, name: string): boolean
|
|
13344
13434
|
/**
|
|
13345
13435
|
* Checks whether `group` appears in the list of groups to which
|
|
13346
13436
|
* the bookmark for `uri` belongs to.
|
|
@@ -13351,13 +13441,13 @@ interface BookmarkFile {
|
|
|
13351
13441
|
* @param group the group name to be searched
|
|
13352
13442
|
* @returns %TRUE if @group was found.
|
|
13353
13443
|
*/
|
|
13354
|
-
has_group(uri: string
|
|
13444
|
+
has_group(uri: string, group: string): boolean
|
|
13355
13445
|
/**
|
|
13356
13446
|
* Looks whether the desktop bookmark has an item with its URI set to `uri`.
|
|
13357
13447
|
* @param uri a valid URI
|
|
13358
13448
|
* @returns %TRUE if @uri is inside @bookmark, %FALSE otherwise
|
|
13359
13449
|
*/
|
|
13360
|
-
has_item(uri: string
|
|
13450
|
+
has_item(uri: string): boolean
|
|
13361
13451
|
/**
|
|
13362
13452
|
* Loads a bookmark file from memory into an empty #GBookmarkFile
|
|
13363
13453
|
* structure. If the object cannot be created then `error` is set to a
|
|
@@ -13395,7 +13485,7 @@ interface BookmarkFile {
|
|
|
13395
13485
|
* @param new_uri a valid URI, or %NULL
|
|
13396
13486
|
* @returns %TRUE if the URI was successfully changed
|
|
13397
13487
|
*/
|
|
13398
|
-
move_item(old_uri: string
|
|
13488
|
+
move_item(old_uri: string, new_uri: string | null): boolean
|
|
13399
13489
|
/**
|
|
13400
13490
|
* Removes application registered with `name` from the list of applications
|
|
13401
13491
|
* that have registered a bookmark for `uri` inside `bookmark`.
|
|
@@ -13409,7 +13499,7 @@ interface BookmarkFile {
|
|
|
13409
13499
|
* @param name the name of the application
|
|
13410
13500
|
* @returns %TRUE if the application was successfully removed.
|
|
13411
13501
|
*/
|
|
13412
|
-
remove_application(uri: string
|
|
13502
|
+
remove_application(uri: string, name: string): boolean
|
|
13413
13503
|
/**
|
|
13414
13504
|
* Removes `group` from the list of groups to which the bookmark
|
|
13415
13505
|
* for `uri` belongs to.
|
|
@@ -13422,13 +13512,13 @@ interface BookmarkFile {
|
|
|
13422
13512
|
* @param group the group name to be removed
|
|
13423
13513
|
* @returns %TRUE if @group was successfully removed.
|
|
13424
13514
|
*/
|
|
13425
|
-
remove_group(uri: string
|
|
13515
|
+
remove_group(uri: string, group: string): boolean
|
|
13426
13516
|
/**
|
|
13427
13517
|
* Removes the bookmark for `uri` from the bookmark file `bookmark`.
|
|
13428
13518
|
* @param uri a valid URI
|
|
13429
13519
|
* @returns %TRUE if the bookmark was removed successfully.
|
|
13430
13520
|
*/
|
|
13431
|
-
remove_item(uri: string
|
|
13521
|
+
remove_item(uri: string): boolean
|
|
13432
13522
|
/**
|
|
13433
13523
|
* Sets the time the bookmark for `uri` was added into `bookmark`.
|
|
13434
13524
|
*
|
|
@@ -13436,7 +13526,7 @@ interface BookmarkFile {
|
|
|
13436
13526
|
* @param uri a valid URI
|
|
13437
13527
|
* @param added a timestamp or -1 to use the current time
|
|
13438
13528
|
*/
|
|
13439
|
-
set_added(uri: string
|
|
13529
|
+
set_added(uri: string, added: number): void
|
|
13440
13530
|
/**
|
|
13441
13531
|
* Sets the time the bookmark for `uri` was added into `bookmark`.
|
|
13442
13532
|
*
|
|
@@ -13444,7 +13534,7 @@ interface BookmarkFile {
|
|
|
13444
13534
|
* @param uri a valid URI
|
|
13445
13535
|
* @param added a #GDateTime
|
|
13446
13536
|
*/
|
|
13447
|
-
set_added_date_time(uri: string
|
|
13537
|
+
set_added_date_time(uri: string, added: DateTime): void
|
|
13448
13538
|
/**
|
|
13449
13539
|
* Sets the meta-data of application `name` inside the list of
|
|
13450
13540
|
* applications that have registered a bookmark for `uri` inside
|
|
@@ -13481,7 +13571,7 @@ interface BookmarkFile {
|
|
|
13481
13571
|
* @param stamp the time of the last registration for this application
|
|
13482
13572
|
* @returns %TRUE if the application's meta-data was successfully changed.
|
|
13483
13573
|
*/
|
|
13484
|
-
set_app_info(uri: string
|
|
13574
|
+
set_app_info(uri: string, name: string, exec: string, count: number, stamp: number): boolean
|
|
13485
13575
|
/**
|
|
13486
13576
|
* Sets the meta-data of application `name` inside the list of
|
|
13487
13577
|
* applications that have registered a bookmark for `uri` inside
|
|
@@ -13517,7 +13607,7 @@ interface BookmarkFile {
|
|
|
13517
13607
|
* @param stamp the time of the last registration for this application, which may be %NULL if `count` is 0
|
|
13518
13608
|
* @returns %TRUE if the application's meta-data was successfully changed.
|
|
13519
13609
|
*/
|
|
13520
|
-
set_application_info(uri: string
|
|
13610
|
+
set_application_info(uri: string, name: string, exec: string, count: number, stamp: DateTime | null): boolean
|
|
13521
13611
|
/**
|
|
13522
13612
|
* Sets `description` as the description of the bookmark for `uri`.
|
|
13523
13613
|
*
|
|
@@ -13527,7 +13617,7 @@ interface BookmarkFile {
|
|
|
13527
13617
|
* @param uri a valid URI or %NULL
|
|
13528
13618
|
* @param description a string
|
|
13529
13619
|
*/
|
|
13530
|
-
set_description(uri: string | null, description: string
|
|
13620
|
+
set_description(uri: string | null, description: string): void
|
|
13531
13621
|
/**
|
|
13532
13622
|
* Sets a list of group names for the item with URI `uri`. Each previously
|
|
13533
13623
|
* set group name list is removed.
|
|
@@ -13536,7 +13626,7 @@ interface BookmarkFile {
|
|
|
13536
13626
|
* @param uri an item's URI
|
|
13537
13627
|
* @param groups an array of group names, or %NULL to remove all groups
|
|
13538
13628
|
*/
|
|
13539
|
-
set_groups(uri: string
|
|
13629
|
+
set_groups(uri: string, groups: string[] | null): void
|
|
13540
13630
|
/**
|
|
13541
13631
|
* Sets the icon for the bookmark for `uri`. If `href` is %NULL, unsets
|
|
13542
13632
|
* the currently set icon. `href` can either be a full URL for the icon
|
|
@@ -13547,7 +13637,7 @@ interface BookmarkFile {
|
|
|
13547
13637
|
* @param href the URI of the icon for the bookmark, or %NULL
|
|
13548
13638
|
* @param mime_type the MIME type of the icon for the bookmark
|
|
13549
13639
|
*/
|
|
13550
|
-
set_icon(uri: string
|
|
13640
|
+
set_icon(uri: string, href: string | null, mime_type: string): void
|
|
13551
13641
|
/**
|
|
13552
13642
|
* Sets the private flag of the bookmark for `uri`.
|
|
13553
13643
|
*
|
|
@@ -13555,7 +13645,7 @@ interface BookmarkFile {
|
|
|
13555
13645
|
* @param uri a valid URI
|
|
13556
13646
|
* @param is_private %TRUE if the bookmark should be marked as private
|
|
13557
13647
|
*/
|
|
13558
|
-
set_is_private(uri: string
|
|
13648
|
+
set_is_private(uri: string, is_private: boolean): void
|
|
13559
13649
|
/**
|
|
13560
13650
|
* Sets `mime_type` as the MIME type of the bookmark for `uri`.
|
|
13561
13651
|
*
|
|
@@ -13563,7 +13653,7 @@ interface BookmarkFile {
|
|
|
13563
13653
|
* @param uri a valid URI
|
|
13564
13654
|
* @param mime_type a MIME type
|
|
13565
13655
|
*/
|
|
13566
|
-
set_mime_type(uri: string
|
|
13656
|
+
set_mime_type(uri: string, mime_type: string): void
|
|
13567
13657
|
/**
|
|
13568
13658
|
* Sets the last time the bookmark for `uri` was last modified.
|
|
13569
13659
|
*
|
|
@@ -13576,7 +13666,7 @@ interface BookmarkFile {
|
|
|
13576
13666
|
* @param uri a valid URI
|
|
13577
13667
|
* @param modified a timestamp or -1 to use the current time
|
|
13578
13668
|
*/
|
|
13579
|
-
set_modified(uri: string
|
|
13669
|
+
set_modified(uri: string, modified: number): void
|
|
13580
13670
|
/**
|
|
13581
13671
|
* Sets the last time the bookmark for `uri` was last modified.
|
|
13582
13672
|
*
|
|
@@ -13589,7 +13679,7 @@ interface BookmarkFile {
|
|
|
13589
13679
|
* @param uri a valid URI
|
|
13590
13680
|
* @param modified a #GDateTime
|
|
13591
13681
|
*/
|
|
13592
|
-
set_modified_date_time(uri: string
|
|
13682
|
+
set_modified_date_time(uri: string, modified: DateTime): void
|
|
13593
13683
|
/**
|
|
13594
13684
|
* Sets `title` as the title of the bookmark for `uri` inside the
|
|
13595
13685
|
* bookmark file `bookmark`.
|
|
@@ -13600,7 +13690,7 @@ interface BookmarkFile {
|
|
|
13600
13690
|
* @param uri a valid URI or %NULL
|
|
13601
13691
|
* @param title a UTF-8 encoded string
|
|
13602
13692
|
*/
|
|
13603
|
-
set_title(uri: string | null, title: string
|
|
13693
|
+
set_title(uri: string | null, title: string): void
|
|
13604
13694
|
/**
|
|
13605
13695
|
* Sets the time the bookmark for `uri` was last visited.
|
|
13606
13696
|
*
|
|
@@ -13614,7 +13704,7 @@ interface BookmarkFile {
|
|
|
13614
13704
|
* @param uri a valid URI
|
|
13615
13705
|
* @param visited a timestamp or -1 to use the current time
|
|
13616
13706
|
*/
|
|
13617
|
-
set_visited(uri: string
|
|
13707
|
+
set_visited(uri: string, visited: number): void
|
|
13618
13708
|
/**
|
|
13619
13709
|
* Sets the time the bookmark for `uri` was last visited.
|
|
13620
13710
|
*
|
|
@@ -13628,7 +13718,7 @@ interface BookmarkFile {
|
|
|
13628
13718
|
* @param uri a valid URI
|
|
13629
13719
|
* @param visited a #GDateTime
|
|
13630
13720
|
*/
|
|
13631
|
-
set_visited_date_time(uri: string
|
|
13721
|
+
set_visited_date_time(uri: string, visited: DateTime): void
|
|
13632
13722
|
/**
|
|
13633
13723
|
* This function outputs `bookmark` as a string.
|
|
13634
13724
|
* @returns a newly allocated string holding the contents of the #GBookmarkFile
|
|
@@ -13644,7 +13734,44 @@ interface BookmarkFile {
|
|
|
13644
13734
|
}
|
|
13645
13735
|
|
|
13646
13736
|
/**
|
|
13647
|
-
*
|
|
13737
|
+
* GBookmarkFile lets you parse, edit or create files containing bookmarks
|
|
13738
|
+
* to URI, along with some meta-data about the resource pointed by the URI
|
|
13739
|
+
* like its MIME type, the application that is registering the bookmark and
|
|
13740
|
+
* the icon that should be used to represent the bookmark. The data is stored
|
|
13741
|
+
* using the
|
|
13742
|
+
* [Desktop Bookmark Specification](http://www.gnome.org/~ebassi/bookmark-spec).
|
|
13743
|
+
*
|
|
13744
|
+
* The syntax of the bookmark files is described in detail inside the
|
|
13745
|
+
* Desktop Bookmark Specification, here is a quick summary: bookmark
|
|
13746
|
+
* files use a sub-class of the XML Bookmark Exchange Language
|
|
13747
|
+
* specification, consisting of valid UTF-8 encoded XML, under the
|
|
13748
|
+
* <xbel> root element; each bookmark is stored inside a
|
|
13749
|
+
* <bookmark> element, using its URI: no relative paths can
|
|
13750
|
+
* be used inside a bookmark file. The bookmark may have a user defined
|
|
13751
|
+
* title and description, to be used instead of the URI. Under the
|
|
13752
|
+
* <metadata> element, with its owner attribute set to
|
|
13753
|
+
* `http://freedesktop.org`, is stored the meta-data about a resource
|
|
13754
|
+
* pointed by its URI. The meta-data consists of the resource's MIME
|
|
13755
|
+
* type; the applications that have registered a bookmark; the groups
|
|
13756
|
+
* to which a bookmark belongs to; a visibility flag, used to set the
|
|
13757
|
+
* bookmark as "private" to the applications and groups that has it
|
|
13758
|
+
* registered; the URI and MIME type of an icon, to be used when
|
|
13759
|
+
* displaying the bookmark inside a GUI.
|
|
13760
|
+
*
|
|
13761
|
+
* Here is an example of a bookmark file:
|
|
13762
|
+
* [bookmarks.xbel](https://gitlab.gnome.org/GNOME/glib/-/blob/HEAD/glib/tests/bookmarks.xbel)
|
|
13763
|
+
*
|
|
13764
|
+
* A bookmark file might contain more than one bookmark; each bookmark
|
|
13765
|
+
* is accessed through its URI.
|
|
13766
|
+
*
|
|
13767
|
+
* The important caveat of bookmark files is that when you add a new
|
|
13768
|
+
* bookmark you must also add the application that is registering it, using
|
|
13769
|
+
* g_bookmark_file_add_application() or g_bookmark_file_set_application_info().
|
|
13770
|
+
* If a bookmark has no applications then it won't be dumped when creating
|
|
13771
|
+
* the on disk representation, using g_bookmark_file_to_data() or
|
|
13772
|
+
* g_bookmark_file_to_file().
|
|
13773
|
+
*
|
|
13774
|
+
* The #GBookmarkFile parser was added in GLib 2.12.
|
|
13648
13775
|
* @record
|
|
13649
13776
|
*/
|
|
13650
13777
|
class BookmarkFile {
|
|
@@ -13713,8 +13840,10 @@ class ByteArray {
|
|
|
13713
13840
|
*/
|
|
13714
13841
|
static new(): Uint8Array
|
|
13715
13842
|
/**
|
|
13716
|
-
*
|
|
13717
|
-
*
|
|
13843
|
+
* Creates a byte array containing the `data`.
|
|
13844
|
+
* After this call, `data` belongs to the #GByteArray and may no longer be
|
|
13845
|
+
* modified by the caller. The memory of `data` has to be dynamically
|
|
13846
|
+
* allocated and will eventually be freed with g_free().
|
|
13718
13847
|
*
|
|
13719
13848
|
* Do not use it if `len` is greater than %G_MAXUINT. #GByteArray
|
|
13720
13849
|
* stores the length of its data in #guint, which may be shorter than
|
|
@@ -13961,11 +14090,9 @@ class Bytes {
|
|
|
13961
14090
|
/**
|
|
13962
14091
|
* Creates a new #GBytes from `data`.
|
|
13963
14092
|
*
|
|
13964
|
-
* After this call, `data` belongs to the
|
|
13965
|
-
* modified by the caller.
|
|
13966
|
-
*
|
|
13967
|
-
* a call to g_malloc(), g_malloc0() or g_realloc() or by one of the many
|
|
13968
|
-
* functions that wrap these calls (such as g_new(), g_strdup(), etc).
|
|
14093
|
+
* After this call, `data` belongs to the #GBytes and may no longer be
|
|
14094
|
+
* modified by the caller. The memory of `data` has to be dynamically
|
|
14095
|
+
* allocated and will eventually be freed with g_free().
|
|
13969
14096
|
*
|
|
13970
14097
|
* For creating #GBytes with memory from other allocators, see
|
|
13971
14098
|
* g_bytes_new_with_free_func().
|
|
@@ -14002,7 +14129,7 @@ interface Checksum {
|
|
|
14002
14129
|
* The hexadecimal characters will be lower case.
|
|
14003
14130
|
* @returns the hexadecimal representation of the checksum. The returned string is owned by the checksum and should not be modified or freed.
|
|
14004
14131
|
*/
|
|
14005
|
-
get_string(): string
|
|
14132
|
+
get_string(): string
|
|
14006
14133
|
/**
|
|
14007
14134
|
* Resets the state of the `checksum` back to its initial state.
|
|
14008
14135
|
*/
|
|
@@ -14508,7 +14635,7 @@ interface Date {
|
|
|
14508
14635
|
* capacity).
|
|
14509
14636
|
* @param str string to parse
|
|
14510
14637
|
*/
|
|
14511
|
-
set_parse(str: string
|
|
14638
|
+
set_parse(str: string): void
|
|
14512
14639
|
/**
|
|
14513
14640
|
* Sets the value of a date from a #GTime value.
|
|
14514
14641
|
* The time to date conversion is done using the user's current timezone.
|
|
@@ -14713,7 +14840,7 @@ class Date {
|
|
|
14713
14840
|
* @param date valid #GDate
|
|
14714
14841
|
* @returns number of characters written to the buffer, or 0 the buffer was too small
|
|
14715
14842
|
*/
|
|
14716
|
-
static strftime(s: string | null, slen: number, format: string
|
|
14843
|
+
static strftime(s: string | null, slen: number, format: string, date: Date): number
|
|
14717
14844
|
/**
|
|
14718
14845
|
* Returns %TRUE if the day of the month is valid (a day is valid if it's
|
|
14719
14846
|
* between 1 and 31 inclusive).
|
|
@@ -14868,107 +14995,107 @@ interface DateTime {
|
|
|
14868
14995
|
* Creates a newly allocated string representing the requested `format`.
|
|
14869
14996
|
*
|
|
14870
14997
|
* The format strings understood by this function are a subset of the
|
|
14871
|
-
* strftime() format language as specified by C99. The
|
|
14872
|
-
* conversions are not supported, nor is the
|
|
14873
|
-
* extensions
|
|
14874
|
-
*
|
|
14998
|
+
* `strftime()` format language as specified by C99. The `%D`, `%U` and `%W`
|
|
14999
|
+
* conversions are not supported, nor is the `E` modifier. The GNU
|
|
15000
|
+
* extensions `%k`, `%l`, `%s` and `%P` are supported, however, as are the
|
|
15001
|
+
* `0`, `_` and `-` modifiers. The Python extension `%f` is also supported.
|
|
14875
15002
|
*
|
|
14876
|
-
* In contrast to strftime()
|
|
15003
|
+
* In contrast to `strftime()`, this function always produces a UTF-8
|
|
14877
15004
|
* string, regardless of the current locale. Note that the rendering of
|
|
14878
|
-
* many formats is locale-dependent and may not match the strftime()
|
|
15005
|
+
* many formats is locale-dependent and may not match the `strftime()`
|
|
14879
15006
|
* output exactly.
|
|
14880
15007
|
*
|
|
14881
15008
|
* The following format specifiers are supported:
|
|
14882
15009
|
*
|
|
14883
|
-
* -
|
|
14884
|
-
* -
|
|
14885
|
-
* -
|
|
14886
|
-
* -
|
|
14887
|
-
* -
|
|
14888
|
-
* -
|
|
14889
|
-
* -
|
|
14890
|
-
* -
|
|
14891
|
-
* single digits are preceded by a figure space
|
|
14892
|
-
* -
|
|
14893
|
-
* -
|
|
14894
|
-
* decimal number (00-99). This works well with
|
|
14895
|
-
* -
|
|
14896
|
-
* well with
|
|
14897
|
-
* -
|
|
14898
|
-
* -
|
|
14899
|
-
* -
|
|
14900
|
-
* -
|
|
14901
|
-
* -
|
|
14902
|
-
* single digits are preceded by a figure space
|
|
14903
|
-
* -
|
|
14904
|
-
* single digits are preceded by a figure space
|
|
14905
|
-
* -
|
|
14906
|
-
* -
|
|
14907
|
-
* -
|
|
14908
|
-
* -
|
|
15010
|
+
* - `%a`: the abbreviated weekday name according to the current locale
|
|
15011
|
+
* - `%A`: the full weekday name according to the current locale
|
|
15012
|
+
* - `%b`: the abbreviated month name according to the current locale
|
|
15013
|
+
* - `%B`: the full month name according to the current locale
|
|
15014
|
+
* - `%c`: the preferred date and time representation for the current locale
|
|
15015
|
+
* - `%C`: the century number (year/100) as a 2-digit integer (00-99)
|
|
15016
|
+
* - `%d`: the day of the month as a decimal number (range 01 to 31)
|
|
15017
|
+
* - `%e`: the day of the month as a decimal number (range 1 to 31);
|
|
15018
|
+
* single digits are preceded by a figure space (U+2007)
|
|
15019
|
+
* - `%F`: equivalent to `%Y-%m-%d` (the ISO 8601 date format)
|
|
15020
|
+
* - `%g`: the last two digits of the ISO 8601 week-based year as a
|
|
15021
|
+
* decimal number (00-99). This works well with `%V` and `%u`.
|
|
15022
|
+
* - `%G`: the ISO 8601 week-based year as a decimal number. This works
|
|
15023
|
+
* well with `%V` and `%u`.
|
|
15024
|
+
* - `%h`: equivalent to `%b`
|
|
15025
|
+
* - `%H`: the hour as a decimal number using a 24-hour clock (range 00 to 23)
|
|
15026
|
+
* - `%I`: the hour as a decimal number using a 12-hour clock (range 01 to 12)
|
|
15027
|
+
* - `%j`: the day of the year as a decimal number (range 001 to 366)
|
|
15028
|
+
* - `%k`: the hour (24-hour clock) as a decimal number (range 0 to 23);
|
|
15029
|
+
* single digits are preceded by a figure space (U+2007)
|
|
15030
|
+
* - `%l`: the hour (12-hour clock) as a decimal number (range 1 to 12);
|
|
15031
|
+
* single digits are preceded by a figure space (U+2007)
|
|
15032
|
+
* - `%m`: the month as a decimal number (range 01 to 12)
|
|
15033
|
+
* - `%M`: the minute as a decimal number (range 00 to 59)
|
|
15034
|
+
* - `%f`: the microsecond as a decimal number (range 000000 to 999999)
|
|
15035
|
+
* - `%p`: either ‘AM’ or ‘PM’ according to the given time value, or the
|
|
14909
15036
|
* corresponding strings for the current locale. Noon is treated as
|
|
14910
|
-
*
|
|
14911
|
-
* many locales have no concept of AM/PM formatting. Use
|
|
14912
|
-
* -
|
|
15037
|
+
* ‘PM’ and midnight as ‘AM’. Use of this format specifier is discouraged, as
|
|
15038
|
+
* many locales have no concept of AM/PM formatting. Use `%c` or `%X` instead.
|
|
15039
|
+
* - `%P`: like `%p` but lowercase: ‘am’ or ‘pm’ or a corresponding string for
|
|
14913
15040
|
* the current locale. Use of this format specifier is discouraged, as
|
|
14914
|
-
* many locales have no concept of AM/PM formatting. Use
|
|
14915
|
-
* -
|
|
14916
|
-
* discouraged, as many locales have no concept of AM/PM formatting. Use
|
|
14917
|
-
* or
|
|
14918
|
-
* -
|
|
14919
|
-
* -
|
|
15041
|
+
* many locales have no concept of AM/PM formatting. Use `%c` or `%X` instead.
|
|
15042
|
+
* - `%r`: the time in a.m. or p.m. notation. Use of this format specifier is
|
|
15043
|
+
* discouraged, as many locales have no concept of AM/PM formatting. Use `%c`
|
|
15044
|
+
* or `%X` instead.
|
|
15045
|
+
* - `%R`: the time in 24-hour notation (`%H:%M`)
|
|
15046
|
+
* - `%s`: the number of seconds since the Epoch, that is, since 1970-01-01
|
|
14920
15047
|
* 00:00:00 UTC
|
|
14921
|
-
* -
|
|
14922
|
-
* -
|
|
14923
|
-
* -
|
|
14924
|
-
* -
|
|
14925
|
-
* Monday being 1. This works well with
|
|
14926
|
-
* -
|
|
15048
|
+
* - `%S`: the second as a decimal number (range 00 to 60)
|
|
15049
|
+
* - `%t`: a tab character
|
|
15050
|
+
* - `%T`: the time in 24-hour notation with seconds (`%H:%M:%S`)
|
|
15051
|
+
* - `%u`: the ISO 8601 standard day of the week as a decimal, range 1 to 7,
|
|
15052
|
+
* Monday being 1. This works well with `%G` and `%V`.
|
|
15053
|
+
* - `%V`: the ISO 8601 standard week number of the current year as a decimal
|
|
14927
15054
|
* number, range 01 to 53, where week 1 is the first week that has at
|
|
14928
15055
|
* least 4 days in the new year. See g_date_time_get_week_of_year().
|
|
14929
|
-
* This works well with
|
|
14930
|
-
* -
|
|
14931
|
-
* This is not the ISO 8601 standard format
|
|
14932
|
-
* -
|
|
15056
|
+
* This works well with `%G` and `%u`.
|
|
15057
|
+
* - `%w`: the day of the week as a decimal, range 0 to 6, Sunday being 0.
|
|
15058
|
+
* This is not the ISO 8601 standard format — use `%u` instead.
|
|
15059
|
+
* - `%x`: the preferred date representation for the current locale without
|
|
14933
15060
|
* the time
|
|
14934
|
-
* -
|
|
15061
|
+
* - `%X`: the preferred time representation for the current locale without
|
|
14935
15062
|
* the date
|
|
14936
|
-
* -
|
|
14937
|
-
* -
|
|
14938
|
-
* -
|
|
14939
|
-
* -
|
|
14940
|
-
* This is a gnulib strftime() extension. Since: 2.38
|
|
14941
|
-
* -
|
|
14942
|
-
* gnulib strftime() extension. Since: 2.38
|
|
14943
|
-
* -
|
|
14944
|
-
* precision (e.g.,
|
|
14945
|
-
* -
|
|
14946
|
-
* -
|
|
15063
|
+
* - `%y`: the year as a decimal number without the century
|
|
15064
|
+
* - `%Y`: the year as a decimal number including the century
|
|
15065
|
+
* - `%z`: the time zone as an offset from UTC (`+hhmm`)
|
|
15066
|
+
* - `%:z`: the time zone as an offset from UTC (`+hh:mm`).
|
|
15067
|
+
* This is a gnulib `strftime()` extension. Since: 2.38
|
|
15068
|
+
* - `%::z`: the time zone as an offset from UTC (`+hh:mm:ss`). This is a
|
|
15069
|
+
* gnulib `strftime()` extension. Since: 2.38
|
|
15070
|
+
* - `%:::z`: the time zone as an offset from UTC, with `:` to necessary
|
|
15071
|
+
* precision (e.g., `-04`, `+05:30`). This is a gnulib `strftime()` extension. Since: 2.38
|
|
15072
|
+
* - `%Z`: the time zone or name or abbreviation
|
|
15073
|
+
* - `%%`: a literal `%` character
|
|
14947
15074
|
*
|
|
14948
15075
|
* Some conversion specifications can be modified by preceding the
|
|
14949
15076
|
* conversion specifier by one or more modifier characters. The
|
|
14950
15077
|
* following modifiers are supported for many of the numeric
|
|
14951
15078
|
* conversions:
|
|
14952
15079
|
*
|
|
14953
|
-
* - O
|
|
14954
|
-
* - _
|
|
15080
|
+
* - `O`: Use alternative numeric symbols, if the current locale supports those.
|
|
15081
|
+
* - `_`: Pad a numeric result with spaces. This overrides the default padding
|
|
14955
15082
|
* for the specifier.
|
|
14956
|
-
* -
|
|
15083
|
+
* - `-`: Do not pad a numeric result. This overrides the default padding
|
|
14957
15084
|
* for the specifier.
|
|
14958
|
-
* - 0
|
|
15085
|
+
* - `0`: Pad a numeric result with zeros. This overrides the default padding
|
|
14959
15086
|
* for the specifier.
|
|
14960
15087
|
*
|
|
14961
|
-
* Additionally, when O is used with B
|
|
15088
|
+
* Additionally, when `O` is used with `B`, `b`, or `h`, it produces the alternative
|
|
14962
15089
|
* form of a month name. The alternative form should be used when the month
|
|
14963
15090
|
* name is used without a day number (e.g., standalone). It is required in
|
|
14964
15091
|
* some languages (Baltic, Slavic, Greek, and more) due to their grammatical
|
|
14965
|
-
* rules. For other languages there is no difference.
|
|
14966
|
-
* strftime() extension expected to be added to the future POSIX specification,
|
|
14967
|
-
*
|
|
15092
|
+
* rules. For other languages there is no difference. `%OB` is a GNU and BSD
|
|
15093
|
+
* `strftime()` extension expected to be added to the future POSIX specification,
|
|
15094
|
+
* `%Ob` and `%Oh` are GNU `strftime()` extensions. Since: 2.56
|
|
14968
15095
|
* @param format a valid UTF-8 string, containing the format for the #GDateTime
|
|
14969
15096
|
* @returns a newly allocated string formatted to the requested format or %NULL in the case that there was an error (such as a format specifier not being supported in the current locale). The string should be freed with g_free().
|
|
14970
15097
|
*/
|
|
14971
|
-
format(format: string
|
|
15098
|
+
format(format: string): string | null
|
|
14972
15099
|
/**
|
|
14973
15100
|
* Format `datetime` in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601),
|
|
14974
15101
|
* including the date, time and time zone, and return that as a UTF-8 encoded
|
|
@@ -15042,7 +15169,7 @@ interface DateTime {
|
|
|
15042
15169
|
* time is in effect.
|
|
15043
15170
|
* @returns the time zone abbreviation. The returned string is owned by the #GDateTime and it should not be modified or freed
|
|
15044
15171
|
*/
|
|
15045
|
-
get_timezone_abbreviation(): string
|
|
15172
|
+
get_timezone_abbreviation(): string
|
|
15046
15173
|
/**
|
|
15047
15174
|
* Determines the offset to UTC in effect at the time and in the time
|
|
15048
15175
|
* zone of `datetime`.
|
|
@@ -15340,7 +15467,7 @@ class DateTime {
|
|
|
15340
15467
|
* @param default_tz a #GTimeZone to use if the text doesn't contain a timezone, or %NULL.
|
|
15341
15468
|
* @returns a new #GDateTime, or %NULL
|
|
15342
15469
|
*/
|
|
15343
|
-
static new_from_iso8601(text: string
|
|
15470
|
+
static new_from_iso8601(text: string, default_tz: TimeZone | null): DateTime
|
|
15344
15471
|
/**
|
|
15345
15472
|
* Creates a #GDateTime corresponding to the given #GTimeVal `tv` in the
|
|
15346
15473
|
* local time zone.
|
|
@@ -15484,7 +15611,7 @@ interface DebugKey {
|
|
|
15484
15611
|
* the string
|
|
15485
15612
|
* @field
|
|
15486
15613
|
*/
|
|
15487
|
-
key: string
|
|
15614
|
+
key: string
|
|
15488
15615
|
/**
|
|
15489
15616
|
* the flag
|
|
15490
15617
|
* @field
|
|
@@ -15663,7 +15790,7 @@ class Error {
|
|
|
15663
15790
|
* @param message error message
|
|
15664
15791
|
* @returns a new #GError
|
|
15665
15792
|
*/
|
|
15666
|
-
static new_literal(domain: Quark, code: number, message: string
|
|
15793
|
+
static new_literal(domain: Quark, code: number, message: string): Error
|
|
15667
15794
|
|
|
15668
15795
|
// Owm static methods of GLib-2.0.GLib.Error
|
|
15669
15796
|
|
|
@@ -15989,7 +16116,7 @@ interface Hmac {
|
|
|
15989
16116
|
* The hexadecimal characters will be lower case.
|
|
15990
16117
|
* @returns the hexadecimal representation of the HMAC. The returned string is owned by the HMAC and should not be modified or freed.
|
|
15991
16118
|
*/
|
|
15992
|
-
get_string(): string
|
|
16119
|
+
get_string(): string
|
|
15993
16120
|
/**
|
|
15994
16121
|
* Atomically decrements the reference count of `hmac` by one.
|
|
15995
16122
|
*
|
|
@@ -16275,7 +16402,7 @@ interface IOChannel {
|
|
|
16275
16402
|
* makes the channel safe for binary data.
|
|
16276
16403
|
* @returns A string containing the encoding, this string is owned by GLib and must not be freed.
|
|
16277
16404
|
*/
|
|
16278
|
-
get_encoding(): string
|
|
16405
|
+
get_encoding(): string
|
|
16279
16406
|
/**
|
|
16280
16407
|
* Gets the current flags for a #GIOChannel, including read-only
|
|
16281
16408
|
* flags such as %G_IO_FLAG_IS_READABLE.
|
|
@@ -16295,7 +16422,7 @@ interface IOChannel {
|
|
|
16295
16422
|
* indicates autodetection.
|
|
16296
16423
|
* @returns The line termination string. This value is owned by GLib and must not be freed.
|
|
16297
16424
|
*/
|
|
16298
|
-
get_line_term(): [ /* returnType */ string
|
|
16425
|
+
get_line_term(): [ /* returnType */ string, /* length */ number ]
|
|
16299
16426
|
/**
|
|
16300
16427
|
* Initializes a #GIOChannel struct.
|
|
16301
16428
|
*
|
|
@@ -16480,7 +16607,7 @@ interface IOChannel {
|
|
|
16480
16607
|
* @param bytes_written the number of bytes actually written
|
|
16481
16608
|
* @returns %G_IO_ERROR_NONE if the operation was successful.
|
|
16482
16609
|
*/
|
|
16483
|
-
write(buf: string
|
|
16610
|
+
write(buf: string, count: number, bytes_written: number): IOError
|
|
16484
16611
|
/**
|
|
16485
16612
|
* Replacement for g_io_channel_write() with the new API.
|
|
16486
16613
|
*
|
|
@@ -16527,7 +16654,7 @@ class IOChannel {
|
|
|
16527
16654
|
* @param mode One of "r", "w", "a", "r+", "w+", "a+". These have the same meaning as in fopen()
|
|
16528
16655
|
* @returns A #GIOChannel on success, %NULL on failure.
|
|
16529
16656
|
*/
|
|
16530
|
-
static new_file(filename: string, mode: string
|
|
16657
|
+
static new_file(filename: string, mode: string): IOChannel
|
|
16531
16658
|
/**
|
|
16532
16659
|
* Creates a new #GIOChannel given a file descriptor. On UNIX systems
|
|
16533
16660
|
* this works for plain files, pipes, and sockets.
|
|
@@ -16570,7 +16697,7 @@ interface IOFuncs {
|
|
|
16570
16697
|
// Own fields of GLib-2.0.GLib.IOFuncs
|
|
16571
16698
|
|
|
16572
16699
|
io_read: (channel: IOChannel, buf: string | null, count: number, bytes_read: number) => IOStatus
|
|
16573
|
-
io_write: (channel: IOChannel, buf: string
|
|
16700
|
+
io_write: (channel: IOChannel, buf: string, count: number, bytes_written: number) => IOStatus
|
|
16574
16701
|
io_seek: (channel: IOChannel, offset: number, type: SeekType) => IOStatus
|
|
16575
16702
|
io_close: (channel: IOChannel) => IOStatus
|
|
16576
16703
|
io_create_watch: (channel: IOChannel, condition: IOCondition) => Source
|
|
@@ -16607,7 +16734,7 @@ interface KeyFile {
|
|
|
16607
16734
|
* @param key a key
|
|
16608
16735
|
* @returns the value associated with the key as a boolean, or %FALSE if the key was not found or could not be parsed.
|
|
16609
16736
|
*/
|
|
16610
|
-
get_boolean(group_name: string
|
|
16737
|
+
get_boolean(group_name: string, key: string): boolean
|
|
16611
16738
|
/**
|
|
16612
16739
|
* Returns the values associated with `key` under `group_name` as
|
|
16613
16740
|
* booleans.
|
|
@@ -16620,7 +16747,7 @@ interface KeyFile {
|
|
|
16620
16747
|
* @param key a key
|
|
16621
16748
|
* @returns the values associated with the key as a list of booleans, or %NULL if the key was not found or could not be parsed. The returned list of booleans should be freed with g_free() when no longer needed.
|
|
16622
16749
|
*/
|
|
16623
|
-
get_boolean_list(group_name: string
|
|
16750
|
+
get_boolean_list(group_name: string, key: string): boolean[]
|
|
16624
16751
|
/**
|
|
16625
16752
|
* Retrieves a comment above `key` from `group_name`.
|
|
16626
16753
|
* If `key` is %NULL then `comment` will be read from above
|
|
@@ -16647,7 +16774,7 @@ interface KeyFile {
|
|
|
16647
16774
|
* @param key a key
|
|
16648
16775
|
* @returns the value associated with the key as a double, or 0.0 if the key was not found or could not be parsed.
|
|
16649
16776
|
*/
|
|
16650
|
-
get_double(group_name: string
|
|
16777
|
+
get_double(group_name: string, key: string): number
|
|
16651
16778
|
/**
|
|
16652
16779
|
* Returns the values associated with `key` under `group_name` as
|
|
16653
16780
|
* doubles.
|
|
@@ -16660,7 +16787,7 @@ interface KeyFile {
|
|
|
16660
16787
|
* @param key a key
|
|
16661
16788
|
* @returns the values associated with the key as a list of doubles, or %NULL if the key was not found or could not be parsed. The returned list of doubles should be freed with g_free() when no longer needed.
|
|
16662
16789
|
*/
|
|
16663
|
-
get_double_list(group_name: string
|
|
16790
|
+
get_double_list(group_name: string, key: string): number[]
|
|
16664
16791
|
/**
|
|
16665
16792
|
* Returns all groups in the key file loaded with `key_file`.
|
|
16666
16793
|
* The array of returned groups will be %NULL-terminated, so
|
|
@@ -16676,7 +16803,7 @@ interface KeyFile {
|
|
|
16676
16803
|
* @param key a non-%NULL key
|
|
16677
16804
|
* @returns the value associated with the key as a signed 64-bit integer, or 0 if the key was not found or could not be parsed.
|
|
16678
16805
|
*/
|
|
16679
|
-
get_int64(group_name: string
|
|
16806
|
+
get_int64(group_name: string, key: string): number
|
|
16680
16807
|
/**
|
|
16681
16808
|
* Returns the value associated with `key` under `group_name` as an
|
|
16682
16809
|
* integer.
|
|
@@ -16690,7 +16817,7 @@ interface KeyFile {
|
|
|
16690
16817
|
* @param key a key
|
|
16691
16818
|
* @returns the value associated with the key as an integer, or 0 if the key was not found or could not be parsed.
|
|
16692
16819
|
*/
|
|
16693
|
-
get_integer(group_name: string
|
|
16820
|
+
get_integer(group_name: string, key: string): number
|
|
16694
16821
|
/**
|
|
16695
16822
|
* Returns the values associated with `key` under `group_name` as
|
|
16696
16823
|
* integers.
|
|
@@ -16704,7 +16831,7 @@ interface KeyFile {
|
|
|
16704
16831
|
* @param key a key
|
|
16705
16832
|
* @returns the values associated with the key as a list of integers, or %NULL if the key was not found or could not be parsed. The returned list of integers should be freed with g_free() when no longer needed.
|
|
16706
16833
|
*/
|
|
16707
|
-
get_integer_list(group_name: string
|
|
16834
|
+
get_integer_list(group_name: string, key: string): number[]
|
|
16708
16835
|
/**
|
|
16709
16836
|
* Returns all keys for the group name `group_name`. The array of
|
|
16710
16837
|
* returned keys will be %NULL-terminated, so `length` may
|
|
@@ -16714,7 +16841,7 @@ interface KeyFile {
|
|
|
16714
16841
|
* @param group_name a group name
|
|
16715
16842
|
* @returns a newly-allocated %NULL-terminated array of strings. Use g_strfreev() to free it.
|
|
16716
16843
|
*/
|
|
16717
|
-
get_keys(group_name: string
|
|
16844
|
+
get_keys(group_name: string): [ /* returnType */ string[], /* length */ number ]
|
|
16718
16845
|
/**
|
|
16719
16846
|
* Returns the actual locale which the result of
|
|
16720
16847
|
* g_key_file_get_locale_string() or g_key_file_get_locale_string_list()
|
|
@@ -16730,7 +16857,7 @@ interface KeyFile {
|
|
|
16730
16857
|
* @param locale a locale identifier or %NULL
|
|
16731
16858
|
* @returns the locale from the file, or %NULL if the key was not found or the entry in the file was was untranslated
|
|
16732
16859
|
*/
|
|
16733
|
-
get_locale_for_key(group_name: string
|
|
16860
|
+
get_locale_for_key(group_name: string, key: string, locale: string | null): string | null
|
|
16734
16861
|
/**
|
|
16735
16862
|
* Returns the value associated with `key` under `group_name`
|
|
16736
16863
|
* translated in the given `locale` if available. If `locale` is
|
|
@@ -16749,7 +16876,7 @@ interface KeyFile {
|
|
|
16749
16876
|
* @param locale a locale identifier or %NULL
|
|
16750
16877
|
* @returns a newly allocated string or %NULL if the specified key cannot be found.
|
|
16751
16878
|
*/
|
|
16752
|
-
get_locale_string(group_name: string
|
|
16879
|
+
get_locale_string(group_name: string, key: string, locale: string | null): string | null
|
|
16753
16880
|
/**
|
|
16754
16881
|
* Returns the values associated with `key` under `group_name`
|
|
16755
16882
|
* translated in the given `locale` if available. If `locale` is
|
|
@@ -16770,7 +16897,7 @@ interface KeyFile {
|
|
|
16770
16897
|
* @param locale a locale identifier or %NULL
|
|
16771
16898
|
* @returns a newly allocated %NULL-terminated string array or %NULL if the key isn't found. The string array should be freed with g_strfreev().
|
|
16772
16899
|
*/
|
|
16773
|
-
get_locale_string_list(group_name: string
|
|
16900
|
+
get_locale_string_list(group_name: string, key: string, locale: string | null): string[]
|
|
16774
16901
|
/**
|
|
16775
16902
|
* Returns the name of the start group of the file.
|
|
16776
16903
|
* @returns The start group of the key file.
|
|
@@ -16789,7 +16916,7 @@ interface KeyFile {
|
|
|
16789
16916
|
* @param key a key
|
|
16790
16917
|
* @returns a newly allocated string or %NULL if the specified key cannot be found.
|
|
16791
16918
|
*/
|
|
16792
|
-
get_string(group_name: string
|
|
16919
|
+
get_string(group_name: string, key: string): string | null
|
|
16793
16920
|
/**
|
|
16794
16921
|
* Returns the values associated with `key` under `group_name`.
|
|
16795
16922
|
*
|
|
@@ -16801,7 +16928,7 @@ interface KeyFile {
|
|
|
16801
16928
|
* @param key a key
|
|
16802
16929
|
* @returns a %NULL-terminated string array or %NULL if the specified key cannot be found. The array should be freed with g_strfreev().
|
|
16803
16930
|
*/
|
|
16804
|
-
get_string_list(group_name: string
|
|
16931
|
+
get_string_list(group_name: string, key: string): string[]
|
|
16805
16932
|
/**
|
|
16806
16933
|
* Returns the value associated with `key` under `group_name` as an unsigned
|
|
16807
16934
|
* 64-bit integer. This is similar to g_key_file_get_integer() but can return
|
|
@@ -16810,7 +16937,7 @@ interface KeyFile {
|
|
|
16810
16937
|
* @param key a non-%NULL key
|
|
16811
16938
|
* @returns the value associated with the key as an unsigned 64-bit integer, or 0 if the key was not found or could not be parsed.
|
|
16812
16939
|
*/
|
|
16813
|
-
get_uint64(group_name: string
|
|
16940
|
+
get_uint64(group_name: string, key: string): number
|
|
16814
16941
|
/**
|
|
16815
16942
|
* Returns the raw value associated with `key` under `group_name`.
|
|
16816
16943
|
* Use g_key_file_get_string() to retrieve an unescaped UTF-8 string.
|
|
@@ -16823,13 +16950,13 @@ interface KeyFile {
|
|
|
16823
16950
|
* @param key a key
|
|
16824
16951
|
* @returns a newly allocated string or %NULL if the specified key cannot be found.
|
|
16825
16952
|
*/
|
|
16826
|
-
get_value(group_name: string
|
|
16953
|
+
get_value(group_name: string, key: string): string | null
|
|
16827
16954
|
/**
|
|
16828
16955
|
* Looks whether the key file has the group `group_name`.
|
|
16829
16956
|
* @param group_name a group name
|
|
16830
16957
|
* @returns %TRUE if @group_name is a part of @key_file, %FALSE otherwise.
|
|
16831
16958
|
*/
|
|
16832
|
-
has_group(group_name: string
|
|
16959
|
+
has_group(group_name: string): boolean
|
|
16833
16960
|
/**
|
|
16834
16961
|
* Loads a key file from the data in `bytes` into an empty #GKeyFile structure.
|
|
16835
16962
|
* If the object cannot be created then %error is set to a #GKeyFileError.
|
|
@@ -16846,7 +16973,7 @@ interface KeyFile {
|
|
|
16846
16973
|
* @param flags flags from #GKeyFileFlags
|
|
16847
16974
|
* @returns %TRUE if a key file could be loaded, %FALSE otherwise
|
|
16848
16975
|
*/
|
|
16849
|
-
load_from_data(data: string
|
|
16976
|
+
load_from_data(data: string, length: number, flags: KeyFileFlags): boolean
|
|
16850
16977
|
/**
|
|
16851
16978
|
* This function looks for a key file named `file` in the paths
|
|
16852
16979
|
* returned from g_get_user_data_dir() and g_get_system_data_dirs(),
|
|
@@ -16904,14 +17031,14 @@ interface KeyFile {
|
|
|
16904
17031
|
* @param group_name a group name
|
|
16905
17032
|
* @returns %TRUE if the group was removed, %FALSE otherwise
|
|
16906
17033
|
*/
|
|
16907
|
-
remove_group(group_name: string
|
|
17034
|
+
remove_group(group_name: string): boolean
|
|
16908
17035
|
/**
|
|
16909
17036
|
* Removes `key` in `group_name` from the key file.
|
|
16910
17037
|
* @param group_name a group name
|
|
16911
17038
|
* @param key a key name to remove
|
|
16912
17039
|
* @returns %TRUE if the key was removed, %FALSE otherwise
|
|
16913
17040
|
*/
|
|
16914
|
-
remove_key(group_name: string
|
|
17041
|
+
remove_key(group_name: string, key: string): boolean
|
|
16915
17042
|
/**
|
|
16916
17043
|
* Writes the contents of `key_file` to `filename` using
|
|
16917
17044
|
* g_file_set_contents(). If you need stricter guarantees about durability of
|
|
@@ -16923,7 +17050,7 @@ interface KeyFile {
|
|
|
16923
17050
|
* @param filename the name of the file to write to
|
|
16924
17051
|
* @returns %TRUE if successful, else %FALSE with @error set
|
|
16925
17052
|
*/
|
|
16926
|
-
save_to_file(filename: string
|
|
17053
|
+
save_to_file(filename: string): boolean
|
|
16927
17054
|
/**
|
|
16928
17055
|
* Associates a new boolean value with `key` under `group_name`.
|
|
16929
17056
|
* If `key` cannot be found then it is created.
|
|
@@ -16931,7 +17058,7 @@ interface KeyFile {
|
|
|
16931
17058
|
* @param key a key
|
|
16932
17059
|
* @param value %TRUE or %FALSE
|
|
16933
17060
|
*/
|
|
16934
|
-
set_boolean(group_name: string
|
|
17061
|
+
set_boolean(group_name: string, key: string, value: boolean): void
|
|
16935
17062
|
/**
|
|
16936
17063
|
* Associates a list of boolean values with `key` under `group_name`.
|
|
16937
17064
|
* If `key` cannot be found then it is created.
|
|
@@ -16940,7 +17067,7 @@ interface KeyFile {
|
|
|
16940
17067
|
* @param key a key
|
|
16941
17068
|
* @param list an array of boolean values
|
|
16942
17069
|
*/
|
|
16943
|
-
set_boolean_list(group_name: string
|
|
17070
|
+
set_boolean_list(group_name: string, key: string, list: boolean[]): void
|
|
16944
17071
|
/**
|
|
16945
17072
|
* Places a comment above `key` from `group_name`.
|
|
16946
17073
|
*
|
|
@@ -16955,7 +17082,7 @@ interface KeyFile {
|
|
|
16955
17082
|
* @param comment a comment
|
|
16956
17083
|
* @returns %TRUE if the comment was written, %FALSE otherwise
|
|
16957
17084
|
*/
|
|
16958
|
-
set_comment(group_name: string | null, key: string | null, comment: string
|
|
17085
|
+
set_comment(group_name: string | null, key: string | null, comment: string): boolean
|
|
16959
17086
|
/**
|
|
16960
17087
|
* Associates a new double value with `key` under `group_name`.
|
|
16961
17088
|
* If `key` cannot be found then it is created.
|
|
@@ -16963,7 +17090,7 @@ interface KeyFile {
|
|
|
16963
17090
|
* @param key a key
|
|
16964
17091
|
* @param value a double value
|
|
16965
17092
|
*/
|
|
16966
|
-
set_double(group_name: string
|
|
17093
|
+
set_double(group_name: string, key: string, value: number): void
|
|
16967
17094
|
/**
|
|
16968
17095
|
* Associates a list of double values with `key` under
|
|
16969
17096
|
* `group_name`. If `key` cannot be found then it is created.
|
|
@@ -16971,7 +17098,7 @@ interface KeyFile {
|
|
|
16971
17098
|
* @param key a key
|
|
16972
17099
|
* @param list an array of double values
|
|
16973
17100
|
*/
|
|
16974
|
-
set_double_list(group_name: string
|
|
17101
|
+
set_double_list(group_name: string, key: string, list: number[]): void
|
|
16975
17102
|
/**
|
|
16976
17103
|
* Associates a new integer value with `key` under `group_name`.
|
|
16977
17104
|
* If `key` cannot be found then it is created.
|
|
@@ -16979,7 +17106,7 @@ interface KeyFile {
|
|
|
16979
17106
|
* @param key a key
|
|
16980
17107
|
* @param value an integer value
|
|
16981
17108
|
*/
|
|
16982
|
-
set_int64(group_name: string
|
|
17109
|
+
set_int64(group_name: string, key: string, value: number): void
|
|
16983
17110
|
/**
|
|
16984
17111
|
* Associates a new integer value with `key` under `group_name`.
|
|
16985
17112
|
* If `key` cannot be found then it is created.
|
|
@@ -16987,7 +17114,7 @@ interface KeyFile {
|
|
|
16987
17114
|
* @param key a key
|
|
16988
17115
|
* @param value an integer value
|
|
16989
17116
|
*/
|
|
16990
|
-
set_integer(group_name: string
|
|
17117
|
+
set_integer(group_name: string, key: string, value: number): void
|
|
16991
17118
|
/**
|
|
16992
17119
|
* Associates a list of integer values with `key` under `group_name`.
|
|
16993
17120
|
* If `key` cannot be found then it is created.
|
|
@@ -16995,7 +17122,7 @@ interface KeyFile {
|
|
|
16995
17122
|
* @param key a key
|
|
16996
17123
|
* @param list an array of integer values
|
|
16997
17124
|
*/
|
|
16998
|
-
set_integer_list(group_name: string
|
|
17125
|
+
set_integer_list(group_name: string, key: string, list: number[]): void
|
|
16999
17126
|
/**
|
|
17000
17127
|
* Sets the character which is used to separate
|
|
17001
17128
|
* values in lists. Typically ';' or ',' are used
|
|
@@ -17011,7 +17138,7 @@ interface KeyFile {
|
|
|
17011
17138
|
* @param locale a locale identifier
|
|
17012
17139
|
* @param string a string
|
|
17013
17140
|
*/
|
|
17014
|
-
set_locale_string(group_name: string
|
|
17141
|
+
set_locale_string(group_name: string, key: string, locale: string, string: string): void
|
|
17015
17142
|
/**
|
|
17016
17143
|
* Associates a list of string values for `key` and `locale` under
|
|
17017
17144
|
* `group_name`. If the translation for `key` cannot be found then
|
|
@@ -17021,7 +17148,7 @@ interface KeyFile {
|
|
|
17021
17148
|
* @param locale a locale identifier
|
|
17022
17149
|
* @param list a %NULL-terminated array of locale string values
|
|
17023
17150
|
*/
|
|
17024
|
-
set_locale_string_list(group_name: string
|
|
17151
|
+
set_locale_string_list(group_name: string, key: string, locale: string, list: string[]): void
|
|
17025
17152
|
/**
|
|
17026
17153
|
* Associates a new string value with `key` under `group_name`.
|
|
17027
17154
|
* If `key` cannot be found then it is created.
|
|
@@ -17032,7 +17159,7 @@ interface KeyFile {
|
|
|
17032
17159
|
* @param key a key
|
|
17033
17160
|
* @param string a string
|
|
17034
17161
|
*/
|
|
17035
|
-
set_string(group_name: string
|
|
17162
|
+
set_string(group_name: string, key: string, string: string): void
|
|
17036
17163
|
/**
|
|
17037
17164
|
* Associates a list of string values for `key` under `group_name`.
|
|
17038
17165
|
* If `key` cannot be found then it is created.
|
|
@@ -17041,7 +17168,7 @@ interface KeyFile {
|
|
|
17041
17168
|
* @param key a key
|
|
17042
17169
|
* @param list an array of string values
|
|
17043
17170
|
*/
|
|
17044
|
-
set_string_list(group_name: string
|
|
17171
|
+
set_string_list(group_name: string, key: string, list: string[]): void
|
|
17045
17172
|
/**
|
|
17046
17173
|
* Associates a new integer value with `key` under `group_name`.
|
|
17047
17174
|
* If `key` cannot be found then it is created.
|
|
@@ -17049,7 +17176,7 @@ interface KeyFile {
|
|
|
17049
17176
|
* @param key a key
|
|
17050
17177
|
* @param value an integer value
|
|
17051
17178
|
*/
|
|
17052
|
-
set_uint64(group_name: string
|
|
17179
|
+
set_uint64(group_name: string, key: string, value: number): void
|
|
17053
17180
|
/**
|
|
17054
17181
|
* Associates a new value with `key` under `group_name`.
|
|
17055
17182
|
*
|
|
@@ -17061,7 +17188,7 @@ interface KeyFile {
|
|
|
17061
17188
|
* @param key a key
|
|
17062
17189
|
* @param value a string
|
|
17063
17190
|
*/
|
|
17064
|
-
set_value(group_name: string
|
|
17191
|
+
set_value(group_name: string, key: string, value: string): void
|
|
17065
17192
|
/**
|
|
17066
17193
|
* This function outputs `key_file` as a string.
|
|
17067
17194
|
*
|
|
@@ -17078,8 +17205,146 @@ interface KeyFile {
|
|
|
17078
17205
|
}
|
|
17079
17206
|
|
|
17080
17207
|
/**
|
|
17081
|
-
*
|
|
17082
|
-
*
|
|
17208
|
+
* #GKeyFile lets you parse, edit or create files containing groups of
|
|
17209
|
+
* key-value pairs, which we call "key files" for lack of a better name.
|
|
17210
|
+
* Several freedesktop.org specifications use key files now, e.g the
|
|
17211
|
+
* [Desktop Entry Specification](http://freedesktop.org/Standards/desktop-entry-spec)
|
|
17212
|
+
* and the
|
|
17213
|
+
* [Icon Theme Specification](http://freedesktop.org/Standards/icon-theme-spec).
|
|
17214
|
+
*
|
|
17215
|
+
* The syntax of key files is described in detail in the
|
|
17216
|
+
* [Desktop Entry Specification](http://freedesktop.org/Standards/desktop-entry-spec),
|
|
17217
|
+
* here is a quick summary: Key files
|
|
17218
|
+
* consists of groups of key-value pairs, interspersed with comments.
|
|
17219
|
+
*
|
|
17220
|
+
*
|
|
17221
|
+
* ```
|
|
17222
|
+
* # this is just an example
|
|
17223
|
+
* # there can be comments before the first group
|
|
17224
|
+
*
|
|
17225
|
+
* [First Group]
|
|
17226
|
+
*
|
|
17227
|
+
* Name=Key File Example\tthis value shows\nescaping
|
|
17228
|
+
*
|
|
17229
|
+
* # localized strings are stored in multiple key-value pairs
|
|
17230
|
+
* Welcome=Hello
|
|
17231
|
+
* Welcome[de]=Hallo
|
|
17232
|
+
* Welcome[fr_FR]=Bonjour
|
|
17233
|
+
* Welcome[it]=Ciao
|
|
17234
|
+
* Welcome[be`latin]`=Hello
|
|
17235
|
+
*
|
|
17236
|
+
* [Another Group]
|
|
17237
|
+
*
|
|
17238
|
+
* Numbers=2;20;-200;0
|
|
17239
|
+
*
|
|
17240
|
+
* Booleans=true;false;true;true
|
|
17241
|
+
* ```
|
|
17242
|
+
*
|
|
17243
|
+
*
|
|
17244
|
+
* Lines beginning with a '#' and blank lines are considered comments.
|
|
17245
|
+
*
|
|
17246
|
+
* Groups are started by a header line containing the group name enclosed
|
|
17247
|
+
* in '[' and ']', and ended implicitly by the start of the next group or
|
|
17248
|
+
* the end of the file. Each key-value pair must be contained in a group.
|
|
17249
|
+
*
|
|
17250
|
+
* Key-value pairs generally have the form `key=value`, with the
|
|
17251
|
+
* exception of localized strings, which have the form
|
|
17252
|
+
* `key[locale]=value`, with a locale identifier of the
|
|
17253
|
+
* form `lang_COUNTRY`MODIFIER`` where `COUNTRY` and `MODIFIER`
|
|
17254
|
+
* are optional.
|
|
17255
|
+
* Space before and after the '=' character are ignored. Newline, tab,
|
|
17256
|
+
* carriage return and backslash characters in value are escaped as \n,
|
|
17257
|
+
* \t, \r, and \\\\, respectively. To preserve leading spaces in values,
|
|
17258
|
+
* these can also be escaped as \s.
|
|
17259
|
+
*
|
|
17260
|
+
* Key files can store strings (possibly with localized variants), integers,
|
|
17261
|
+
* booleans and lists of these. Lists are separated by a separator character,
|
|
17262
|
+
* typically ';' or ','. To use the list separator character in a value in
|
|
17263
|
+
* a list, it has to be escaped by prefixing it with a backslash.
|
|
17264
|
+
*
|
|
17265
|
+
* This syntax is obviously inspired by the .ini files commonly met
|
|
17266
|
+
* on Windows, but there are some important differences:
|
|
17267
|
+
*
|
|
17268
|
+
* - .ini files use the ';' character to begin comments,
|
|
17269
|
+
* key files use the '#' character.
|
|
17270
|
+
*
|
|
17271
|
+
* - Key files do not allow for ungrouped keys meaning only
|
|
17272
|
+
* comments can precede the first group.
|
|
17273
|
+
*
|
|
17274
|
+
* - Key files are always encoded in UTF-8.
|
|
17275
|
+
*
|
|
17276
|
+
* - Key and Group names are case-sensitive. For example, a group called
|
|
17277
|
+
* [GROUP] is a different from [group].
|
|
17278
|
+
*
|
|
17279
|
+
* - .ini files don't have a strongly typed boolean entry type,
|
|
17280
|
+
* they only have GetProfileInt(). In key files, only
|
|
17281
|
+
* true and false (in lower case) are allowed.
|
|
17282
|
+
*
|
|
17283
|
+
* Note that in contrast to the
|
|
17284
|
+
* [Desktop Entry Specification](http://freedesktop.org/Standards/desktop-entry-spec),
|
|
17285
|
+
* groups in key files may contain the same
|
|
17286
|
+
* key multiple times; the last entry wins. Key files may also contain
|
|
17287
|
+
* multiple groups with the same name; they are merged together.
|
|
17288
|
+
* Another difference is that keys and group names in key files are not
|
|
17289
|
+
* restricted to ASCII characters.
|
|
17290
|
+
*
|
|
17291
|
+
* Here is an example of loading a key file and reading a value:
|
|
17292
|
+
*
|
|
17293
|
+
*
|
|
17294
|
+
* ```c
|
|
17295
|
+
* g_autoptr(GError) error = NULL;
|
|
17296
|
+
* g_autoptr(GKeyFile) key_file = g_key_file_new ();
|
|
17297
|
+
*
|
|
17298
|
+
* if (!g_key_file_load_from_file (key_file, "key-file.ini", flags, &error))
|
|
17299
|
+
* {
|
|
17300
|
+
* if (!g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
|
|
17301
|
+
* g_warning ("Error loading key file: %s", error->message);
|
|
17302
|
+
* return;
|
|
17303
|
+
* }
|
|
17304
|
+
*
|
|
17305
|
+
* g_autofree gchar *val = g_key_file_get_string (key_file, "Group Name", "SomeKey", &error);
|
|
17306
|
+
* if (val == NULL &&
|
|
17307
|
+
* !g_error_matches (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND))
|
|
17308
|
+
* {
|
|
17309
|
+
* g_warning ("Error finding key in key file: %s", error->message);
|
|
17310
|
+
* return;
|
|
17311
|
+
* }
|
|
17312
|
+
* else if (val == NULL)
|
|
17313
|
+
* {
|
|
17314
|
+
* // Fall back to a default value.
|
|
17315
|
+
* val = g_strdup ("default-value");
|
|
17316
|
+
* }
|
|
17317
|
+
* ```
|
|
17318
|
+
*
|
|
17319
|
+
*
|
|
17320
|
+
* Here is an example of creating and saving a key file:
|
|
17321
|
+
*
|
|
17322
|
+
*
|
|
17323
|
+
* ```c
|
|
17324
|
+
* g_autoptr(GKeyFile) key_file = g_key_file_new ();
|
|
17325
|
+
* const gchar *val = …;
|
|
17326
|
+
* g_autoptr(GError) error = NULL;
|
|
17327
|
+
*
|
|
17328
|
+
* g_key_file_set_string (key_file, "Group Name", "SomeKey", val);
|
|
17329
|
+
*
|
|
17330
|
+
* // Save as a file.
|
|
17331
|
+
* if (!g_key_file_save_to_file (key_file, "key-file.ini", &error))
|
|
17332
|
+
* {
|
|
17333
|
+
* g_warning ("Error saving key file: %s", error->message);
|
|
17334
|
+
* return;
|
|
17335
|
+
* }
|
|
17336
|
+
*
|
|
17337
|
+
* // Or store to a GBytes for use elsewhere.
|
|
17338
|
+
* gsize data_len;
|
|
17339
|
+
* g_autofree guint8 *data = (guint8 *) g_key_file_to_data (key_file, &data_len, &error);
|
|
17340
|
+
* if (data == NULL)
|
|
17341
|
+
* {
|
|
17342
|
+
* g_warning ("Error saving key file: %s", error->message);
|
|
17343
|
+
* return;
|
|
17344
|
+
* }
|
|
17345
|
+
* g_autoptr(GBytes) bytes = g_bytes_new_take (g_steal_pointer (&data), data_len);
|
|
17346
|
+
* ```
|
|
17347
|
+
*
|
|
17083
17348
|
* @record
|
|
17084
17349
|
*/
|
|
17085
17350
|
class KeyFile {
|
|
@@ -17153,7 +17418,7 @@ interface LogField {
|
|
|
17153
17418
|
* field name (UTF-8 string)
|
|
17154
17419
|
* @field
|
|
17155
17420
|
*/
|
|
17156
|
-
key: string
|
|
17421
|
+
key: string
|
|
17157
17422
|
/**
|
|
17158
17423
|
* field value (arbitrary bytes)
|
|
17159
17424
|
* @field
|
|
@@ -17197,7 +17462,7 @@ interface MainContext {
|
|
|
17197
17462
|
*
|
|
17198
17463
|
* You must be the owner of a context before you
|
|
17199
17464
|
* can call g_main_context_prepare(), g_main_context_query(),
|
|
17200
|
-
* g_main_context_check(), g_main_context_dispatch().
|
|
17465
|
+
* g_main_context_check(), g_main_context_dispatch(), g_main_context_release().
|
|
17201
17466
|
*
|
|
17202
17467
|
* Since 2.76 `context` can be %NULL to use the global-default
|
|
17203
17468
|
* main context.
|
|
@@ -17393,6 +17658,9 @@ interface MainContext {
|
|
|
17393
17658
|
* with g_main_context_acquire(). If the context was acquired multiple
|
|
17394
17659
|
* times, the ownership will be released only when g_main_context_release()
|
|
17395
17660
|
* is called as many times as it was acquired.
|
|
17661
|
+
*
|
|
17662
|
+
* You must have successfully acquired the context with
|
|
17663
|
+
* g_main_context_acquire() before you may call this function.
|
|
17396
17664
|
*/
|
|
17397
17665
|
release(): void
|
|
17398
17666
|
/**
|
|
@@ -17560,11 +17828,16 @@ interface MainLoop {
|
|
|
17560
17828
|
* the result is zero, free the loop and free all associated memory.
|
|
17561
17829
|
*/
|
|
17562
17830
|
unref(): void
|
|
17831
|
+
/**
|
|
17832
|
+
* Similar to `GLib.MainLoop.run` but return a Promise which resolves when the main loop ends, instead of blocking while the main loop runs.
|
|
17833
|
+
* This helps avoid the situation where Promises never resolved if you didn't run the main loop inside a callback.
|
|
17834
|
+
*/
|
|
17835
|
+
runAsync(): Promise<void>
|
|
17563
17836
|
}
|
|
17564
17837
|
|
|
17565
17838
|
/**
|
|
17566
17839
|
* The `GMainLoop` struct is an opaque data type
|
|
17567
|
-
* representing the main event loop of a GLib or GTK
|
|
17840
|
+
* representing the main event loop of a GLib or GTK application.
|
|
17568
17841
|
* @record
|
|
17569
17842
|
*/
|
|
17570
17843
|
class MainLoop {
|
|
@@ -17749,7 +18022,7 @@ interface MarkupParseContext {
|
|
|
17749
18022
|
* elements, see g_markup_parse_context_get_element_stack().
|
|
17750
18023
|
* @returns the name of the currently open element, or %NULL
|
|
17751
18024
|
*/
|
|
17752
|
-
get_element(): string
|
|
18025
|
+
get_element(): string
|
|
17753
18026
|
/**
|
|
17754
18027
|
* Retrieves the current line number and the number of the character on
|
|
17755
18028
|
* that line. Intended for use in error messages; there are no strict
|
|
@@ -17781,7 +18054,7 @@ interface MarkupParseContext {
|
|
|
17781
18054
|
* @param text_len length of `text` in bytes
|
|
17782
18055
|
* @returns %FALSE if an error occurred, %TRUE on success
|
|
17783
18056
|
*/
|
|
17784
|
-
parse(text: string
|
|
18057
|
+
parse(text: string, text_len: number): boolean
|
|
17785
18058
|
/**
|
|
17786
18059
|
* Completes the process of a temporary sub-parser redirection.
|
|
17787
18060
|
*
|
|
@@ -17986,10 +18259,10 @@ interface MarkupParser {
|
|
|
17986
18259
|
|
|
17987
18260
|
// Own fields of GLib-2.0.GLib.MarkupParser
|
|
17988
18261
|
|
|
17989
|
-
start_element: (context: MarkupParseContext, element_name: string
|
|
17990
|
-
end_element: (context: MarkupParseContext, element_name: string
|
|
17991
|
-
text: (context: MarkupParseContext, text: string
|
|
17992
|
-
passthrough: (context: MarkupParseContext, passthrough_text: string
|
|
18262
|
+
start_element: (context: MarkupParseContext, element_name: string, attribute_names: string, attribute_values: string) => void
|
|
18263
|
+
end_element: (context: MarkupParseContext, element_name: string) => void
|
|
18264
|
+
text: (context: MarkupParseContext, text: string, text_len: number) => void
|
|
18265
|
+
passthrough: (context: MarkupParseContext, passthrough_text: string, text_len: number) => void
|
|
17993
18266
|
error: (context: MarkupParseContext, error: Error) => void
|
|
17994
18267
|
}
|
|
17995
18268
|
|
|
@@ -18035,7 +18308,7 @@ interface MatchInfo {
|
|
|
18035
18308
|
* @param string_to_expand the string to expand
|
|
18036
18309
|
* @returns the expanded string, or %NULL if an error occurred
|
|
18037
18310
|
*/
|
|
18038
|
-
expand_references(string_to_expand: string
|
|
18311
|
+
expand_references(string_to_expand: string): string | null
|
|
18039
18312
|
/**
|
|
18040
18313
|
* Retrieves the text matching the `match_num'`th capturing
|
|
18041
18314
|
* parentheses. 0 is the full text of the match, 1 is the first paren
|
|
@@ -18089,7 +18362,7 @@ interface MatchInfo {
|
|
|
18089
18362
|
* @param name name of the subexpression
|
|
18090
18363
|
* @returns The matched substring, or %NULL if an error occurred. You have to free the string yourself
|
|
18091
18364
|
*/
|
|
18092
|
-
fetch_named(name: string
|
|
18365
|
+
fetch_named(name: string): string | null
|
|
18093
18366
|
/**
|
|
18094
18367
|
* Retrieves the position in bytes of the capturing parentheses named `name`.
|
|
18095
18368
|
*
|
|
@@ -18099,7 +18372,7 @@ interface MatchInfo {
|
|
|
18099
18372
|
* @param name name of the subexpression
|
|
18100
18373
|
* @returns %TRUE if the position was fetched, %FALSE otherwise. If the position cannot be fetched, @start_pos and @end_pos are left unchanged.
|
|
18101
18374
|
*/
|
|
18102
|
-
fetch_named_pos(name: string
|
|
18375
|
+
fetch_named_pos(name: string): [ /* returnType */ boolean, /* start_pos */ number, /* end_pos */ number ]
|
|
18103
18376
|
/**
|
|
18104
18377
|
* Retrieves the position in bytes of the `match_num'`th capturing
|
|
18105
18378
|
* parentheses. 0 is the full text of the match, 1 is the first
|
|
@@ -18148,7 +18421,7 @@ interface MatchInfo {
|
|
|
18148
18421
|
* you may not free it before calling this function.
|
|
18149
18422
|
* @returns the string searched with @match_info
|
|
18150
18423
|
*/
|
|
18151
|
-
get_string(): string
|
|
18424
|
+
get_string(): string
|
|
18152
18425
|
/**
|
|
18153
18426
|
* Usually if the string passed to g_regex_match*() matches as far as
|
|
18154
18427
|
* it goes, but is too short to match the entire pattern, %FALSE is
|
|
@@ -18474,7 +18747,7 @@ interface OptionContext {
|
|
|
18474
18747
|
* Returns the description. See g_option_context_set_description().
|
|
18475
18748
|
* @returns the description
|
|
18476
18749
|
*/
|
|
18477
|
-
get_description(): string
|
|
18750
|
+
get_description(): string
|
|
18478
18751
|
/**
|
|
18479
18752
|
* Returns a formatted, translated help text for the given context.
|
|
18480
18753
|
* To obtain the text produced by `--help`, call
|
|
@@ -18516,7 +18789,7 @@ interface OptionContext {
|
|
|
18516
18789
|
* Returns the summary. See g_option_context_set_summary().
|
|
18517
18790
|
* @returns the summary
|
|
18518
18791
|
*/
|
|
18519
|
-
get_summary(): string
|
|
18792
|
+
get_summary(): string
|
|
18520
18793
|
/**
|
|
18521
18794
|
* Parses the command line arguments, recognizing options
|
|
18522
18795
|
* which have been added to `context`. A side-effect of
|
|
@@ -18658,13 +18931,169 @@ interface OptionContext {
|
|
|
18658
18931
|
* user-visible strings.
|
|
18659
18932
|
* @param domain the domain to use
|
|
18660
18933
|
*/
|
|
18661
|
-
set_translation_domain(domain: string
|
|
18934
|
+
set_translation_domain(domain: string): void
|
|
18662
18935
|
}
|
|
18663
18936
|
|
|
18664
18937
|
/**
|
|
18665
|
-
*
|
|
18666
|
-
*
|
|
18667
|
-
*
|
|
18938
|
+
* The GOption commandline parser is intended to be a simpler replacement
|
|
18939
|
+
* for the popt library. It supports short and long commandline options,
|
|
18940
|
+
* as shown in the following example:
|
|
18941
|
+
*
|
|
18942
|
+
* `testtreemodel -r 1 --max-size 20 --rand --display=:1.0 -vb -- file1 file2`
|
|
18943
|
+
*
|
|
18944
|
+
* The example demonstrates a number of features of the GOption
|
|
18945
|
+
* commandline parser:
|
|
18946
|
+
*
|
|
18947
|
+
* - Options can be single letters, prefixed by a single dash.
|
|
18948
|
+
*
|
|
18949
|
+
* - Multiple short options can be grouped behind a single dash.
|
|
18950
|
+
*
|
|
18951
|
+
* - Long options are prefixed by two consecutive dashes.
|
|
18952
|
+
*
|
|
18953
|
+
* - Options can have an extra argument, which can be a number, a string or
|
|
18954
|
+
* a filename. For long options, the extra argument can be appended with
|
|
18955
|
+
* an equals sign after the option name, which is useful if the extra
|
|
18956
|
+
* argument starts with a dash, which would otherwise cause it to be
|
|
18957
|
+
* interpreted as another option.
|
|
18958
|
+
*
|
|
18959
|
+
* - Non-option arguments are returned to the application as rest arguments.
|
|
18960
|
+
*
|
|
18961
|
+
* - An argument consisting solely of two dashes turns off further parsing,
|
|
18962
|
+
* any remaining arguments (even those starting with a dash) are returned
|
|
18963
|
+
* to the application as rest arguments.
|
|
18964
|
+
*
|
|
18965
|
+
* Another important feature of GOption is that it can automatically
|
|
18966
|
+
* generate nicely formatted help output. Unless it is explicitly turned
|
|
18967
|
+
* off with g_option_context_set_help_enabled(), GOption will recognize
|
|
18968
|
+
* the `--help`, `-?`, `--help-all` and `--help-groupname` options
|
|
18969
|
+
* (where `groupname` is the name of a #GOptionGroup) and write a text
|
|
18970
|
+
* similar to the one shown in the following example to stdout.
|
|
18971
|
+
*
|
|
18972
|
+
*
|
|
18973
|
+
* ```
|
|
18974
|
+
* Usage:
|
|
18975
|
+
* testtreemodel [OPTION...] - test tree model performance
|
|
18976
|
+
*
|
|
18977
|
+
* Help Options:
|
|
18978
|
+
* -h, --help Show help options
|
|
18979
|
+
* --help-all Show all help options
|
|
18980
|
+
* --help-gtk Show GTK Options
|
|
18981
|
+
*
|
|
18982
|
+
* Application Options:
|
|
18983
|
+
* -r, --repeats=N Average over N repetitions
|
|
18984
|
+
* -m, --max-size=M Test up to 2^M items
|
|
18985
|
+
* --display=DISPLAY X display to use
|
|
18986
|
+
* -v, --verbose Be verbose
|
|
18987
|
+
* -b, --beep Beep when done
|
|
18988
|
+
* --rand Randomize the data
|
|
18989
|
+
* ```
|
|
18990
|
+
*
|
|
18991
|
+
*
|
|
18992
|
+
* GOption groups options in #GOptionGroups, which makes it easy to
|
|
18993
|
+
* incorporate options from multiple sources. The intended use for this is
|
|
18994
|
+
* to let applications collect option groups from the libraries it uses,
|
|
18995
|
+
* add them to their #GOptionContext, and parse all options by a single call
|
|
18996
|
+
* to g_option_context_parse(). See gtk_get_option_group() for an example.
|
|
18997
|
+
*
|
|
18998
|
+
* If an option is declared to be of type string or filename, GOption takes
|
|
18999
|
+
* care of converting it to the right encoding; strings are returned in
|
|
19000
|
+
* UTF-8, filenames are returned in the GLib filename encoding. Note that
|
|
19001
|
+
* this only works if setlocale() has been called before
|
|
19002
|
+
* g_option_context_parse().
|
|
19003
|
+
*
|
|
19004
|
+
* Here is a complete example of setting up GOption to parse the example
|
|
19005
|
+
* commandline above and produce the example help output.
|
|
19006
|
+
*
|
|
19007
|
+
* ```c
|
|
19008
|
+
* static gint repeats = 2;
|
|
19009
|
+
* static gint max_size = 8;
|
|
19010
|
+
* static gboolean verbose = FALSE;
|
|
19011
|
+
* static gboolean beep = FALSE;
|
|
19012
|
+
* static gboolean randomize = FALSE;
|
|
19013
|
+
*
|
|
19014
|
+
* static GOptionEntry entries[] =
|
|
19015
|
+
* {
|
|
19016
|
+
* { "repeats", 'r', 0, G_OPTION_ARG_INT, &repeats, "Average over N repetitions", "N" },
|
|
19017
|
+
* { "max-size", 'm', 0, G_OPTION_ARG_INT, &max_size, "Test up to 2^M items", "M" },
|
|
19018
|
+
* { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "Be verbose", NULL },
|
|
19019
|
+
* { "beep", 'b', 0, G_OPTION_ARG_NONE, &beep, "Beep when done", NULL },
|
|
19020
|
+
* { "rand", 0, 0, G_OPTION_ARG_NONE, &randomize, "Randomize the data", NULL },
|
|
19021
|
+
* G_OPTION_ENTRY_NULL
|
|
19022
|
+
* };
|
|
19023
|
+
*
|
|
19024
|
+
* int
|
|
19025
|
+
* main (int argc, char *argv[])
|
|
19026
|
+
* {
|
|
19027
|
+
* GError *error = NULL;
|
|
19028
|
+
* GOptionContext *context;
|
|
19029
|
+
*
|
|
19030
|
+
* context = g_option_context_new ("- test tree model performance");
|
|
19031
|
+
* g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
|
|
19032
|
+
* g_option_context_add_group (context, gtk_get_option_group (TRUE));
|
|
19033
|
+
* if (!g_option_context_parse (context, &argc, &argv, &error))
|
|
19034
|
+
* {
|
|
19035
|
+
* g_print ("option parsing failed: %s\n", error->message);
|
|
19036
|
+
* exit (1);
|
|
19037
|
+
* }
|
|
19038
|
+
*
|
|
19039
|
+
* ...
|
|
19040
|
+
*
|
|
19041
|
+
* }
|
|
19042
|
+
* ```
|
|
19043
|
+
*
|
|
19044
|
+
*
|
|
19045
|
+
* On UNIX systems, the argv that is passed to main() has no particular
|
|
19046
|
+
* encoding, even to the extent that different parts of it may have
|
|
19047
|
+
* different encodings. In general, normal arguments and flags will be
|
|
19048
|
+
* in the current locale and filenames should be considered to be opaque
|
|
19049
|
+
* byte strings. Proper use of %G_OPTION_ARG_FILENAME vs
|
|
19050
|
+
* %G_OPTION_ARG_STRING is therefore important.
|
|
19051
|
+
*
|
|
19052
|
+
* Note that on Windows, filenames do have an encoding, but using
|
|
19053
|
+
* #GOptionContext with the argv as passed to main() will result in a
|
|
19054
|
+
* program that can only accept commandline arguments with characters
|
|
19055
|
+
* from the system codepage. This can cause problems when attempting to
|
|
19056
|
+
* deal with filenames containing Unicode characters that fall outside
|
|
19057
|
+
* of the codepage.
|
|
19058
|
+
*
|
|
19059
|
+
* A solution to this is to use g_win32_get_command_line() and
|
|
19060
|
+
* g_option_context_parse_strv() which will properly handle full Unicode
|
|
19061
|
+
* filenames. If you are using #GApplication, this is done
|
|
19062
|
+
* automatically for you.
|
|
19063
|
+
*
|
|
19064
|
+
* The following example shows how you can use #GOptionContext directly
|
|
19065
|
+
* in order to correctly deal with Unicode filenames on Windows:
|
|
19066
|
+
*
|
|
19067
|
+
*
|
|
19068
|
+
* ```c
|
|
19069
|
+
* int
|
|
19070
|
+
* main (int argc, char **argv)
|
|
19071
|
+
* {
|
|
19072
|
+
* GError *error = NULL;
|
|
19073
|
+
* GOptionContext *context;
|
|
19074
|
+
* gchar **args;
|
|
19075
|
+
*
|
|
19076
|
+
* #ifdef G_OS_WIN32
|
|
19077
|
+
* args = g_win32_get_command_line ();
|
|
19078
|
+
* #else
|
|
19079
|
+
* args = g_strdupv (argv);
|
|
19080
|
+
* #endif
|
|
19081
|
+
*
|
|
19082
|
+
* // set up context
|
|
19083
|
+
*
|
|
19084
|
+
* if (!g_option_context_parse_strv (context, &args, &error))
|
|
19085
|
+
* {
|
|
19086
|
+
* // error happened
|
|
19087
|
+
* }
|
|
19088
|
+
*
|
|
19089
|
+
* ...
|
|
19090
|
+
*
|
|
19091
|
+
* g_strfreev (args);
|
|
19092
|
+
*
|
|
19093
|
+
* ...
|
|
19094
|
+
* }
|
|
19095
|
+
* ```
|
|
19096
|
+
*
|
|
18668
19097
|
* @record
|
|
18669
19098
|
*/
|
|
18670
19099
|
class OptionContext {
|
|
@@ -18686,7 +19115,7 @@ interface OptionEntry {
|
|
|
18686
19115
|
* `--groupname-long_name`.
|
|
18687
19116
|
* @field
|
|
18688
19117
|
*/
|
|
18689
|
-
long_name: string
|
|
19118
|
+
long_name: string
|
|
18690
19119
|
/**
|
|
18691
19120
|
* If an option has a short name, it can be specified
|
|
18692
19121
|
* `-short_name` in a commandline. `short_name` must be a printable
|
|
@@ -18732,7 +19161,7 @@ interface OptionEntry {
|
|
|
18732
19161
|
* of the group, see g_option_group_set_translation_domain().
|
|
18733
19162
|
* @field
|
|
18734
19163
|
*/
|
|
18735
|
-
description: string
|
|
19164
|
+
description: string
|
|
18736
19165
|
/**
|
|
18737
19166
|
* The placeholder to use for the extra argument parsed
|
|
18738
19167
|
* by the option in `--help` output. The `arg_description` is translated
|
|
@@ -18740,7 +19169,7 @@ interface OptionEntry {
|
|
|
18740
19169
|
* g_option_group_set_translation_domain().
|
|
18741
19170
|
* @field
|
|
18742
19171
|
*/
|
|
18743
|
-
arg_description: string
|
|
19172
|
+
arg_description: string
|
|
18744
19173
|
}
|
|
18745
19174
|
|
|
18746
19175
|
/**
|
|
@@ -18790,7 +19219,7 @@ interface OptionGroup {
|
|
|
18790
19219
|
* user-visible strings.
|
|
18791
19220
|
* @param domain the domain to use
|
|
18792
19221
|
*/
|
|
18793
|
-
set_translation_domain(domain: string
|
|
19222
|
+
set_translation_domain(domain: string): void
|
|
18794
19223
|
/**
|
|
18795
19224
|
* Decrements the reference count of `group` by one.
|
|
18796
19225
|
* If the reference count drops to 0, the `group` will be freed.
|
|
@@ -18827,7 +19256,7 @@ class OptionGroup {
|
|
|
18827
19256
|
* @param destroy a function that will be called to free `user_data,` or %NULL
|
|
18828
19257
|
* @returns a newly created option group. It should be added to a #GOptionContext or freed with g_option_group_unref().
|
|
18829
19258
|
*/
|
|
18830
|
-
constructor(name: string
|
|
19259
|
+
constructor(name: string, description: string, help_description: string, user_data: any | null, destroy: DestroyNotify | null)
|
|
18831
19260
|
/**
|
|
18832
19261
|
* Creates a new #GOptionGroup.
|
|
18833
19262
|
* @constructor
|
|
@@ -18838,7 +19267,7 @@ class OptionGroup {
|
|
|
18838
19267
|
* @param destroy a function that will be called to free `user_data,` or %NULL
|
|
18839
19268
|
* @returns a newly created option group. It should be added to a #GOptionContext or freed with g_option_group_unref().
|
|
18840
19269
|
*/
|
|
18841
|
-
static new(name: string
|
|
19270
|
+
static new(name: string, description: string, help_description: string, user_data: any | null, destroy: DestroyNotify | null): OptionGroup
|
|
18842
19271
|
}
|
|
18843
19272
|
|
|
18844
19273
|
interface PathBuf {
|
|
@@ -19117,7 +19546,7 @@ interface PatternSpec {
|
|
|
19117
19546
|
* @param string_reversed the reverse of `string` or %NULL
|
|
19118
19547
|
* @returns %TRUE if @string matches @pspec
|
|
19119
19548
|
*/
|
|
19120
|
-
match(string_length: number, string: string
|
|
19549
|
+
match(string_length: number, string: string, string_reversed: string | null): boolean
|
|
19121
19550
|
/**
|
|
19122
19551
|
* Matches a string against a compiled pattern. If the string is to be
|
|
19123
19552
|
* matched against more than one pattern, consider using
|
|
@@ -19125,7 +19554,7 @@ interface PatternSpec {
|
|
|
19125
19554
|
* @param string the UTF-8 encoded string to match
|
|
19126
19555
|
* @returns %TRUE if @string matches @pspec
|
|
19127
19556
|
*/
|
|
19128
|
-
match_string(string: string
|
|
19557
|
+
match_string(string: string): boolean
|
|
19129
19558
|
}
|
|
19130
19559
|
|
|
19131
19560
|
/**
|
|
@@ -19147,14 +19576,14 @@ class PatternSpec {
|
|
|
19147
19576
|
* @param pattern a zero-terminated UTF-8 encoded string
|
|
19148
19577
|
* @returns a newly-allocated #GPatternSpec
|
|
19149
19578
|
*/
|
|
19150
|
-
constructor(pattern: string
|
|
19579
|
+
constructor(pattern: string)
|
|
19151
19580
|
/**
|
|
19152
19581
|
* Compiles a pattern to a #GPatternSpec.
|
|
19153
19582
|
* @constructor
|
|
19154
19583
|
* @param pattern a zero-terminated UTF-8 encoded string
|
|
19155
19584
|
* @returns a newly-allocated #GPatternSpec
|
|
19156
19585
|
*/
|
|
19157
|
-
static new(pattern: string
|
|
19586
|
+
static new(pattern: string): PatternSpec
|
|
19158
19587
|
}
|
|
19159
19588
|
|
|
19160
19589
|
interface PollFD {
|
|
@@ -19818,13 +20247,13 @@ interface Regex {
|
|
|
19818
20247
|
* the string passed to g_regex_new().
|
|
19819
20248
|
* @returns the pattern of @regex
|
|
19820
20249
|
*/
|
|
19821
|
-
get_pattern(): string
|
|
20250
|
+
get_pattern(): string
|
|
19822
20251
|
/**
|
|
19823
20252
|
* Retrieves the number of the subexpression named `name`.
|
|
19824
20253
|
* @param name name of the subexpression
|
|
19825
20254
|
* @returns The number of the subexpression or -1 if @name does not exists
|
|
19826
20255
|
*/
|
|
19827
|
-
get_string_number(name: string
|
|
20256
|
+
get_string_number(name: string): number
|
|
19828
20257
|
/**
|
|
19829
20258
|
* Scans for a match in `string` for the pattern in `regex`.
|
|
19830
20259
|
* The `match_options` are combined with the match options specified
|
|
@@ -19872,7 +20301,7 @@ interface Regex {
|
|
|
19872
20301
|
* @param match_options match options
|
|
19873
20302
|
* @returns %TRUE is the string matched, %FALSE otherwise
|
|
19874
20303
|
*/
|
|
19875
|
-
match(string: string
|
|
20304
|
+
match(string: string, match_options: RegexMatchFlags): [ /* returnType */ boolean, /* match_info */ MatchInfo ]
|
|
19876
20305
|
/**
|
|
19877
20306
|
* Using the standard algorithm for regular expression matching only
|
|
19878
20307
|
* the longest match in the string is retrieved. This function uses
|
|
@@ -19892,7 +20321,7 @@ interface Regex {
|
|
|
19892
20321
|
* @param match_options match options
|
|
19893
20322
|
* @returns %TRUE is the string matched, %FALSE otherwise
|
|
19894
20323
|
*/
|
|
19895
|
-
match_all(string: string
|
|
20324
|
+
match_all(string: string, match_options: RegexMatchFlags): [ /* returnType */ boolean, /* match_info */ MatchInfo ]
|
|
19896
20325
|
/**
|
|
19897
20326
|
* Using the standard algorithm for regular expression matching only
|
|
19898
20327
|
* the longest match in the `string` is retrieved, it is not possible
|
|
@@ -20036,7 +20465,7 @@ interface Regex {
|
|
|
20036
20465
|
* @param match_options options for the match
|
|
20037
20466
|
* @returns a newly allocated string containing the replacements
|
|
20038
20467
|
*/
|
|
20039
|
-
replace(string: string[], start_position: number, replacement: string
|
|
20468
|
+
replace(string: string[], start_position: number, replacement: string, match_options: RegexMatchFlags): string | null
|
|
20040
20469
|
/**
|
|
20041
20470
|
* Replaces all occurrences of the pattern in `regex` with the
|
|
20042
20471
|
* replacement text. `replacement` is replaced literally, to
|
|
@@ -20052,7 +20481,7 @@ interface Regex {
|
|
|
20052
20481
|
* @param match_options options for the match
|
|
20053
20482
|
* @returns a newly allocated string containing the replacements
|
|
20054
20483
|
*/
|
|
20055
|
-
replace_literal(string: string[], start_position: number, replacement: string
|
|
20484
|
+
replace_literal(string: string[], start_position: number, replacement: string, match_options: RegexMatchFlags): string | null
|
|
20056
20485
|
/**
|
|
20057
20486
|
* Breaks the string on the pattern, and returns an array of the tokens.
|
|
20058
20487
|
* If the pattern contains capturing parentheses, then the text for each
|
|
@@ -20075,7 +20504,7 @@ interface Regex {
|
|
|
20075
20504
|
* @param match_options match time option flags
|
|
20076
20505
|
* @returns a %NULL-terminated gchar ** array. Free it using g_strfreev()
|
|
20077
20506
|
*/
|
|
20078
|
-
split(string: string
|
|
20507
|
+
split(string: string, match_options: RegexMatchFlags): string[]
|
|
20079
20508
|
/**
|
|
20080
20509
|
* Breaks the string on the pattern, and returns an array of the tokens.
|
|
20081
20510
|
* If the pattern contains capturing parentheses, then the text for each
|
|
@@ -20185,7 +20614,7 @@ class Regex {
|
|
|
20185
20614
|
* @param match_options match options for the regular expression, or 0
|
|
20186
20615
|
* @returns a #GRegex structure or %NULL if an error occurred. Call g_regex_unref() when you are done with it
|
|
20187
20616
|
*/
|
|
20188
|
-
constructor(pattern: string
|
|
20617
|
+
constructor(pattern: string, compile_options: RegexCompileFlags, match_options: RegexMatchFlags)
|
|
20189
20618
|
/**
|
|
20190
20619
|
* Compiles the regular expression to an internal form, and does
|
|
20191
20620
|
* the initial setup of the #GRegex structure.
|
|
@@ -20195,7 +20624,7 @@ class Regex {
|
|
|
20195
20624
|
* @param match_options match options for the regular expression, or 0
|
|
20196
20625
|
* @returns a #GRegex structure or %NULL if an error occurred. Call g_regex_unref() when you are done with it
|
|
20197
20626
|
*/
|
|
20198
|
-
static new(pattern: string
|
|
20627
|
+
static new(pattern: string, compile_options: RegexCompileFlags, match_options: RegexMatchFlags): Regex
|
|
20199
20628
|
/**
|
|
20200
20629
|
* Checks whether `replacement` is a valid replacement string
|
|
20201
20630
|
* (see g_regex_replace()), i.e. that all escape sequences in
|
|
@@ -20209,7 +20638,7 @@ class Regex {
|
|
|
20209
20638
|
* @param replacement the replacement string
|
|
20210
20639
|
* @returns whether @replacement is a valid replacement string
|
|
20211
20640
|
*/
|
|
20212
|
-
static check_replacement(replacement: string
|
|
20641
|
+
static check_replacement(replacement: string): [ /* returnType */ boolean, /* has_references */ boolean ]
|
|
20213
20642
|
static error_quark(): Quark
|
|
20214
20643
|
/**
|
|
20215
20644
|
* Escapes the nul characters in `string` to "\x00". It can be used
|
|
@@ -20221,7 +20650,7 @@ class Regex {
|
|
|
20221
20650
|
* @param length the length of `string`
|
|
20222
20651
|
* @returns a newly-allocated escaped string
|
|
20223
20652
|
*/
|
|
20224
|
-
static escape_nul(string: string
|
|
20653
|
+
static escape_nul(string: string, length: number): string | null
|
|
20225
20654
|
/**
|
|
20226
20655
|
* Escapes the special characters used for regular expressions
|
|
20227
20656
|
* in `string,` for instance "a.b*c" becomes "a\.b\*c". This
|
|
@@ -20234,7 +20663,7 @@ class Regex {
|
|
|
20234
20663
|
* @param length the length of `string,` in bytes, or -1 if `string` is nul-terminated
|
|
20235
20664
|
* @returns a newly-allocated escaped string
|
|
20236
20665
|
*/
|
|
20237
|
-
static escape_string(string: string
|
|
20666
|
+
static escape_string(string: string, length: number): string | null
|
|
20238
20667
|
/**
|
|
20239
20668
|
* Scans for a match in `string` for `pattern`.
|
|
20240
20669
|
*
|
|
@@ -20252,7 +20681,7 @@ class Regex {
|
|
|
20252
20681
|
* @param match_options match options, or 0
|
|
20253
20682
|
* @returns %TRUE if the string matched, %FALSE otherwise
|
|
20254
20683
|
*/
|
|
20255
|
-
static match_simple(pattern: string
|
|
20684
|
+
static match_simple(pattern: string, string: string, compile_options: RegexCompileFlags, match_options: RegexMatchFlags): boolean
|
|
20256
20685
|
/**
|
|
20257
20686
|
* Breaks the string on the pattern, and returns an array of
|
|
20258
20687
|
* the tokens. If the pattern contains capturing parentheses,
|
|
@@ -20287,7 +20716,7 @@ class Regex {
|
|
|
20287
20716
|
* @param match_options match options, or 0
|
|
20288
20717
|
* @returns a %NULL-terminated array of strings. Free it using g_strfreev()
|
|
20289
20718
|
*/
|
|
20290
|
-
static split_simple(pattern: string
|
|
20719
|
+
static split_simple(pattern: string, string: string, compile_options: RegexCompileFlags, match_options: RegexMatchFlags): string[]
|
|
20291
20720
|
}
|
|
20292
20721
|
|
|
20293
20722
|
interface SList {
|
|
@@ -20343,7 +20772,7 @@ interface Scanner {
|
|
|
20343
20772
|
* name of input stream, featured by the default message handler
|
|
20344
20773
|
* @field
|
|
20345
20774
|
*/
|
|
20346
|
-
input_name: string
|
|
20775
|
+
input_name: string
|
|
20347
20776
|
/**
|
|
20348
20777
|
* quarked data
|
|
20349
20778
|
* @field
|
|
@@ -20450,7 +20879,7 @@ interface Scanner {
|
|
|
20450
20879
|
* @param text the text buffer to scan
|
|
20451
20880
|
* @param text_len the length of the text buffer
|
|
20452
20881
|
*/
|
|
20453
|
-
input_text(text: string
|
|
20882
|
+
input_text(text: string, text_len: number): void
|
|
20454
20883
|
/**
|
|
20455
20884
|
* Looks up a symbol in the current scope and return its value.
|
|
20456
20885
|
* If the symbol is not bound in the current scope, %NULL is
|
|
@@ -20458,7 +20887,7 @@ interface Scanner {
|
|
|
20458
20887
|
* @param symbol the symbol to look up
|
|
20459
20888
|
* @returns the value of @symbol in the current scope, or %NULL if @symbol is not bound in the current scope
|
|
20460
20889
|
*/
|
|
20461
|
-
lookup_symbol(symbol: string
|
|
20890
|
+
lookup_symbol(symbol: string): any | null
|
|
20462
20891
|
/**
|
|
20463
20892
|
* Parses the next token, without removing it from the input stream.
|
|
20464
20893
|
* The token data is placed in the `next_token,` `next_value,` `next_line,`
|
|
@@ -20480,7 +20909,7 @@ interface Scanner {
|
|
|
20480
20909
|
* @param symbol the symbol to add
|
|
20481
20910
|
* @param value the value of the symbol
|
|
20482
20911
|
*/
|
|
20483
|
-
scope_add_symbol(scope_id: number, symbol: string
|
|
20912
|
+
scope_add_symbol(scope_id: number, symbol: string, value: any | null): void
|
|
20484
20913
|
/**
|
|
20485
20914
|
* Looks up a symbol in a scope and return its value. If the
|
|
20486
20915
|
* symbol is not bound in the scope, %NULL is returned.
|
|
@@ -20488,13 +20917,13 @@ interface Scanner {
|
|
|
20488
20917
|
* @param symbol the symbol to look up
|
|
20489
20918
|
* @returns the value of @symbol in the given scope, or %NULL if @symbol is not bound in the given scope.
|
|
20490
20919
|
*/
|
|
20491
|
-
scope_lookup_symbol(scope_id: number, symbol: string
|
|
20920
|
+
scope_lookup_symbol(scope_id: number, symbol: string): any | null
|
|
20492
20921
|
/**
|
|
20493
20922
|
* Removes a symbol from a scope.
|
|
20494
20923
|
* @param scope_id the scope id
|
|
20495
20924
|
* @param symbol the symbol to remove
|
|
20496
20925
|
*/
|
|
20497
|
-
scope_remove_symbol(scope_id: number, symbol: string
|
|
20926
|
+
scope_remove_symbol(scope_id: number, symbol: string): void
|
|
20498
20927
|
/**
|
|
20499
20928
|
* Sets the current scope.
|
|
20500
20929
|
* @param scope_id the new scope id
|
|
@@ -20523,7 +20952,7 @@ interface Scanner {
|
|
|
20523
20952
|
* @param message a message string to output at the end of the warning/error, or %NULL.
|
|
20524
20953
|
* @param is_error if %TRUE it is output as an error. If %FALSE it is output as a warning.
|
|
20525
20954
|
*/
|
|
20526
|
-
unexp_token(expected_token: TokenType, identifier_spec: string
|
|
20955
|
+
unexp_token(expected_token: TokenType, identifier_spec: string, symbol_spec: string, symbol_name: string, message: string, is_error: number): void
|
|
20527
20956
|
}
|
|
20528
20957
|
|
|
20529
20958
|
/**
|
|
@@ -21317,7 +21746,7 @@ interface Source {
|
|
|
21317
21746
|
*
|
|
21318
21747
|
* The source name should describe in a human-readable way
|
|
21319
21748
|
* what the source does. For example, "X11 event queue"
|
|
21320
|
-
* or "GTK
|
|
21749
|
+
* or "GTK repaint idle handler" or whatever it is.
|
|
21321
21750
|
*
|
|
21322
21751
|
* It is permitted to call this function multiple times, but is not
|
|
21323
21752
|
* recommended due to the potential performance impact. For example,
|
|
@@ -21332,7 +21761,7 @@ interface Source {
|
|
|
21332
21761
|
* Also see g_source_set_static_name().
|
|
21333
21762
|
* @param name debug name for the source
|
|
21334
21763
|
*/
|
|
21335
|
-
set_name(name: string
|
|
21764
|
+
set_name(name: string): void
|
|
21336
21765
|
/**
|
|
21337
21766
|
* Sets the priority of a source. While the main loop is being run, a
|
|
21338
21767
|
* source will be dispatched if it is ready to be dispatched and no
|
|
@@ -21377,7 +21806,7 @@ interface Source {
|
|
|
21377
21806
|
* string literals.
|
|
21378
21807
|
* @param name debug name for the source
|
|
21379
21808
|
*/
|
|
21380
|
-
set_static_name(name: string
|
|
21809
|
+
set_static_name(name: string): void
|
|
21381
21810
|
/**
|
|
21382
21811
|
* Decreases the reference count of a source by one. If the
|
|
21383
21812
|
* resulting reference count is zero the source and associated
|
|
@@ -21490,7 +21919,7 @@ class Source {
|
|
|
21490
21919
|
* @param tag a #GSource ID
|
|
21491
21920
|
* @param name debug name for the source
|
|
21492
21921
|
*/
|
|
21493
|
-
static set_name_by_id(tag: number, name: string
|
|
21922
|
+
static set_name_by_id(tag: number, name: string): void
|
|
21494
21923
|
}
|
|
21495
21924
|
|
|
21496
21925
|
interface SourceCallbackFuncs {
|
|
@@ -21611,7 +22040,7 @@ interface String {
|
|
|
21611
22040
|
* @param val the string to append onto the end of `string`
|
|
21612
22041
|
* @returns @string
|
|
21613
22042
|
*/
|
|
21614
|
-
append(val: string
|
|
22043
|
+
append(val: string): String
|
|
21615
22044
|
/**
|
|
21616
22045
|
* Adds a byte onto the end of a #GString, expanding
|
|
21617
22046
|
* it if necessary.
|
|
@@ -21633,7 +22062,7 @@ interface String {
|
|
|
21633
22062
|
* @param len number of bytes of `val` to use, or -1 for all of `val`
|
|
21634
22063
|
* @returns @string
|
|
21635
22064
|
*/
|
|
21636
|
-
append_len(val: string
|
|
22065
|
+
append_len(val: string, len: number): String
|
|
21637
22066
|
/**
|
|
21638
22067
|
* Converts a Unicode character into UTF-8, and appends it
|
|
21639
22068
|
* to the string.
|
|
@@ -21649,7 +22078,7 @@ interface String {
|
|
|
21649
22078
|
* @param allow_utf8 set %TRUE if the escaped string may include UTF8 characters
|
|
21650
22079
|
* @returns @string
|
|
21651
22080
|
*/
|
|
21652
|
-
append_uri_escaped(unescaped: string
|
|
22081
|
+
append_uri_escaped(unescaped: string, reserved_chars_allowed: string, allow_utf8: boolean): String
|
|
21653
22082
|
/**
|
|
21654
22083
|
* Converts all uppercase ASCII letters to lowercase ASCII letters.
|
|
21655
22084
|
* @returns passed-in @string pointer, with all the uppercase characters converted to lowercase in place, with semantics that exactly match g_ascii_tolower().
|
|
@@ -21668,7 +22097,7 @@ interface String {
|
|
|
21668
22097
|
* @param rval the string to copy into `string`
|
|
21669
22098
|
* @returns @string
|
|
21670
22099
|
*/
|
|
21671
|
-
assign(rval: string
|
|
22100
|
+
assign(rval: string): String
|
|
21672
22101
|
/**
|
|
21673
22102
|
* Converts a #GString to lowercase.
|
|
21674
22103
|
* @returns the #GString
|
|
@@ -21733,7 +22162,7 @@ interface String {
|
|
|
21733
22162
|
* @param val the string to insert
|
|
21734
22163
|
* @returns @string
|
|
21735
22164
|
*/
|
|
21736
|
-
insert(pos: number, val: string
|
|
22165
|
+
insert(pos: number, val: string): String
|
|
21737
22166
|
/**
|
|
21738
22167
|
* Inserts a byte into a #GString, expanding it if necessary.
|
|
21739
22168
|
* @param pos the position to insert the byte
|
|
@@ -21757,7 +22186,7 @@ interface String {
|
|
|
21757
22186
|
* @param len number of bytes of `val` to insert, or -1 for all of `val`
|
|
21758
22187
|
* @returns @string
|
|
21759
22188
|
*/
|
|
21760
|
-
insert_len(pos: number, val: string
|
|
22189
|
+
insert_len(pos: number, val: string, len: number): String
|
|
21761
22190
|
/**
|
|
21762
22191
|
* Converts a Unicode character into UTF-8, and insert it
|
|
21763
22192
|
* into the string at the given position.
|
|
@@ -21772,7 +22201,7 @@ interface String {
|
|
|
21772
22201
|
* @param val the string that will overwrite the `string` starting at `pos`
|
|
21773
22202
|
* @returns @string
|
|
21774
22203
|
*/
|
|
21775
|
-
overwrite(pos: number, val: string
|
|
22204
|
+
overwrite(pos: number, val: string): String
|
|
21776
22205
|
/**
|
|
21777
22206
|
* Overwrites part of a string, lengthening it if necessary.
|
|
21778
22207
|
* This function will work with embedded nuls.
|
|
@@ -21781,14 +22210,14 @@ interface String {
|
|
|
21781
22210
|
* @param len the number of bytes to write from `val`
|
|
21782
22211
|
* @returns @string
|
|
21783
22212
|
*/
|
|
21784
|
-
overwrite_len(pos: number, val: string
|
|
22213
|
+
overwrite_len(pos: number, val: string, len: number): String
|
|
21785
22214
|
/**
|
|
21786
22215
|
* Adds a string on to the start of a #GString,
|
|
21787
22216
|
* expanding it if necessary.
|
|
21788
22217
|
* @param val the string to prepend on the start of `string`
|
|
21789
22218
|
* @returns @string
|
|
21790
22219
|
*/
|
|
21791
|
-
prepend(val: string
|
|
22220
|
+
prepend(val: string): String
|
|
21792
22221
|
/**
|
|
21793
22222
|
* Adds a byte onto the start of a #GString,
|
|
21794
22223
|
* expanding it if necessary.
|
|
@@ -21810,7 +22239,7 @@ interface String {
|
|
|
21810
22239
|
* @param len number of bytes in `val` to prepend, or -1 for all of `val`
|
|
21811
22240
|
* @returns @string
|
|
21812
22241
|
*/
|
|
21813
|
-
prepend_len(val: string
|
|
22242
|
+
prepend_len(val: string, len: number): String
|
|
21814
22243
|
/**
|
|
21815
22244
|
* Converts a Unicode character into UTF-8, and prepends it
|
|
21816
22245
|
* to the string.
|
|
@@ -21833,7 +22262,7 @@ interface String {
|
|
|
21833
22262
|
* @param limit the maximum instances of `find` to replace with `replace,` or `0` for no limit
|
|
21834
22263
|
* @returns the number of find and replace operations performed.
|
|
21835
22264
|
*/
|
|
21836
|
-
replace(find: string
|
|
22265
|
+
replace(find: string, replace: string, limit: number): number
|
|
21837
22266
|
/**
|
|
21838
22267
|
* Sets the length of a #GString. If the length is less than
|
|
21839
22268
|
* the current length, the string will be truncated. If the
|
|
@@ -21896,7 +22325,18 @@ class String {
|
|
|
21896
22325
|
* @param len length of `init` to use
|
|
21897
22326
|
* @returns a new #GString
|
|
21898
22327
|
*/
|
|
21899
|
-
static new_len(init: string
|
|
22328
|
+
static new_len(init: string, len: number): String
|
|
22329
|
+
/**
|
|
22330
|
+
* Creates a new #GString, initialized with the given string.
|
|
22331
|
+
*
|
|
22332
|
+
* After this call, `init` belongs to the #GString and may no longer be
|
|
22333
|
+
* modified by the caller. The memory of `data` has to be dynamically
|
|
22334
|
+
* allocated and will eventually be freed with g_free().
|
|
22335
|
+
* @constructor
|
|
22336
|
+
* @param init initial text used as the string. Ownership of the string is transferred to the #GString. Passing %NULL creates an empty string.
|
|
22337
|
+
* @returns the new #GString
|
|
22338
|
+
*/
|
|
22339
|
+
static new_take(init: string | null): String
|
|
21900
22340
|
/**
|
|
21901
22341
|
* Creates a new #GString, with enough space for `dfl_size`
|
|
21902
22342
|
* bytes. This is useful if you are going to add a lot of
|
|
@@ -21940,7 +22380,7 @@ interface StringChunk {
|
|
|
21940
22380
|
* @param string the string to add
|
|
21941
22381
|
* @returns a pointer to the copy of @string within the #GStringChunk
|
|
21942
22382
|
*/
|
|
21943
|
-
insert(string: string
|
|
22383
|
+
insert(string: string): string | null
|
|
21944
22384
|
/**
|
|
21945
22385
|
* Adds a copy of `string` to the #GStringChunk, unless the same
|
|
21946
22386
|
* string has already been added to the #GStringChunk with
|
|
@@ -21958,7 +22398,7 @@ interface StringChunk {
|
|
|
21958
22398
|
* @param string the string to add
|
|
21959
22399
|
* @returns a pointer to the new or existing copy of @string within the #GStringChunk
|
|
21960
22400
|
*/
|
|
21961
|
-
insert_const(string: string
|
|
22401
|
+
insert_const(string: string): string | null
|
|
21962
22402
|
/**
|
|
21963
22403
|
* Adds a copy of the first `len` bytes of `string` to the #GStringChunk.
|
|
21964
22404
|
* The copy is nul-terminated.
|
|
@@ -21973,7 +22413,7 @@ interface StringChunk {
|
|
|
21973
22413
|
* @param len number of bytes of `string` to insert, or -1 to insert a nul-terminated string
|
|
21974
22414
|
* @returns a pointer to the copy of @string within the #GStringChunk
|
|
21975
22415
|
*/
|
|
21976
|
-
insert_len(string: string
|
|
22416
|
+
insert_len(string: string, len: number): string | null
|
|
21977
22417
|
}
|
|
21978
22418
|
|
|
21979
22419
|
/**
|
|
@@ -21998,7 +22438,7 @@ interface StrvBuilder {
|
|
|
21998
22438
|
* Since 2.68
|
|
21999
22439
|
* @param value a string.
|
|
22000
22440
|
*/
|
|
22001
|
-
add(value: string
|
|
22441
|
+
add(value: string): void
|
|
22002
22442
|
/**
|
|
22003
22443
|
* Appends all the strings in the given vector to the builder.
|
|
22004
22444
|
*
|
|
@@ -22629,7 +23069,7 @@ class TimeVal {
|
|
|
22629
23069
|
* @param iso_date an ISO 8601 encoded date string
|
|
22630
23070
|
* @returns %TRUE if the conversion was successful.
|
|
22631
23071
|
*/
|
|
22632
|
-
static from_iso8601(iso_date: string
|
|
23072
|
+
static from_iso8601(iso_date: string): [ /* returnType */ boolean, /* time_ */ TimeVal ]
|
|
22633
23073
|
}
|
|
22634
23074
|
|
|
22635
23075
|
interface TimeZone {
|
|
@@ -22692,7 +23132,7 @@ interface TimeZone {
|
|
|
22692
23132
|
* @param interval an interval within the timezone
|
|
22693
23133
|
* @returns the time zone abbreviation, which belongs to @tz
|
|
22694
23134
|
*/
|
|
22695
|
-
get_abbreviation(interval: number): string
|
|
23135
|
+
get_abbreviation(interval: number): string
|
|
22696
23136
|
/**
|
|
22697
23137
|
* Get the identifier of this #GTimeZone, as passed to g_time_zone_new().
|
|
22698
23138
|
* If the identifier passed at construction time was not recognised, `UTC` will
|
|
@@ -22704,7 +23144,7 @@ interface TimeZone {
|
|
|
22704
23144
|
* this function.
|
|
22705
23145
|
* @returns identifier for this timezone
|
|
22706
23146
|
*/
|
|
22707
|
-
get_identifier(): string
|
|
23147
|
+
get_identifier(): string
|
|
22708
23148
|
/**
|
|
22709
23149
|
* Determines the offset to UTC in effect during a particular `interval`
|
|
22710
23150
|
* of time in the time zone `tz`.
|
|
@@ -23300,7 +23740,7 @@ interface Uri {
|
|
|
23300
23740
|
* flags with which `uri` was created.
|
|
23301
23741
|
* @returns @uri's path.
|
|
23302
23742
|
*/
|
|
23303
|
-
get_path(): string
|
|
23743
|
+
get_path(): string
|
|
23304
23744
|
/**
|
|
23305
23745
|
* Gets `uri'`s port.
|
|
23306
23746
|
* @returns @uri's port, or `-1` if no port was specified.
|
|
@@ -23320,7 +23760,7 @@ interface Uri {
|
|
|
23320
23760
|
* regardless of the string or strings that `uri` was created from.
|
|
23321
23761
|
* @returns @uri's scheme.
|
|
23322
23762
|
*/
|
|
23323
|
-
get_scheme(): string
|
|
23763
|
+
get_scheme(): string
|
|
23324
23764
|
/**
|
|
23325
23765
|
* Gets the ‘username’ component of `uri'`s userinfo, which may contain
|
|
23326
23766
|
* `%`-encoding, depending on the flags with which `uri` was created.
|
|
@@ -23344,7 +23784,7 @@ interface Uri {
|
|
|
23344
23784
|
* @param flags flags describing how to parse `uri_ref`
|
|
23345
23785
|
* @returns a new #GUri, or NULL on error.
|
|
23346
23786
|
*/
|
|
23347
|
-
parse_relative(uri_ref: string
|
|
23787
|
+
parse_relative(uri_ref: string, flags: UriFlags): Uri
|
|
23348
23788
|
/**
|
|
23349
23789
|
* Returns a string representing `uri`.
|
|
23350
23790
|
*
|
|
@@ -23504,7 +23944,7 @@ class Uri {
|
|
|
23504
23944
|
* @param fragment the fragment, or %NULL
|
|
23505
23945
|
* @returns a new #GUri
|
|
23506
23946
|
*/
|
|
23507
|
-
static build(flags: UriFlags, scheme: string
|
|
23947
|
+
static build(flags: UriFlags, scheme: string, userinfo: string | null, host: string | null, port: number, path: string, query: string | null, fragment: string | null): Uri
|
|
23508
23948
|
/**
|
|
23509
23949
|
* Creates a new #GUri from the given components according to `flags`
|
|
23510
23950
|
* (%G_URI_FLAGS_HAS_PASSWORD is added unconditionally). The `flags` must be
|
|
@@ -23526,7 +23966,7 @@ class Uri {
|
|
|
23526
23966
|
* @param fragment the fragment, or %NULL
|
|
23527
23967
|
* @returns a new #GUri
|
|
23528
23968
|
*/
|
|
23529
|
-
static build_with_user(flags: UriFlags, scheme: string
|
|
23969
|
+
static build_with_user(flags: UriFlags, scheme: string, user: string | null, password: string | null, auth_params: string | null, host: string | null, port: number, path: string, query: string | null, fragment: string | null): Uri
|
|
23530
23970
|
static error_quark(): Quark
|
|
23531
23971
|
/**
|
|
23532
23972
|
* Escapes arbitrary data for use in a URI.
|
|
@@ -23559,7 +23999,7 @@ class Uri {
|
|
|
23559
23999
|
* @param allow_utf8 %TRUE if the result can include UTF-8 characters.
|
|
23560
24000
|
* @returns an escaped version of @unescaped. The returned string should be freed when no longer needed.
|
|
23561
24001
|
*/
|
|
23562
|
-
static escape_string(unescaped: string
|
|
24002
|
+
static escape_string(unescaped: string, reserved_chars_allowed: string | null, allow_utf8: boolean): string | null
|
|
23563
24003
|
/**
|
|
23564
24004
|
* Parses `uri_string` according to `flags,` to determine whether it is a valid
|
|
23565
24005
|
* [absolute URI][relative-absolute-uris], i.e. it does not need to be resolved
|
|
@@ -23573,7 +24013,7 @@ class Uri {
|
|
|
23573
24013
|
* @param flags flags for parsing `uri_string`
|
|
23574
24014
|
* @returns %TRUE if @uri_string is a valid absolute URI, %FALSE on error.
|
|
23575
24015
|
*/
|
|
23576
|
-
static is_valid(uri_string: string
|
|
24016
|
+
static is_valid(uri_string: string, flags: UriFlags): boolean
|
|
23577
24017
|
/**
|
|
23578
24018
|
* Joins the given components together according to `flags` to create
|
|
23579
24019
|
* an absolute URI string. `path` may not be %NULL (though it may be the empty
|
|
@@ -23581,7 +24021,7 @@ class Uri {
|
|
|
23581
24021
|
*
|
|
23582
24022
|
* When `host` is present, `path` must either be empty or begin with a slash (`/`)
|
|
23583
24023
|
* character. When `host` is not present, `path` cannot begin with two slash
|
|
23584
|
-
*
|
|
24024
|
+
* characters (`//`). See
|
|
23585
24025
|
* [RFC 3986, section 3](https://tools.ietf.org/html/rfc3986#section-3).
|
|
23586
24026
|
*
|
|
23587
24027
|
* See also g_uri_join_with_user(), which allows specifying the
|
|
@@ -23599,7 +24039,7 @@ class Uri {
|
|
|
23599
24039
|
* @param fragment the fragment, or %NULL
|
|
23600
24040
|
* @returns an absolute URI string
|
|
23601
24041
|
*/
|
|
23602
|
-
static join(flags: UriFlags, scheme: string | null, userinfo: string | null, host: string | null, port: number, path: string
|
|
24042
|
+
static join(flags: UriFlags, scheme: string | null, userinfo: string | null, host: string | null, port: number, path: string, query: string | null, fragment: string | null): string | null
|
|
23603
24043
|
/**
|
|
23604
24044
|
* Joins the given components together according to `flags` to create
|
|
23605
24045
|
* an absolute URI string. `path` may not be %NULL (though it may be the empty
|
|
@@ -23622,7 +24062,7 @@ class Uri {
|
|
|
23622
24062
|
* @param fragment the fragment, or %NULL
|
|
23623
24063
|
* @returns an absolute URI string
|
|
23624
24064
|
*/
|
|
23625
|
-
static join_with_user(flags: UriFlags, scheme: string | null, user: string | null, password: string | null, auth_params: string | null, host: string | null, port: number, path: string
|
|
24065
|
+
static join_with_user(flags: UriFlags, scheme: string | null, user: string | null, password: string | null, auth_params: string | null, host: string | null, port: number, path: string, query: string | null, fragment: string | null): string | null
|
|
23626
24066
|
/**
|
|
23627
24067
|
* Splits an URI list conforming to the text/uri-list
|
|
23628
24068
|
* mime type defined in RFC 2483 into individual URIs,
|
|
@@ -23630,7 +24070,7 @@ class Uri {
|
|
|
23630
24070
|
* @param uri_list an URI list
|
|
23631
24071
|
* @returns a newly allocated %NULL-terminated list of strings holding the individual URIs. The array should be freed with g_strfreev().
|
|
23632
24072
|
*/
|
|
23633
|
-
static list_extract_uris(uri_list: string
|
|
24073
|
+
static list_extract_uris(uri_list: string): string[]
|
|
23634
24074
|
/**
|
|
23635
24075
|
* Parses `uri_string` according to `flags`. If the result is not a
|
|
23636
24076
|
* valid [absolute URI][relative-absolute-uris], it will be discarded, and an
|
|
@@ -23639,7 +24079,7 @@ class Uri {
|
|
|
23639
24079
|
* @param flags flags describing how to parse `uri_string`
|
|
23640
24080
|
* @returns a new #GUri, or NULL on error.
|
|
23641
24081
|
*/
|
|
23642
|
-
static parse(uri_string: string
|
|
24082
|
+
static parse(uri_string: string, flags: UriFlags): Uri
|
|
23643
24083
|
/**
|
|
23644
24084
|
* Many URI schemes include one or more attribute/value pairs as part of the URI
|
|
23645
24085
|
* value. This method can be used to parse them into a hash table. When an
|
|
@@ -23671,7 +24111,7 @@ class Uri {
|
|
|
23671
24111
|
* @param flags flags to modify the way the parameters are handled.
|
|
23672
24112
|
* @returns A hash table of attribute/value pairs, with both names and values fully-decoded; or %NULL on error.
|
|
23673
24113
|
*/
|
|
23674
|
-
static parse_params(params: string
|
|
24114
|
+
static parse_params(params: string, length: number, separators: string, flags: UriParamsFlags): HashTable
|
|
23675
24115
|
/**
|
|
23676
24116
|
* Gets the scheme portion of a URI string.
|
|
23677
24117
|
* [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) decodes the scheme
|
|
@@ -23685,7 +24125,7 @@ class Uri {
|
|
|
23685
24125
|
* @param uri a valid URI.
|
|
23686
24126
|
* @returns The ‘scheme’ component of the URI, or %NULL on error. The returned string should be freed when no longer needed.
|
|
23687
24127
|
*/
|
|
23688
|
-
static parse_scheme(uri: string
|
|
24128
|
+
static parse_scheme(uri: string): string | null
|
|
23689
24129
|
/**
|
|
23690
24130
|
* Gets the scheme portion of a URI string.
|
|
23691
24131
|
* [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) decodes the scheme
|
|
@@ -23702,7 +24142,7 @@ class Uri {
|
|
|
23702
24142
|
* @param uri a valid URI.
|
|
23703
24143
|
* @returns The ‘scheme’ component of the URI, or %NULL on error. The returned string is normalized to all-lowercase, and interned via g_intern_string(), so it does not need to be freed.
|
|
23704
24144
|
*/
|
|
23705
|
-
static peek_scheme(uri: string
|
|
24145
|
+
static peek_scheme(uri: string): string | null
|
|
23706
24146
|
/**
|
|
23707
24147
|
* Parses `uri_ref` according to `flags` and, if it is a
|
|
23708
24148
|
* [relative URI][relative-absolute-uris], resolves it relative to
|
|
@@ -23716,7 +24156,7 @@ class Uri {
|
|
|
23716
24156
|
* @param flags flags describing how to parse `uri_ref`
|
|
23717
24157
|
* @returns the resolved URI string, or NULL on error.
|
|
23718
24158
|
*/
|
|
23719
|
-
static resolve_relative(base_uri_string: string | null, uri_ref: string
|
|
24159
|
+
static resolve_relative(base_uri_string: string | null, uri_ref: string, flags: UriFlags): string | null
|
|
23720
24160
|
/**
|
|
23721
24161
|
* Parses `uri_ref` (which can be an
|
|
23722
24162
|
* [absolute or relative URI][relative-absolute-uris]) according to `flags,` and
|
|
@@ -23738,7 +24178,7 @@ class Uri {
|
|
|
23738
24178
|
* @param flags flags for parsing `uri_ref`
|
|
23739
24179
|
* @returns %TRUE if @uri_ref parsed successfully, %FALSE on error.
|
|
23740
24180
|
*/
|
|
23741
|
-
static split(uri_ref: string
|
|
24181
|
+
static split(uri_ref: string, flags: UriFlags): [ /* returnType */ boolean, /* scheme */ string | null, /* userinfo */ string | null, /* host */ string | null, /* port */ number, /* path */ string, /* query */ string | null, /* fragment */ string | null ]
|
|
23742
24182
|
/**
|
|
23743
24183
|
* Parses `uri_string` (which must be an [absolute URI][relative-absolute-uris])
|
|
23744
24184
|
* according to `flags,` and returns the pieces relevant to connecting to a host.
|
|
@@ -23750,7 +24190,7 @@ class Uri {
|
|
|
23750
24190
|
* @param flags flags for parsing `uri_string`
|
|
23751
24191
|
* @returns %TRUE if @uri_string parsed successfully, %FALSE on error.
|
|
23752
24192
|
*/
|
|
23753
|
-
static split_network(uri_string: string
|
|
24193
|
+
static split_network(uri_string: string, flags: UriFlags): [ /* returnType */ boolean, /* scheme */ string | null, /* host */ string | null, /* port */ number ]
|
|
23754
24194
|
/**
|
|
23755
24195
|
* Parses `uri_ref` (which can be an
|
|
23756
24196
|
* [absolute or relative URI][relative-absolute-uris]) according to `flags,` and
|
|
@@ -23767,7 +24207,7 @@ class Uri {
|
|
|
23767
24207
|
* @param flags flags for parsing `uri_ref`
|
|
23768
24208
|
* @returns %TRUE if @uri_ref parsed successfully, %FALSE on error.
|
|
23769
24209
|
*/
|
|
23770
|
-
static split_with_user(uri_ref: string
|
|
24210
|
+
static split_with_user(uri_ref: string, flags: UriFlags): [ /* returnType */ boolean, /* scheme */ string | null, /* user */ string | null, /* password */ string | null, /* auth_params */ string | null, /* host */ string | null, /* port */ number, /* path */ string, /* query */ string | null, /* fragment */ string | null ]
|
|
23771
24211
|
/**
|
|
23772
24212
|
* Unescapes a segment of an escaped string as binary data.
|
|
23773
24213
|
*
|
|
@@ -23784,7 +24224,7 @@ class Uri {
|
|
|
23784
24224
|
* @param illegal_characters a string of illegal characters not to be allowed, or %NULL.
|
|
23785
24225
|
* @returns an unescaped version of @escaped_string or %NULL on error (if decoding failed, using %G_URI_ERROR_FAILED error code). The returned #GBytes should be unreffed when no longer needed.
|
|
23786
24226
|
*/
|
|
23787
|
-
static unescape_bytes(escaped_string: string
|
|
24227
|
+
static unescape_bytes(escaped_string: string, length: number, illegal_characters: string | null): Bytes
|
|
23788
24228
|
/**
|
|
23789
24229
|
* Unescapes a segment of an escaped string.
|
|
23790
24230
|
*
|
|
@@ -23814,7 +24254,7 @@ class Uri {
|
|
|
23814
24254
|
* @param illegal_characters a string of illegal characters not to be allowed, or %NULL.
|
|
23815
24255
|
* @returns an unescaped version of @escaped_string. The returned string should be freed when no longer needed.
|
|
23816
24256
|
*/
|
|
23817
|
-
static unescape_string(escaped_string: string
|
|
24257
|
+
static unescape_string(escaped_string: string, illegal_characters: string | null): string | null
|
|
23818
24258
|
}
|
|
23819
24259
|
|
|
23820
24260
|
interface UriParamsIter {
|
|
@@ -23862,7 +24302,7 @@ interface UriParamsIter {
|
|
|
23862
24302
|
* @param separators the separator byte character set between parameters. (usually `&`, but sometimes `;` or both `&;`). Note that this function works on bytes not characters, so it can't be used to delimit UTF-8 strings for anything but ASCII characters. You may pass an empty set, in which case no splitting will occur.
|
|
23863
24303
|
* @param flags flags to modify the way the parameters are handled.
|
|
23864
24304
|
*/
|
|
23865
|
-
init(params: string
|
|
24305
|
+
init(params: string, length: number, separators: string, flags: UriParamsFlags): void
|
|
23866
24306
|
/**
|
|
23867
24307
|
* Advances `iter` and retrieves the next attribute/value. %FALSE is returned if
|
|
23868
24308
|
* an error has occurred (in which case `error` is set), or if the end of the
|
|
@@ -23941,7 +24381,7 @@ interface Variant {
|
|
|
23941
24381
|
* @param copy_only %TRUE to ensure the format string makes deep copies
|
|
23942
24382
|
* @returns %TRUE if @format_string is safe to use
|
|
23943
24383
|
*/
|
|
23944
|
-
check_format_string(format_string: string
|
|
24384
|
+
check_format_string(format_string: string, copy_only: boolean): boolean
|
|
23945
24385
|
/**
|
|
23946
24386
|
* Classifies `value` according to its top-level type.
|
|
23947
24387
|
* @returns the #GVariantClass of @value
|
|
@@ -24286,7 +24726,7 @@ interface Variant {
|
|
|
24286
24726
|
* The return value remains valid as long as `value` exists.
|
|
24287
24727
|
* @returns the constant string, UTF-8 encoded
|
|
24288
24728
|
*/
|
|
24289
|
-
get_string(): [ /* returnType */ string
|
|
24729
|
+
get_string(): [ /* returnType */ string, /* length */ number ]
|
|
24290
24730
|
/**
|
|
24291
24731
|
* Gets the contents of an array of strings #GVariant. This call
|
|
24292
24732
|
* makes a shallow copy; the return result should be released with
|
|
@@ -24315,7 +24755,7 @@ interface Variant {
|
|
|
24315
24755
|
* string belongs to #GVariant and must not be freed.
|
|
24316
24756
|
* @returns the type string for the type of @value
|
|
24317
24757
|
*/
|
|
24318
|
-
get_type_string(): string
|
|
24758
|
+
get_type_string(): string
|
|
24319
24759
|
/**
|
|
24320
24760
|
* Returns the 16-bit unsigned integer value of `value`.
|
|
24321
24761
|
*
|
|
@@ -24426,7 +24866,7 @@ interface Variant {
|
|
|
24426
24866
|
* @param expected_type a #GVariantType, or %NULL
|
|
24427
24867
|
* @returns the value of the dictionary key, or %NULL
|
|
24428
24868
|
*/
|
|
24429
|
-
lookup_value(key: string
|
|
24869
|
+
lookup_value(key: string, expected_type: VariantType | null): Variant
|
|
24430
24870
|
/**
|
|
24431
24871
|
* Determines the number of children in a container #GVariant instance.
|
|
24432
24872
|
* This includes variants, maybes, arrays, tuples and dictionary
|
|
@@ -25007,14 +25447,14 @@ class Variant {
|
|
|
25007
25447
|
*/
|
|
25008
25448
|
static new_maybe(child_type: VariantType | null, child: Variant | null): Variant
|
|
25009
25449
|
/**
|
|
25010
|
-
* Creates a D-Bus object path #GVariant with the contents of `
|
|
25011
|
-
* `
|
|
25450
|
+
* Creates a D-Bus object path #GVariant with the contents of `object_path`.
|
|
25451
|
+
* `object_path` must be a valid D-Bus object path. Use
|
|
25012
25452
|
* g_variant_is_object_path() if you're not sure.
|
|
25013
25453
|
* @constructor
|
|
25014
25454
|
* @param object_path a normal C nul-terminated string
|
|
25015
25455
|
* @returns a floating reference to a new object path #GVariant instance
|
|
25016
25456
|
*/
|
|
25017
|
-
static new_object_path(object_path: string
|
|
25457
|
+
static new_object_path(object_path: string): Variant
|
|
25018
25458
|
/**
|
|
25019
25459
|
* Constructs an array of object paths #GVariant from the given array of
|
|
25020
25460
|
* strings.
|
|
@@ -25036,7 +25476,7 @@ class Variant {
|
|
|
25036
25476
|
* @param signature a normal C nul-terminated string
|
|
25037
25477
|
* @returns a floating reference to a new signature #GVariant instance
|
|
25038
25478
|
*/
|
|
25039
|
-
static new_signature(signature: string
|
|
25479
|
+
static new_signature(signature: string): Variant
|
|
25040
25480
|
/**
|
|
25041
25481
|
* Creates a string #GVariant with the contents of `string`.
|
|
25042
25482
|
*
|
|
@@ -25047,7 +25487,7 @@ class Variant {
|
|
|
25047
25487
|
* @param string a normal UTF-8 nul-terminated string
|
|
25048
25488
|
* @returns a floating reference to a new string #GVariant instance
|
|
25049
25489
|
*/
|
|
25050
|
-
static new_string(string: string
|
|
25490
|
+
static new_string(string: string): Variant
|
|
25051
25491
|
/**
|
|
25052
25492
|
* Constructs an array of strings #GVariant from the given array of
|
|
25053
25493
|
* strings.
|
|
@@ -25116,7 +25556,7 @@ class Variant {
|
|
|
25116
25556
|
* @param string a normal C nul-terminated string
|
|
25117
25557
|
* @returns %TRUE if @string is a D-Bus object path
|
|
25118
25558
|
*/
|
|
25119
|
-
static is_object_path(string: string
|
|
25559
|
+
static is_object_path(string: string): boolean
|
|
25120
25560
|
/**
|
|
25121
25561
|
* Determines if a given string is a valid D-Bus type signature. You
|
|
25122
25562
|
* should ensure that a string is a valid D-Bus type signature before
|
|
@@ -25127,7 +25567,7 @@ class Variant {
|
|
|
25127
25567
|
* @param string a normal C nul-terminated string
|
|
25128
25568
|
* @returns %TRUE if @string is a D-Bus type signature
|
|
25129
25569
|
*/
|
|
25130
|
-
static is_signature(string: string
|
|
25570
|
+
static is_signature(string: string): boolean
|
|
25131
25571
|
/**
|
|
25132
25572
|
* Parses a #GVariant from a text representation.
|
|
25133
25573
|
*
|
|
@@ -25170,7 +25610,7 @@ class Variant {
|
|
|
25170
25610
|
* @param endptr a location to store the end pointer, or %NULL
|
|
25171
25611
|
* @returns a non-floating reference to a #GVariant, or %NULL
|
|
25172
25612
|
*/
|
|
25173
|
-
static parse(type: VariantType | null, text: string
|
|
25613
|
+
static parse(type: VariantType | null, text: string, limit: string | null, endptr: string | null): Variant
|
|
25174
25614
|
/**
|
|
25175
25615
|
* Pretty-prints a message showing the context of a #GVariant parse
|
|
25176
25616
|
* error within the string for which parsing was attempted.
|
|
@@ -25209,7 +25649,7 @@ class Variant {
|
|
|
25209
25649
|
* @param source_str the string that was given to the parser
|
|
25210
25650
|
* @returns the printed message
|
|
25211
25651
|
*/
|
|
25212
|
-
static parse_error_print_context(error: Error, source_str: string
|
|
25652
|
+
static parse_error_print_context(error: Error, source_str: string): string | null
|
|
25213
25653
|
static parse_error_quark(): Quark
|
|
25214
25654
|
/**
|
|
25215
25655
|
* Same as g_variant_error_quark().
|
|
@@ -25407,7 +25847,7 @@ interface VariantDict {
|
|
|
25407
25847
|
* @param key the key to look up in the dictionary
|
|
25408
25848
|
* @returns %TRUE if @key is in @dict
|
|
25409
25849
|
*/
|
|
25410
|
-
contains(key: string
|
|
25850
|
+
contains(key: string): boolean
|
|
25411
25851
|
/**
|
|
25412
25852
|
* Returns the current value of `dict` as a #GVariant of type
|
|
25413
25853
|
* %G_VARIANT_TYPE_VARDICT, clearing it in the process.
|
|
@@ -25426,7 +25866,7 @@ interface VariantDict {
|
|
|
25426
25866
|
* @param key the key to insert a value for
|
|
25427
25867
|
* @param value the value to insert
|
|
25428
25868
|
*/
|
|
25429
|
-
insert_value(key: string
|
|
25869
|
+
insert_value(key: string, value: Variant): void
|
|
25430
25870
|
/**
|
|
25431
25871
|
* Looks up a value in a #GVariantDict.
|
|
25432
25872
|
*
|
|
@@ -25443,7 +25883,7 @@ interface VariantDict {
|
|
|
25443
25883
|
* @param expected_type a #GVariantType, or %NULL
|
|
25444
25884
|
* @returns the value of the dictionary key, or %NULL
|
|
25445
25885
|
*/
|
|
25446
|
-
lookup_value(key: string
|
|
25886
|
+
lookup_value(key: string, expected_type: VariantType | null): Variant | null
|
|
25447
25887
|
/**
|
|
25448
25888
|
* Increases the reference count on `dict`.
|
|
25449
25889
|
*
|
|
@@ -25457,7 +25897,7 @@ interface VariantDict {
|
|
|
25457
25897
|
* @param key the key to remove
|
|
25458
25898
|
* @returns %TRUE if the key was found and removed
|
|
25459
25899
|
*/
|
|
25460
|
-
remove(key: string
|
|
25900
|
+
remove(key: string): boolean
|
|
25461
25901
|
/**
|
|
25462
25902
|
* Decreases the reference count on `dict`.
|
|
25463
25903
|
*
|
|
@@ -26067,7 +26507,7 @@ class VariantType {
|
|
|
26067
26507
|
* @param type_string a valid GVariant type string
|
|
26068
26508
|
* @returns a new #GVariantType
|
|
26069
26509
|
*/
|
|
26070
|
-
constructor(type_string: string
|
|
26510
|
+
constructor(type_string: string)
|
|
26071
26511
|
/**
|
|
26072
26512
|
* Creates a new #GVariantType corresponding to the type string given
|
|
26073
26513
|
* by `type_string`. It is appropriate to call g_variant_type_free() on
|
|
@@ -26079,7 +26519,7 @@ class VariantType {
|
|
|
26079
26519
|
* @param type_string a valid GVariant type string
|
|
26080
26520
|
* @returns a new #GVariantType
|
|
26081
26521
|
*/
|
|
26082
|
-
static new(type_string: string
|
|
26522
|
+
static new(type_string: string): VariantType
|
|
26083
26523
|
/**
|
|
26084
26524
|
* Constructs the type corresponding to an array of elements of the
|
|
26085
26525
|
* type `type`.
|
|
@@ -26123,8 +26563,8 @@ class VariantType {
|
|
|
26123
26563
|
* @returns a new tuple #GVariantType Since 2.24
|
|
26124
26564
|
*/
|
|
26125
26565
|
static new_tuple(items: VariantType[]): VariantType
|
|
26126
|
-
static checked_(arg0: string
|
|
26127
|
-
static string_get_depth_(type_string: string
|
|
26566
|
+
static checked_(arg0: string): VariantType
|
|
26567
|
+
static string_get_depth_(type_string: string): number
|
|
26128
26568
|
/**
|
|
26129
26569
|
* Checks if `type_string` is a valid GVariant type string. This call is
|
|
26130
26570
|
* equivalent to calling g_variant_type_string_scan() and confirming
|
|
@@ -26132,7 +26572,7 @@ class VariantType {
|
|
|
26132
26572
|
* @param type_string a pointer to any string
|
|
26133
26573
|
* @returns %TRUE if @type_string is exactly one valid type string Since 2.24
|
|
26134
26574
|
*/
|
|
26135
|
-
static string_is_valid(type_string: string
|
|
26575
|
+
static string_is_valid(type_string: string): boolean
|
|
26136
26576
|
/**
|
|
26137
26577
|
* Scan for a single complete and valid GVariant type string in `string`.
|
|
26138
26578
|
* The memory pointed to by `limit` (or bytes beyond it) is never
|
|
@@ -26151,7 +26591,7 @@ class VariantType {
|
|
|
26151
26591
|
* @param limit the end of `string,` or %NULL
|
|
26152
26592
|
* @returns %TRUE if a valid type string was found
|
|
26153
26593
|
*/
|
|
26154
|
-
static string_scan(string: string
|
|
26594
|
+
static string_scan(string: string, limit: string | null): [ /* returnType */ boolean, /* endptr */ string ]
|
|
26155
26595
|
}
|
|
26156
26596
|
|
|
26157
26597
|
interface DoubleIEEE754 {
|