Skip to contentSkip to conversation

ndctl: add the ciniparser tool from ccan

PATCH Superseded QI Fuli 1 participant 2 messages Dec 19, 2018

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

QI Fuli

author
#0 lore raw

PATCH 1/2 ndctl: add the ciniparser tool from ccan

Import ciniparser tool from ccan [1], therefore, the ndctl monitor can read the configuration file by using this library.

[1]: https://ccodearchive.net/info/ciniparser.html

---
 Makefile.am                  |   6 +-
 ccan/ciniparser/LICENSE      |   1 +
 ccan/ciniparser/ciniparser.c | 480 +++++++++++++++++++++++++++++++++++
 ccan/ciniparser/ciniparser.h | 262 +++++++++++++++++++
 ccan/ciniparser/dictionary.c | 266 +++++++++++++++++++
 ccan/ciniparser/dictionary.h | 166 ++++++++++++
 6 files changed, 1180 insertions(+), 1 deletion(-)
 create mode 120000 ccan/ciniparser/LICENSE
 create mode 100644 ccan/ciniparser/ciniparser.c
 create mode 100644 ccan/ciniparser/ciniparser.h
 create mode 100644 ccan/ciniparser/dictionary.c
 create mode 100644 ccan/ciniparser/dictionary.h
Makefile.am +5 -1
index e0c463a..2e4b033 100644
@@ -56,7 +56,11 @@ libccan_a_SOURCES = \
 	ccan/array_size/array_size.h \
 	ccan/minmax/minmax.h \
 	ccan/short_types/short_types.h \
-	ccan/endian/endian.h
+	ccan/endian/endian.h \
+	ccan/ciniparser/ciniparser.h \
+	ccan/ciniparser/ciniparser.c \
+	ccan/ciniparser/dictionary.h \
+	ccan/ciniparser/dictionary.c
 
 noinst_LIBRARIES += libutil.a
 libutil_a_SOURCES = \
ccan/ciniparser/LICENSE new file +1 -0
new file mode 120000
index 0000000..2354d12
@@ -0,0 +1 @@
+../../licenses/BSD-MIT
\ No newline at end of file
ccan/ciniparser/ciniparser.c new file +480 -0

480 lines not on this page · raw message

ccan/ciniparser/ciniparser.h new file +262 -0

262 lines not on this page · raw message

ccan/ciniparser/dictionary.c new file +266 -0

266 lines not on this page · raw message

ccan/ciniparser/dictionary.h new file +166 -0

166 lines not on this page · raw message

Signature · 7 lines
2.20.0.rc2


_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
author
#1 lore raw

PATCH 2/2 ndctl, monitor: refactor parse_config_file

This patch is used for refactoring parse_config_file by replacing the open coded implementation with ccan/ciniparser library.

---
 ndctl/Makefile.am  |   1 +
 ndctl/monitor.c    | 114 ++++++++++++---------------------------------
 ndctl/monitor.conf |   2 +
 3 files changed, 32 insertions(+), 85 deletions(-)
ndctl/Makefile.am +1 -0
index 8a5e5f8..3da1c0e 100644
@@ -28,6 +28,7 @@ ndctl_LDADD =\
 	lib/libndctl.la \
 	../daxctl/lib/libdaxctl.la \
 	../libutil.a \
+	../libccan.a \
 	$(UUID_LIBS) \
 	$(KMOD_LIBS) \
 	$(JSON_LIBS)
ndctl/monitor.c +29 -85

146 lines not on this page · raw message

ndctl/monitor.conf +2 -0
index 934e2c0..edcf8e2 100644
@@ -9,6 +9,8 @@
 # Multiple space-separated values are allowed, but except the following
 # characters: : ? / \ % " ' $ & ! * { } [ ] ( ) = < > @
 
+[monitor]
+
 # The objects to monitor are filtered via dimm's name by setting key "dimm".
 # If this value is different from the value of [--dimm=<value>] option,
 # both of the values will work.
Signature · 7 lines
2.20.0.rc2


_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm