changeset 822:f8d9ccf26563

nvl: add nvl_lookup_val to easily get at the struct val pointer value Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Fri, 30 Oct 2020 17:57:53 -0400
parents cbde4a6170af
children ccb955138113
files include/jeffpc/nvl.h mapfile-vers nvl.c
diffstat 3 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/include/jeffpc/nvl.h	Fri Oct 30 17:51:11 2020 -0400
+++ b/include/jeffpc/nvl.h	Fri Oct 30 17:57:53 2020 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2018 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
+ * Copyright (c) 2017-2020 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -151,6 +151,7 @@
 extern const struct nvpair *nvl_lookup(struct nvlist *nvl, const char *name);
 extern struct nvlist *nvl_lookup_nvl(struct nvlist *nvl, const char *name);
 extern struct str *nvl_lookup_str(struct nvlist *nvl, const char *name);
+extern struct val *nvl_lookup_val(struct nvlist *nvl, const char *name);
 
 /*
  * Add a new key-value pair or change the value of an existing key-value
--- a/mapfile-vers	Fri Oct 30 17:51:11 2020 -0400
+++ b/mapfile-vers	Fri Oct 30 17:57:53 2020 -0400
@@ -170,6 +170,7 @@
 		nvl_lookup_null;
 		nvl_lookup_nvl;
 		nvl_lookup_str;
+		nvl_lookup_val;
 		nvl_merge;
 		nvl_set;
 		nvl_set_array;
--- a/nvl.c	Fri Oct 30 17:51:11 2020 -0400
+++ b/nvl.c	Fri Oct 30 17:57:53 2020 -0400
@@ -114,6 +114,7 @@
 
 LOOKUP_PTR(nvl_lookup_nvl, struct nvlist *, nvpair_value_nvl);
 LOOKUP_PTR(nvl_lookup_str, struct str *, nvpair_value_str);
+LOOKUP_PTR(nvl_lookup_val, struct val *, nvpair_value);
 
 /*
  * nvlist set