NetworkManager/src/libnm-std-aux
Thomas Haller 4733cf7460
std-aux: add c_list_is_empty_or_single() helper
Having a list with only one element is often interesting to know. For
example, if you are about to unlink an element, you may want to check
whether afterwards the list is empty.

Add c_list_is_empty_or_single() for that. It is probably more efficient than
plain c_list_length_is(list, 1) and also a better name.
2023-03-08 15:34:47 +01:00
..
c-list-util.c std-aux: add c_list_insert_sorted() 2022-07-28 11:05:14 +02:00
c-list-util.h std-aux: add c_list_is_empty_or_single() helper 2023-03-08 15:34:47 +01:00
meson.build build: remove "shared/" from include search path 2021-02-24 12:49:06 +01:00
nm-dbus-compat.h build: move "shared/nm-std-aux" to "src/libnm-std-aux" 2021-02-24 12:48:24 +01:00
nm-default-std.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-linux-compat.h platform: include "linux-headers" via "libnm-std-aux/nm-linux-compat.h" 2022-07-26 12:28:04 +02:00
nm-networkmanager-compilation.h build: move "shared/nm-std-aux" to "src/libnm-std-aux" 2021-02-24 12:48:24 +01:00
nm-std-aux.h std-aux/trivial: add code comment to NM_IS_IPv4() 2023-03-08 15:34:46 +01:00
nm-std-utils.c build: move "shared/nm-std-aux" to "src/libnm-std-aux" 2021-02-24 12:48:24 +01:00
nm-std-utils.h glib-aux: drop nm_str_buf_init() for NM_STR_BUF_INIT() 2022-05-09 19:18:30 +02:00
README.md all: add some README.md files describing the purpose of our sources 2021-08-19 17:51:11 +02:00
unaligned-fundamental.h systemd: update code from upstream (2023-02-07) 2023-02-08 18:59:33 +01:00
unaligned.h systemd: update code from upstream (2023-02-07) 2023-02-08 18:59:33 +01:00

libnm-std-aux

A static helper library with general purpose helpers on top of standard C (C11).

As this has no additional dependencies, we should have all our C code use this internal helper library. It contains helpers that should be available (and used) everywhere where we write C.

Our C is gnu11, that is C11 or newer with some GCC-ism. The requirement is that it is supported by all complilers we care about (in pratice GCC and Clang).

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