b3d2a3a1d7e096b0f97a2a5295d4fa610336de04
angie
  Fri Oct 12 11:02:37 2018 -0700
Adding jsonQuery, which extracts values from a jsonElement tree using a simple path notation e.g. "journals[publisher=Nature].articles[*].author[0].lastName".
aside: slFreeList doesn't check for NULL.  I think it should, but it's used in a zillion places so for now I'll just check before calling.

diff --git src/lib/tests/makefile src/lib/tests/makefile
index 64168e0..e806917 100644
--- src/lib/tests/makefile
+++ src/lib/tests/makefile
@@ -1,31 +1,31 @@
 kentSrc = ../..
 include ../../inc/common.mk
 
 ifeq (${USE_TABIX},1)
     TABIX_TESTS=tabixTest vcfTest
 else
     TABIX_TESTS=
 endif
 
 MYLIBDIR = ../../lib/${MACHTYPE}
 MYLIBS = ${MYLIBDIR}/jkweb.a
 BIN_DIR = bin/${MACHTYPE}
 
 test: errCatchTest htmlPageTest htmlExpandUrlTest pipelineTests dyStringTest \
     mimeTests base64Tests quotedPTests safeTest hashTest fetchUrlTest gff3Test \
-    ${TABIX_TESTS} hacTreeTest testSumDoubles
+    ${TABIX_TESTS} hacTreeTest testSumDoubles jsonQueryTest
 	rm -r output fetchUrlTest testSumDoubles
 	@echo tested all
 
 
 mkdirs:
 	${MKDIR} output ${BIN_DIR}
 
 testSumDoubles: testSumDoubles.o ${MYLIBS}
 	${CC} ${COPT} -o ./testSumDoubles testSumDoubles.o ${MYLIBS} ${L}
 
 errCatchTest: errCatchTest.o ${MYLIBS} mkdirs
 	${CC} ${COPT} -o ${BIN_DIR}/errCatchTest errCatchTest.o ${MYLIBS} ${L}
 	${STRIP} ${BIN_DIR}/errCatchTest${EXE}
 	${BIN_DIR}/errCatchTest secret > output/errCatch.good
 	diff expected/errCatch.good output/errCatch.good
@@ -324,15 +324,25 @@
 
 testOutOfMem: testOutOfMem.o ${MYLIBS} mkdirs
 	${CC} ${COPT} -o ${BIN_DIR}/testOutOfMem testOutOfMem.o ${MYLIBS} ${L}
 	# we expect this to errAbort because we allocate one byte too much beyond limit
 	-${BIN_DIR}/testOutOfMem 100000 1
 
 clean:
 	rm -rf *.o bin output *.tmp mimeTester.tmp mimeTester.out fetchUrlTest fetchUrlViaUdcTest
 
 ${BIN_DIR}/testDecodedString: mkdirs testDecodedString.o ${MYLIBS}
 	${CC} ${COPT} -o ${BIN_DIR}/testDecodedString testDecodedString.o ${MYLIBS} ${L}
 
 testDecodedString:	${BIN_DIR}/testDecodedString mkdirs
 	${BIN_DIR}/testDecodedString -verbose=2 quote this\\ following
 
+# jsonQuery:
+jsonQueryTester=${BIN_DIR}/jsonQueryTest
+jsonQueryTest: ${jsonQueryTester} mkdirs
+	${jsonQueryTester} input/$@Json.txt input/$@Path.txt output/$@.out
+	diff expected/$@.out output/$@.out
+
+${BIN_DIR}/jsonQueryTest: jsonQueryTest.o ${MYLIBS}
+	${MKDIR} ${BIN_DIR}
+	${CC} ${COPT} -o ${BIN_DIR}/jsonQueryTest jsonQueryTest.o ${MYLIBS} ${L}
+