diff options
| author | Michael Biebl <biebl@debian.org> | 2025-02-12 13:46:50 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2025-02-12 13:46:50 +0100 |
| commit | 8bdf070ff046f482f6eb5e2b15ebc216f5d1e3da (patch) | |
| tree | f706478d189d54c6532e8863d4b0d5ff5575af60 /src/libnm-glib-aux/nm-shared-utils.h | |
| parent | 818258cf34b83fbc754633295e1052d4752d7b15 (diff) | |
New upstream version 1.51.90 upstream/1.51.90
Diffstat (limited to 'src/libnm-glib-aux/nm-shared-utils.h')
| -rw-r--r-- | src/libnm-glib-aux/nm-shared-utils.h | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/src/libnm-glib-aux/nm-shared-utils.h b/src/libnm-glib-aux/nm-shared-utils.h index 70f1912e..4fa538e2 100644 --- a/src/libnm-glib-aux/nm-shared-utils.h +++ b/src/libnm-glib-aux/nm-shared-utils.h @@ -137,6 +137,7 @@ typedef enum { NM_LINK_TYPE_IP6GRE, NM_LINK_TYPE_IP6GRETAP, NM_LINK_TYPE_IPIP, + NM_LINK_TYPE_IPVLAN, NM_LINK_TYPE_LOOPBACK, NM_LINK_TYPE_MACSEC, NM_LINK_TYPE_MACVLAN, @@ -279,12 +280,7 @@ typedef struct _NMUtilsIPv6IfaceId { }; } NMUtilsIPv6IfaceId; -#define NM_UTILS_IPV6_IFACE_ID_INIT \ - { \ - { \ - .id = 0 \ - } \ - } +#define NM_UTILS_IPV6_IFACE_ID_INIT {{.id = 0}} /** * nm_utils_ipv6_addr_set_interface_identifier: @@ -1299,6 +1295,12 @@ const char *nm_utils_buf_utf8safe_escape(gconstpointer buf, char **to_free); char * nm_utils_buf_utf8safe_escape_cp(gconstpointer buf, gssize buflen, NMUtilsStrUtf8SafeFlags flags); + +const char *const *nm_utils_buf_utf8safe_escape_strv(const char *const *strv, + gssize strv_len, + NMUtilsStrUtf8SafeFlags flags, + char ***out_to_free); + const char * nm_utils_buf_utf8safe_escape_bytes(GBytes *bytes, NMUtilsStrUtf8SafeFlags flags, char **to_free); gconstpointer nm_utils_buf_utf8safe_unescape(const char *str, @@ -2422,28 +2424,28 @@ int nm_utils_fd_read_loop_exact(int fd, void *buf, size_t nbytes, bool do_po /*****************************************************************************/ #define NM_DEFINE_GDBUS_ARG_INFO_FULL(name_, ...) \ - ((GDBusArgInfo *) (&((const GDBusArgInfo){.ref_count = -1, .name = name_, __VA_ARGS__}))) + ((GDBusArgInfo *) (&((const GDBusArgInfo) {.ref_count = -1, .name = name_, __VA_ARGS__}))) #define NM_DEFINE_GDBUS_ARG_INFO(name_, a_signature) \ NM_DEFINE_GDBUS_ARG_INFO_FULL(name_, .signature = a_signature, ) -#define NM_DEFINE_GDBUS_ARG_INFOS(...) \ - ((GDBusArgInfo **) ((const GDBusArgInfo *[]){ \ - __VA_ARGS__ NULL, \ +#define NM_DEFINE_GDBUS_ARG_INFOS(...) \ + ((GDBusArgInfo **) ((const GDBusArgInfo *[]) { \ + __VA_ARGS__ NULL, \ })) #define NM_DEFINE_GDBUS_PROPERTY_INFO(name_, ...) \ ((GDBusPropertyInfo *) (&( \ - (const GDBusPropertyInfo){.ref_count = -1, .name = name_, __VA_ARGS__}))) + (const GDBusPropertyInfo) {.ref_count = -1, .name = name_, __VA_ARGS__}))) #define NM_DEFINE_GDBUS_PROPERTY_INFO_READABLE(name_, m_signature) \ NM_DEFINE_GDBUS_PROPERTY_INFO(name_, \ .signature = m_signature, \ .flags = G_DBUS_PROPERTY_INFO_FLAGS_READABLE, ) -#define NM_DEFINE_GDBUS_PROPERTY_INFOS(...) \ - ((GDBusPropertyInfo **) ((const GDBusPropertyInfo *[]){ \ - __VA_ARGS__ NULL, \ +#define NM_DEFINE_GDBUS_PROPERTY_INFOS(...) \ + ((GDBusPropertyInfo **) ((const GDBusPropertyInfo *[]) { \ + __VA_ARGS__ NULL, \ })) #define NM_DEFINE_GDBUS_SIGNAL_INFO_INIT(name_, ...) {.ref_count = -1, .name = name_, __VA_ARGS__} @@ -2452,9 +2454,9 @@ int nm_utils_fd_read_loop_exact(int fd, void *buf, size_t nbytes, bool do_po ((GDBusSignalInfo *) (&( \ (const GDBusSignalInfo) NM_DEFINE_GDBUS_SIGNAL_INFO_INIT(name_, __VA_ARGS__)))) -#define NM_DEFINE_GDBUS_SIGNAL_INFOS(...) \ - ((GDBusSignalInfo **) ((const GDBusSignalInfo *[]){ \ - __VA_ARGS__ NULL, \ +#define NM_DEFINE_GDBUS_SIGNAL_INFOS(...) \ + ((GDBusSignalInfo **) ((const GDBusSignalInfo *[]) { \ + __VA_ARGS__ NULL, \ })) #define NM_DEFINE_GDBUS_METHOD_INFO_INIT(name_, ...) {.ref_count = -1, .name = name_, __VA_ARGS__} @@ -2463,9 +2465,9 @@ int nm_utils_fd_read_loop_exact(int fd, void *buf, size_t nbytes, bool do_po ((GDBusMethodInfo *) (&( \ (const GDBusMethodInfo) NM_DEFINE_GDBUS_METHOD_INFO_INIT(name_, __VA_ARGS__)))) -#define NM_DEFINE_GDBUS_METHOD_INFOS(...) \ - ((GDBusMethodInfo **) ((const GDBusMethodInfo *[]){ \ - __VA_ARGS__ NULL, \ +#define NM_DEFINE_GDBUS_METHOD_INFOS(...) \ + ((GDBusMethodInfo **) ((const GDBusMethodInfo *[]) { \ + __VA_ARGS__ NULL, \ })) #define NM_DEFINE_GDBUS_INTERFACE_INFO_INIT(name_, ...) \ @@ -2476,7 +2478,7 @@ int nm_utils_fd_read_loop_exact(int fd, void *buf, size_t nbytes, bool do_po (const GDBusInterfaceInfo) NM_DEFINE_GDBUS_INTERFACE_INFO_INIT(name_, __VA_ARGS__)))) #define NM_DEFINE_GDBUS_INTERFACE_VTABLE(...) \ - ((GDBusInterfaceVTable *) (&((const GDBusInterfaceVTable){__VA_ARGS__}))) + ((GDBusInterfaceVTable *) (&((const GDBusInterfaceVTable) {__VA_ARGS__}))) /*****************************************************************************/ @@ -2498,7 +2500,7 @@ typedef struct _NMUtilsUserData NMUtilsUserData; NMUtilsUserData *_nm_utils_user_data_pack(int nargs, gconstpointer *args); #define nm_utils_user_data_pack(...) \ - _nm_utils_user_data_pack(NM_NARG(__VA_ARGS__), (gconstpointer[]){__VA_ARGS__}) + _nm_utils_user_data_pack(NM_NARG(__VA_ARGS__), (gconstpointer[]) {__VA_ARGS__}) void _nm_utils_user_data_unpack(NMUtilsUserData *user_data, int nargs, ...); @@ -2638,8 +2640,8 @@ int nm_utils_getpagesize(void); /*****************************************************************************/ -extern const char _nm_hexchar_table_lower[16]; -extern const char _nm_hexchar_table_upper[16]; +extern const char _nm_hexchar_table_lower[]; +extern const char _nm_hexchar_table_upper[]; static inline char nm_hexchar(int x, gboolean upper_case) |