NetworkManager/src/libnm-glib-aux
Thomas Haller ffd8baa49f
all: use nm_g_array_{index,first,last,index_p}() instead of g_array_index()
These variants provide additional nm_assert() checks, and are thus
preferable.

Note that we cannot just blindly replace &g_array_index() with
&nm_g_array_index(), because the latter would not allow getting a
pointer at index [arr->len]. That might be a valid (though uncommon)
usecase. The correct replacement of &g_array_index() is thus
nm_g_array_index_p().

I checked the code manually and replaced uses of nm_g_array_index_p()
with &nm_g_array_index(), if that was a safe thing to do. The latter
seems preferable, because it is familar to &g_array_index().
2022-09-15 12:39:07 +02:00
..
tests glib-aux: add nm_g_array_index() macro and improve nm_g_array_index_p() macros 2022-09-15 12:39:06 +02:00
meson.build glib-aux: add "libnm-glib-aux/nm-inet-utils.h" 2022-08-25 19:05:46 +02:00
nm-c-list.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-dbus-aux.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-dbus-aux.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-dedup-multi.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-dedup-multi.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-default-glib-i18n-lib.h build: move "shared/nm-{glib-aux,log-null,log-core}" to "src/libnm-{glib-aux,log-null,log-core}" 2021-02-24 12:48:20 +01:00
nm-default-glib-i18n-prog.h build: move "shared/nm-{glib-aux,log-null,log-core}" to "src/libnm-{glib-aux,log-null,log-core}" 2021-02-24 12:48:20 +01:00
nm-default-glib.h glib-aux: move inet related helpers to "nm-inet-utils.h" 2022-08-25 19:05:51 +02:00
nm-enum-utils.c glib-aux: fix nicks for zero flag in nm_utils_enum_to_str() 2022-08-25 23:07:44 +02:00
nm-enum-utils.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-errno.c platform/netlink: add nlmsg_parse_error() helper 2022-08-09 08:02:40 +02:00
nm-errno.h platform/netlink: add nlmsg_parse_error() helper 2022-08-09 08:02:40 +02:00
nm-gassert-patch.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-glib.h glib-aux: add g_ptr_array_find() compat routine 2022-06-15 12:13:26 +02:00
nm-hash-utils.c glib-aux: rework random number utils 2022-08-05 19:29:34 +02:00
nm-hash-utils.h glib-aux: use unsigned long literals in NM_HASH_COMBINE_BOOLS() macro 2022-08-04 11:05:33 +02:00
nm-inet-utils.c glib-aux/trivial: fix typo in comment 2022-08-31 19:20:10 +02:00
nm-inet-utils.h glib-aux: add "NM_IPV4LO_NETWORK" defines and similar 2022-09-08 19:42:01 +02:00
nm-io-utils.c glib-aux: add nm_parse_env_file() helpers for parsing systemd's env-files 2022-04-14 14:51:02 +02:00
nm-io-utils.h glib-aux: add nm_parse_env_file() helpers for parsing systemd's env-files 2022-04-14 14:51:02 +02:00
nm-jansson.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-json-aux.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-json-aux.h libnm: add direct strv type for NMSetting and use it for "match.interface-name" 2022-02-10 22:30:27 +01:00
nm-keyfile-aux.c glib-aux/trivial: fix typo in code comment 2022-09-09 16:21:53 +02:00
nm-keyfile-aux.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-logging-base.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-logging-base.h glib-aux,cloud-setup: add _nm_logging_enabled*() helper API 2021-07-23 16:43:37 +02:00
nm-logging-fwd.h glib-aux/logging: add LOGD_DHCP_af() helper macro 2022-05-31 18:32:33 +02:00
nm-logging-syslog.h shared: split and move "nm-vpn-plugin-macros.h" 2021-02-24 12:48:56 +01:00
nm-macros-internal.h std-aux: add argument to "op" parameter for NM_VA_ARGS_FOREACH() macro 2022-07-28 13:06:08 +02:00
nm-obj.h build: move "shared/nm-{glib-aux,log-null,log-core}" to "src/libnm-{glib-aux,log-null,log-core}" 2021-02-24 12:48:20 +01:00
nm-random-utils.c glib-aux: rework random number utils 2022-08-05 19:29:34 +02:00
nm-random-utils.h glib-aux: rework random number utils 2022-08-05 19:29:34 +02:00
nm-ref-string.c glib-aux: add nmtst_ref_string_find() helper 2022-01-18 16:22:36 +01:00
nm-ref-string.h glib-aux/trivial: fix typo in code comment 2022-05-16 16:32:21 +02:00
nm-secret-utils.c crypto: move nm_crypto_read_file() to "libnm-glib-aux" 2022-03-29 11:56:04 +02:00
nm-secret-utils.h crypto: move nm_crypto_read_file() to "libnm-glib-aux" 2022-03-29 11:56:04 +02:00
nm-shared-utils.c glib-aux: rename IP address related helpers from "nm-inet-utils.h" 2022-08-25 19:05:51 +02:00
nm-shared-utils.h all: use nm_g_array_{index,first,last,index_p}() instead of g_array_index() 2022-09-15 12:39:07 +02:00
nm-str-buf.h glib-aux: fix spurious semicolon after NM_STR_BUF_INIT() macros 2022-08-31 19:20:10 +02:00
nm-test-utils.h all: use nm_g_array_{index,first,last,index_p}() instead of g_array_index() 2022-09-15 12:39:07 +02:00
nm-time-utils.c build: move "shared/nm-{glib-aux,log-null,log-core}" to "src/libnm-{glib-aux,log-null,log-core}" 2021-02-24 12:48:20 +01:00
nm-time-utils.h glib-aux: add nm_utils_get_monotonic_timestamp_sec_cached() helper 2022-04-08 15:59:47 +02:00
nm-uuid.c glib-aux: first try stack allocated temporary buffer in nm_uuid_generate_from_strings() 2022-08-31 19:20:10 +02:00
nm-uuid.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-value-type.h libnm: add direct strv type for NMSetting and use it for "match.interface-name" 2022-02-10 22:30:27 +01:00
README.md all: add some README.md files describing the purpose of our sources 2021-08-19 17:51:11 +02:00

libnm-glib-aux

A static helper library with general purpose helpers on top of glib.

This is similar to libnm-std-aux (on which this library depends). The difference is that libnm-std-aux only requires standard C (C11), while this has a dependency on glib.

As this has no additional dependencies, we should have all our glib code use this internal helper library. It contains helpers that should be available (and used) in all our C/glib applications/libraries.

Parts of this library are usually already included via the nm-default*.h headers.