summaryrefslogtreecommitdiff
path: root/shared
Commit message (Collapse)AuthorAgeFilesLines
* shared: move nm_utils_ascii_str_to_bool() to shared/nm-shared-utils.hThomas Haller2016-04-192-0/+37
|
* shared: add _nm_packed macro for __attribute__((packed))Thomas Haller2016-04-111-1/+3
|
* nmtst: add nmtst_platform_ip4_address() utilThomas Haller2016-04-111-0/+47
|
* nmtst: add nmtst_rand_buf() utilThomas Haller2016-04-111-0/+28
|
* release: bump version to 1.3.0 (development)1.3.0-devLubomir Rintel2016-04-051-2/+2
|
* release: add version 1.4 macrosLubomir Rintel2016-04-051-0/+1
|
* build: disable deprecation checks for internal compilationThomas Haller2016-04-051-0/+6
| | | | | | | | | | | | For internal compilation we want to be able to use deprecated API without warnings. Define the version min/max macros to effectively disable deprecation warnings. However, don't do it via CFLAGS option in the makefiles, instead hack it to "nm-default.h". After all, *every* source file that is for internal compilation needs to include this header as first.
* shared: add nm_g_object_set_property()Thomas Haller2016-03-262-0/+99
|
* shared: move NM_UTILS_ERROR to shared-utilsThomas Haller2016-03-262-0/+58
| | | | | | | | | | NM_UTILS_ERROR is our way to say, that we don't care about the GError domain and code. nmcli sometimes passes domain "1" and code "0" to g_set_error(), which could be considered a bug. We usually don't care about the error but only about the error message, so let's have a universally available error quark around.
* shared: move _nm_utils_ascii_str_to_int64() to "shared/nm-shared-utils.h"Thomas Haller2016-03-262-0/+82
| | | | | | | | | | _nm_utils_ascii_str_to_int64() was declared in libnm-core's internal header "nm-core-internal.h" and thus available for libnm-core, libnm, NetworkManager and related. It also means, the function was not available in libnm-util, libnm-glib, clients or dispatcher. So, we either reimplemented it (nmc_string_to_int_base) or struggle with the awkward strtol* API.
* shared: include "nm-shared-utils.h"Thomas Haller2016-03-261-0/+1
| | | | Include it via "nm-default.h" to all projects.
* shared: add "nm-shared-utils"Thomas Haller2016-03-263-0/+54
|
* shared: add nm_auto_unset_gvalue macroThomas Haller2016-03-261-0/+7
|
* nmtst: add nmtst_variant_new_vardict() functionThomas Haller2016-03-261-0/+21
|
* nmtst: fix memleak when using NMTST_VARIANT_DROP_SETTING()Thomas Haller2016-03-261-0/+2
|
* shared: include <stdlib.h> in "nm-macros-internal.h"Thomas Haller2016-03-241-0/+2
| | | | | | | | "nm-macros-internal.h" uses free() for the "nm_auto_free" macro. Thus, as long as that code is there, we anyway must include <stdlib.h> along the line. Do it in "nm-macros-internal.h" to make the header self-contained.
* shared: add nm_unauto() helper macroThomas Haller2016-03-171-0/+12
|
* shared: add nm_assert_not_reached()Thomas Haller2016-03-171-0/+2
|
* nmtst: add NMTST_DEBUG option "D"Thomas Haller2016-03-151-1/+8
|
* shared: add nm_g_object_ref() and nm_g_object_unref() functionThomas Haller2016-03-131-0/+20
|
* nmtst: add nmtst_main_loop_quit_on_notify functionThomas Haller2016-03-101-0/+12
|
* nmtst: add nmtst_assert_variant_*() helper macrosThomas Haller2016-03-101-0/+28
|
* nmtst: convert nmtst_assert_error() to a macro to preserve func:line informationThomas Haller2016-03-041-17/+18
| | | | | Within the macro, the assertion print the proper location of where the failure happens, instead of pointing to "nm-test-utils.h".
* all: clean-up usage of GErrorThomas Haller2016-03-031-1/+1
| | | | | | | | | | | Functions that take a GError** MUST fill it in on error. There is no need to check whether error is NULL if the function it was passed to had a failing return value. Likewise, a proper GError must have a non-NULL message, so there's no need to double-check that either. Based-on-patch-by: Dan Winship <danw@gnome.org>
* shared: add NM_G_ERROR_MSG()Thomas Haller2016-03-031-0/+20
|
* platform/trivial: rename NMPlatformIP6Address's "flags" field to "n_ifa_flags"Thomas Haller2016-02-291-1/+1
| | | | | | There are far too many "flags". Rename the "flags" to "n_ifa_flags" which reminds to "ifa_flags" in 'struct ifaddrmsg', but with a distinctive "n_" prefix.
* platform: adjust type of IPv6 address flags to guintThomas Haller2016-02-291-1/+1
| | | | | | | Address flags inside 'struct ifaddrmsg' are uint8_t and they are extended to uint32_t via IFA_FLAGS. Change it to be guint32.
* macros: add nm_auto() macro to cleanup functionsThomas Haller2016-02-291-1/+3
|
* nm-glib: backport g_info() macroThomas Haller2016-02-241-0/+7
|
* macros: split macro NM_GOBJECT_PROPERTIES_DEFINE() in twoThomas Haller2016-02-191-2/+5
| | | | | Sometimes we don't need the _notify() helper which results in a unused-function warning.
* all: cleanup includes and let "nm-default.h" include "config.h"Thomas Haller2016-02-192-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - All internal source files (except "examples", which are not internal) should include "config.h" first. As also all internal source files should include "nm-default.h", let "config.h" be included by "nm-default.h" and include "nm-default.h" as first in every source file. We already wanted to include "nm-default.h" before other headers because it might contains some fixes (like "nm-glib.h" compatibility) that is required first. - After including "nm-default.h", we optinally allow for including the corresponding header file for the source file at hand. The idea is to ensure that each header file is self contained. - Don't include "config.h" or "nm-default.h" in any header file (except "nm-sd-adapt.h"). Public headers anyway must not include these headers, and internal headers are never included after "nm-default.h", as of the first previous point. - Include all internal headers with quotes instead of angle brackets. In practice it doesn't matter, because in our public headers we must include other headers with angle brackets. As we use our public headers also to compile our interal source files, effectively the result must be the same. Still do it for consistency. - Except for <config.h> itself. Include it with angle brackets as suggested by https://www.gnu.org/software/autoconf/manual/autoconf.html#Configuration-Headers
* shared: fix nm_sprintf_buf() macro to allow plain stringThomas Haller2016-02-191-2/+2
| | | | | Use non-portable gcc extension to allow for zero variadic arguments so that you can pass a plain string as argument.
* shared: move definition of "bool" to nm-macros-internal.hThomas Haller2016-02-162-47/+47
| | | | | | | | "nm-default.h" should only include all the relevant header files based on NETWORKMANAGER_COMPILATION. It should not contain definitions on it's own. Move the definition of "bool" to "nm-macros-internal.h".
* macros: add nm_auto_free macroThomas Haller2016-02-162-1/+11
| | | | | Similar to gs_free to cleanup pointers with free(). Note that g_free() and free() cannot be used interchangably.
* shared: add nm_streq() and nm_streq0() macroThomas Haller2016-02-151-0/+5
| | | | | | | | | | | | | Using strcmp() to test for string equality is a well known pattern. However the inverse logic still is still hard to grasp especially in more complex expressions. nm_streq() should is an alternative to use strcmp(). And there is a counterpart nm_streq0() which is based on g_strcmp0(). Kernel and systemd have also similar streq() macros. https://mail.gnome.org/archives/networkmanager-list/2016-February/msg00047.html
* nmtst: drop deprecated test helper macro ASSERT()Thomas Haller2016-02-151-8/+0
| | | | It's no longer used.
* nmtst: add nmtst_assert_connection_verify() and don't normalize connection ↵Thomas Haller2016-02-151-31/+43
| | | | | | | in assert It is ugly that nmtst_assert_connection_verifies_after_normalization() would normalize the argument and modify it. An assertion should not have side-effects.
* nmtst: add nmtst_assert_no_success() macroThomas Haller2016-02-141-0/+6
|
* all/trivial: rename STRLEN() macro to NM_STRLEN()Thomas Haller2016-02-141-1/+1
| | | | | | | We should not have defines/macros in header files without a nm/NM prefix. STRLEN() was one of the few offenders. https://mail.gnome.org/archives/networkmanager-list/2016-February/msg00048.html
* build: cleanup default includesThomas Haller2016-02-122-2/+3
| | | | | | | | | | | | | | | | | | | - "gsystem-local-alloc.h" and <gio/gio.h> are already included via "nm-default.h". No need to include them separately. - include "nm-macros-internal.h" via "nm-default.h" and drop all explict includes. - in the modified files, ensure that we always include "config.h" and "nm-default.h" first. As second, include the header file for the current source file (if applicable). Then follow external includes and finally internal nm includes. - include nm headers inside source code files with quotes - internal header files don't need to include default headers. They can savely assume that "nm-default.h" is already included and with it glib, nm-glib.h, nm-macros-internal.h, etc.
* test: use g_assert_not_reached () instead of asserting FALSELubomir Rintel2016-02-121-2/+2
| | | | | | | | | | It's declared as never returning, making do a better at understanding control flow. Otherwise it makes a poor guess: In file included from test-crypto.c:37: ../../shared/nm-test-utils.h:1344:3: error: variable 'family' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] g_assert (FALSE); ^~~~~~~~~~~~~~~~
* nmtst: introduce nmtst_setting_ip_config_add_{address,route} helpersBeniamino Galvani2016-02-111-0/+50
|
* build: define g_assert_cmpmem() for glib < 2.46Dan Williams2016-02-111-0/+14
| | | | Fixes: b73c0e2f6ddf1d5d25efca3b2910d53848055701
* macros: add NM_IN_STRSET()Thomas Haller2016-02-111-0/+65
| | | | | Add macro similar to NM_IN_SET() that checks for C strings. NULL values are allowed and handled as one would expect.
* macros: simplify NM_IN_SET() macroThomas Haller2016-02-111-46/+43
| | | | Also fix NM_IN_SET_SE() to guaranteed return 0 or 1.
* tests: get rid of FAIL macroDan Williams2016-02-111-7/+1
|
* nmtst: drop details argument from add-test helperThomas Haller2016-02-101-12/+5
|
* nmtst: fix nmtst_test_data_unpack() macroThomas Haller2016-02-091-1/+1
| | | | Fixes: e6244814eb82d0c036a506e204878c0c9ccdac72
* nmtst: add nmtst_add_test_func() helper to schedule tests with argumentsThomas Haller2016-02-031-0/+83
|
* nmtst: don't use G_STRLOC in test functionsThomas Haller2016-02-031-4/+4
| | | | | Instead pass separate values for file and line. Otherwise, we create a unique string for each occurance.