From 0a6a36b297470f1b6529b37aff4c10c387c1d5b7 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Thu, 1 Apr 2021 12:25:48 +0200 Subject: [PATCH] Added macro ZU_STRCMP and ZU_STRTOL. --- src/generic.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/generic.h b/src/generic.h index 7b9c5f5..c8d5b6a 100644 --- a/src/generic.h +++ b/src/generic.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2018 Andrea Zagli + * Copyright (C) 2015-2021 Andrea Zagli * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -77,6 +77,14 @@ gchar *zak_utils_ghashtable_get_gdatetime_format (GHashTable *ht, gconstpointer void zak_utils_ghashtable_copy (GHashTable *ht_source, GHashTable *ht_dest); +#define ZU_STRCMP(str, value) \ + g_strcmp0 (str, value) == 0 + + +#define ZU_STRTOL(str) \ + str == NULL ? 0 : strtol (str, NULL, 10) + + G_END_DECLS -- 2.49.0