gtl-parsley-ruby 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +3 -0
- data/README +32 -0
- data/Rakefile +57 -0
- data/VERSION +1 -0
- data/ext/cparsley.c +152 -0
- data/ext/extconf.rb +82 -0
- data/ext/parsley/.gitignore +32 -0
- data/ext/parsley/AUTHORS +1 -0
- data/ext/parsley/ChangeLog +0 -0
- data/ext/parsley/HACKING +4 -0
- data/ext/parsley/INSTALL +73 -0
- data/ext/parsley/INTRO +84 -0
- data/ext/parsley/Makefile.am +80 -0
- data/ext/parsley/Makefile.in +1009 -0
- data/ext/parsley/NEWS +0 -0
- data/ext/parsley/PAPER +36 -0
- data/ext/parsley/Portfile +18 -0
- data/ext/parsley/Portfile.in +17 -0
- data/ext/parsley/README.C-LANG +92 -0
- data/ext/parsley/README.markdown +1 -0
- data/ext/parsley/TODO +39 -0
- data/ext/parsley/VERSION +1 -0
- data/ext/parsley/aclocal.m4 +8918 -0
- data/ext/parsley/bootstrap.sh +6 -0
- data/ext/parsley/config.guess +1561 -0
- data/ext/parsley/config.sub +1686 -0
- data/ext/parsley/configure +13437 -0
- data/ext/parsley/configure.ac +46 -0
- data/ext/parsley/depcomp +630 -0
- data/ext/parsley/functions.c +368 -0
- data/ext/parsley/functions.h +19 -0
- data/ext/parsley/generate_bisect.sh +12 -0
- data/ext/parsley/hooks/prepare-commit-msg +16 -0
- data/ext/parsley/install-sh +520 -0
- data/ext/parsley/json-c-0.9/AUTHORS +2 -0
- data/ext/parsley/json-c-0.9/COPYING +19 -0
- data/ext/parsley/json-c-0.9/ChangeLog +103 -0
- data/ext/parsley/json-c-0.9/INSTALL +302 -0
- data/ext/parsley/json-c-0.9/Makefile.am +43 -0
- data/ext/parsley/json-c-0.9/Makefile.in +800 -0
- data/ext/parsley/json-c-0.9/NEWS +1 -0
- data/ext/parsley/json-c-0.9/README +20 -0
- data/ext/parsley/json-c-0.9/README-WIN32.html +57 -0
- data/ext/parsley/json-c-0.9/README.html +32 -0
- data/ext/parsley/json-c-0.9/aclocal.m4 +8909 -0
- data/ext/parsley/json-c-0.9/arraylist.c +94 -0
- data/ext/parsley/json-c-0.9/arraylist.h +53 -0
- data/ext/parsley/json-c-0.9/bits.h +27 -0
- data/ext/parsley/json-c-0.9/config.guess +1561 -0
- data/ext/parsley/json-c-0.9/config.h +125 -0
- data/ext/parsley/json-c-0.9/config.h.in +124 -0
- data/ext/parsley/json-c-0.9/config.h.win32 +94 -0
- data/ext/parsley/json-c-0.9/config.sub +1686 -0
- data/ext/parsley/json-c-0.9/configure +13084 -0
- data/ext/parsley/json-c-0.9/configure.in +33 -0
- data/ext/parsley/json-c-0.9/debug.c +98 -0
- data/ext/parsley/json-c-0.9/debug.h +50 -0
- data/ext/parsley/json-c-0.9/depcomp +630 -0
- data/ext/parsley/json-c-0.9/doc/html/annotated.html +40 -0
- data/ext/parsley/json-c-0.9/doc/html/arraylist_8h.html +240 -0
- data/ext/parsley/json-c-0.9/doc/html/bits_8h.html +150 -0
- data/ext/parsley/json-c-0.9/doc/html/classes.html +36 -0
- data/ext/parsley/json-c-0.9/doc/html/config_8h.html +612 -0
- data/ext/parsley/json-c-0.9/doc/html/debug_8h.html +392 -0
- data/ext/parsley/json-c-0.9/doc/html/doxygen.css +441 -0
- data/ext/parsley/json-c-0.9/doc/html/doxygen.png +0 -0
- data/ext/parsley/json-c-0.9/doc/html/files.html +42 -0
- data/ext/parsley/json-c-0.9/doc/html/functions.html +206 -0
- data/ext/parsley/json-c-0.9/doc/html/functions_vars.html +206 -0
- data/ext/parsley/json-c-0.9/doc/html/globals.html +459 -0
- data/ext/parsley/json-c-0.9/doc/html/globals_defs.html +202 -0
- data/ext/parsley/json-c-0.9/doc/html/globals_enum.html +50 -0
- data/ext/parsley/json-c-0.9/doc/html/globals_eval.html +135 -0
- data/ext/parsley/json-c-0.9/doc/html/globals_func.html +194 -0
- data/ext/parsley/json-c-0.9/doc/html/globals_type.html +70 -0
- data/ext/parsley/json-c-0.9/doc/html/globals_vars.html +50 -0
- data/ext/parsley/json-c-0.9/doc/html/index.html +25 -0
- data/ext/parsley/json-c-0.9/doc/html/json_8h.html +32 -0
- data/ext/parsley/json-c-0.9/doc/html/json__object_8h.html +1150 -0
- data/ext/parsley/json-c-0.9/doc/html/json__object__private_8h.html +75 -0
- data/ext/parsley/json-c-0.9/doc/html/json__tokener_8h.html +366 -0
- data/ext/parsley/json-c-0.9/doc/html/json__util_8h.html +106 -0
- data/ext/parsley/json-c-0.9/doc/html/linkhash_8h.html +740 -0
- data/ext/parsley/json-c-0.9/doc/html/printbuf_8h.html +214 -0
- data/ext/parsley/json-c-0.9/doc/html/structarray__list.html +104 -0
- data/ext/parsley/json-c-0.9/doc/html/structjson__object.html +141 -0
- data/ext/parsley/json-c-0.9/doc/html/structjson__object__iter.html +87 -0
- data/ext/parsley/json-c-0.9/doc/html/structjson__tokener.html +206 -0
- data/ext/parsley/json-c-0.9/doc/html/structjson__tokener__srec.html +104 -0
- data/ext/parsley/json-c-0.9/doc/html/structlh__entry.html +105 -0
- data/ext/parsley/json-c-0.9/doc/html/structlh__table.html +275 -0
- data/ext/parsley/json-c-0.9/doc/html/structprintbuf.html +87 -0
- data/ext/parsley/json-c-0.9/doc/html/tab_b.gif +0 -0
- data/ext/parsley/json-c-0.9/doc/html/tab_l.gif +0 -0
- data/ext/parsley/json-c-0.9/doc/html/tab_r.gif +0 -0
- data/ext/parsley/json-c-0.9/doc/html/tabs.css +105 -0
- data/ext/parsley/json-c-0.9/doc/html/unionjson__object_1_1data.html +140 -0
- data/ext/parsley/json-c-0.9/install-sh +520 -0
- data/ext/parsley/json-c-0.9/json.h +31 -0
- data/ext/parsley/json-c-0.9/json.pc +11 -0
- data/ext/parsley/json-c-0.9/json.pc.in +11 -0
- data/ext/parsley/json-c-0.9/json_object.c +512 -0
- data/ext/parsley/json-c-0.9/json_object.h +319 -0
- data/ext/parsley/json-c-0.9/json_object_private.h +52 -0
- data/ext/parsley/json-c-0.9/json_tokener.c +628 -0
- data/ext/parsley/json-c-0.9/json_tokener.h +98 -0
- data/ext/parsley/json-c-0.9/json_util.c +122 -0
- data/ext/parsley/json-c-0.9/json_util.h +31 -0
- data/ext/parsley/json-c-0.9/libjson.la +41 -0
- data/ext/parsley/json-c-0.9/libtool +8890 -0
- data/ext/parsley/json-c-0.9/linkhash.c +216 -0
- data/ext/parsley/json-c-0.9/linkhash.h +272 -0
- data/ext/parsley/json-c-0.9/ltmain.sh +8406 -0
- data/ext/parsley/json-c-0.9/missing +376 -0
- data/ext/parsley/json-c-0.9/printbuf.c +149 -0
- data/ext/parsley/json-c-0.9/printbuf.h +64 -0
- data/ext/parsley/json-c-0.9/stamp-h1 +1 -0
- data/ext/parsley/json-c-0.9/test1 +130 -0
- data/ext/parsley/json-c-0.9/test1.c +164 -0
- data/ext/parsley/json-c-0.9/test2 +130 -0
- data/ext/parsley/json-c-0.9/test2.c +20 -0
- data/ext/parsley/json-c-0.9/test3 +130 -0
- data/ext/parsley/json-c-0.9/test3.c +23 -0
- data/ext/parsley/libtool +8890 -0
- data/ext/parsley/ltmain.sh +8406 -0
- data/ext/parsley/missing +376 -0
- data/ext/parsley/parsed_xpath.c +168 -0
- data/ext/parsley/parsed_xpath.h +34 -0
- data/ext/parsley/parser.y +631 -0
- data/ext/parsley/parsley.c +793 -0
- data/ext/parsley/parsley.h +87 -0
- data/ext/parsley/parsley_main.c +185 -0
- data/ext/parsley/parsleyc_main.c +108 -0
- data/ext/parsley/regexp.c +359 -0
- data/ext/parsley/regexp.h +36 -0
- data/ext/parsley/scanner.l +221 -0
- data/ext/parsley/test/ambiguous.html +207 -0
- data/ext/parsley/test/ambiguous.json +1 -0
- data/ext/parsley/test/ambiguous.let +6 -0
- data/ext/parsley/test/array-regression.html +5 -0
- data/ext/parsley/test/array-regression.json +1 -0
- data/ext/parsley/test/array-regression.let +10 -0
- data/ext/parsley/test/backslash.html +5 -0
- data/ext/parsley/test/backslash.json +1 -0
- data/ext/parsley/test/backslash.let +3 -0
- data/ext/parsley/test/bang.html +17 -0
- data/ext/parsley/test/bang.json +1 -0
- data/ext/parsley/test/bang.let +6 -0
- data/ext/parsley/test/collate_regression.html +324 -0
- data/ext/parsley/test/collate_regression.json +1 -0
- data/ext/parsley/test/collate_regression.let +9 -0
- data/ext/parsley/test/contains.html +3 -0
- data/ext/parsley/test/contains.json +1 -0
- data/ext/parsley/test/contains.let +3 -0
- data/ext/parsley/test/content.html +13 -0
- data/ext/parsley/test/content.json +1 -0
- data/ext/parsley/test/content.let +7 -0
- data/ext/parsley/test/cool.html +575 -0
- data/ext/parsley/test/cool.json +1 -0
- data/ext/parsley/test/cool.let +9 -0
- data/ext/parsley/test/craigs-simple.html +207 -0
- data/ext/parsley/test/craigs-simple.json +1 -0
- data/ext/parsley/test/craigs-simple.let +6 -0
- data/ext/parsley/test/craigs.html +207 -0
- data/ext/parsley/test/craigs.json +1 -0
- data/ext/parsley/test/craigs.let +9 -0
- data/ext/parsley/test/crash.html +157 -0
- data/ext/parsley/test/crash.json +1 -0
- data/ext/parsley/test/crash.let +1 -0
- data/ext/parsley/test/css_attr.html +3 -0
- data/ext/parsley/test/css_attr.json +1 -0
- data/ext/parsley/test/css_attr.let +3 -0
- data/ext/parsley/test/default-namespace.json +1 -0
- data/ext/parsley/test/default-namespace.let +3 -0
- data/ext/parsley/test/default-namespace.xml +1493 -0
- data/ext/parsley/test/div.html +8 -0
- data/ext/parsley/test/div.json +1 -0
- data/ext/parsley/test/div.let +10 -0
- data/ext/parsley/test/empty.html +3 -0
- data/ext/parsley/test/empty.json +1 -0
- data/ext/parsley/test/empty.let +1 -0
- data/ext/parsley/test/emptyish.html +207 -0
- data/ext/parsley/test/emptyish.let +3 -0
- data/ext/parsley/test/fictional-opt.html +43 -0
- data/ext/parsley/test/fictional-opt.json +1 -0
- data/ext/parsley/test/fictional-opt.let +14 -0
- data/ext/parsley/test/fictional.html +43 -0
- data/ext/parsley/test/fictional.json +1 -0
- data/ext/parsley/test/fictional.let +14 -0
- data/ext/parsley/test/function-magic.html +9 -0
- data/ext/parsley/test/function-magic.json +1 -0
- data/ext/parsley/test/function-magic.let +8 -0
- data/ext/parsley/test/hn.html +32 -0
- data/ext/parsley/test/hn.json +1 -0
- data/ext/parsley/test/hn.let +8 -0
- data/ext/parsley/test/malformed-array.html +2329 -0
- data/ext/parsley/test/malformed-array.json +1 -0
- data/ext/parsley/test/malformed-array.let +22 -0
- data/ext/parsley/test/malformed-expr.html +2329 -0
- data/ext/parsley/test/malformed-expr.json +1 -0
- data/ext/parsley/test/malformed-expr.let +16 -0
- data/ext/parsley/test/malformed-function.html +845 -0
- data/ext/parsley/test/malformed-function.json +197 -0
- data/ext/parsley/test/malformed-function.let +8 -0
- data/ext/parsley/test/malformed-json.html +2329 -0
- data/ext/parsley/test/malformed-json.json +1 -0
- data/ext/parsley/test/malformed-json.let +6 -0
- data/ext/parsley/test/malformed-xpath.html +8 -0
- data/ext/parsley/test/malformed-xpath.json +1 -0
- data/ext/parsley/test/malformed-xpath.let +7 -0
- data/ext/parsley/test/match.json +1 -0
- data/ext/parsley/test/match.let +9 -0
- data/ext/parsley/test/match.xml +11 -0
- data/ext/parsley/test/math_ambiguity.html +9 -0
- data/ext/parsley/test/math_ambiguity.json +1 -0
- data/ext/parsley/test/math_ambiguity.let +5 -0
- data/ext/parsley/test/nth-regression.html +13 -0
- data/ext/parsley/test/nth-regression.json +1 -0
- data/ext/parsley/test/nth-regression.let +3 -0
- data/ext/parsley/test/optional.html +2328 -0
- data/ext/parsley/test/optional.json +1 -0
- data/ext/parsley/test/optional.let +8 -0
- data/ext/parsley/test/outer-xml.html +6 -0
- data/ext/parsley/test/outer-xml.json +1 -0
- data/ext/parsley/test/outer-xml.let +5 -0
- data/ext/parsley/test/position.html +8 -0
- data/ext/parsley/test/position.json +1 -0
- data/ext/parsley/test/position.let +6 -0
- data/ext/parsley/test/question_regressions.html +443 -0
- data/ext/parsley/test/question_regressions.json +1 -0
- data/ext/parsley/test/question_regressions.let +6 -0
- data/ext/parsley/test/quote.json +1 -0
- data/ext/parsley/test/quote.let +8 -0
- data/ext/parsley/test/quote.xml +11 -0
- data/ext/parsley/test/reddit.html +1 -0
- data/ext/parsley/test/reddit.json +1 -0
- data/ext/parsley/test/reddit.let +12 -0
- data/ext/parsley/test/remote-fail.json +1 -0
- data/ext/parsley/test/remote.html +3 -0
- data/ext/parsley/test/remote.json +1 -0
- data/ext/parsley/test/remote.let +4 -0
- data/ext/parsley/test/replace.json +1 -0
- data/ext/parsley/test/replace.let +9 -0
- data/ext/parsley/test/replace.xml +11 -0
- data/ext/parsley/test/scope.html +10 -0
- data/ext/parsley/test/scope.json +1 -0
- data/ext/parsley/test/scope.let +6 -0
- data/ext/parsley/test/segfault.html +5 -0
- data/ext/parsley/test/segfault.json +1 -0
- data/ext/parsley/test/segfault.let +9 -0
- data/ext/parsley/test/sg-wrap.html +5 -0
- data/ext/parsley/test/sg-wrap.json +1 -0
- data/ext/parsley/test/sg-wrap.let +3 -0
- data/ext/parsley/test/sg_off.html +5 -0
- data/ext/parsley/test/sg_off.json +1 -0
- data/ext/parsley/test/sg_off.let +3 -0
- data/ext/parsley/test/test.json +1 -0
- data/ext/parsley/test/test.let +6 -0
- data/ext/parsley/test/test.xml +11 -0
- data/ext/parsley/test/trivial.html +2329 -0
- data/ext/parsley/test/trivial.json +1 -0
- data/ext/parsley/test/trivial.let +4 -0
- data/ext/parsley/test/trivial2.html +2329 -0
- data/ext/parsley/test/trivial2.json +1 -0
- data/ext/parsley/test/trivial2.let +7 -0
- data/ext/parsley/test/unbang.html +17 -0
- data/ext/parsley/test/unbang.json +1 -0
- data/ext/parsley/test/unbang.let +6 -0
- data/ext/parsley/test/unicode.html +3 -0
- data/ext/parsley/test/unicode.json +1 -0
- data/ext/parsley/test/unicode.let +1 -0
- data/ext/parsley/test/whitespace.html +8 -0
- data/ext/parsley/test/whitespace.json +1 -0
- data/ext/parsley/test/whitespace.let +3 -0
- data/ext/parsley/test/whitespace_regression.html +4 -0
- data/ext/parsley/test/whitespace_regression.json +1 -0
- data/ext/parsley/test/whitespace_regression.let +3 -0
- data/ext/parsley/test/yelp-benchmark.rb +53 -0
- data/ext/parsley/test/yelp-home.html +1004 -0
- data/ext/parsley/test/yelp-home.json +1 -0
- data/ext/parsley/test/yelp-home.let +6 -0
- data/ext/parsley/test/yelp.html +2329 -0
- data/ext/parsley/test/yelp.json +1 -0
- data/ext/parsley/test/yelp.let +12 -0
- data/ext/parsley/test/youtube.html +1940 -0
- data/ext/parsley/test/youtube.let +11 -0
- data/ext/parsley/util.c +237 -0
- data/ext/parsley/util.h +34 -0
- data/ext/parsley/xml2json.c +47 -0
- data/ext/parsley/xml2json.h +14 -0
- data/ext/parsley/y.tab.h +222 -0
- data/ext/parsley/ylwrap +222 -0
- data/lib/parsley.rb +84 -0
- data/test/test_parsley.rb +120 -0
- data/test/yelp-benchmark.rb +53 -0
- data/test/yelp-home.html +1004 -0
- data/test/yelp-home.let +6 -0
- data/test/yelp.html +2329 -0
- metadata +366 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* $Id: printbuf.h,v 1.4 2006/01/26 02:16:28 mclark Exp $
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd.
|
|
5
|
+
* Michael Clark <michael@metaparadigm.com>
|
|
6
|
+
*
|
|
7
|
+
* This library is free software; you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the MIT license. See COPYING for details.
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* Copyright (c) 2008-2009 Yahoo! Inc. All rights reserved.
|
|
12
|
+
* The copyrights to the contents of this file are licensed under the MIT License
|
|
13
|
+
* (http://www.opensource.org/licenses/mit-license.php)
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
#ifndef _printbuf_h_
|
|
17
|
+
#define _printbuf_h_
|
|
18
|
+
|
|
19
|
+
#ifdef __cplusplus
|
|
20
|
+
extern "C" {
|
|
21
|
+
#endif
|
|
22
|
+
|
|
23
|
+
#undef PRINTBUF_DEBUG
|
|
24
|
+
|
|
25
|
+
struct printbuf {
|
|
26
|
+
char *buf;
|
|
27
|
+
int bpos;
|
|
28
|
+
int size;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
extern struct printbuf*
|
|
32
|
+
printbuf_new(void);
|
|
33
|
+
|
|
34
|
+
/* As an optimization, printbuf_memappend is defined as a macro that
|
|
35
|
+
* handles copying data if the buffer is large enough; otherwise it
|
|
36
|
+
* invokes printbuf_memappend_real() which performs the heavy lifting
|
|
37
|
+
* of realloc()ing the buffer and copying data.
|
|
38
|
+
*/
|
|
39
|
+
extern int
|
|
40
|
+
printbuf_memappend(struct printbuf *p, const char *buf, int size);
|
|
41
|
+
|
|
42
|
+
#define printbuf_memappend_fast(p, bufptr, bufsize) \
|
|
43
|
+
do { \
|
|
44
|
+
if ((p->size - p->bpos) > bufsize) { \
|
|
45
|
+
memcpy(p->buf + p->bpos, (bufptr), bufsize); \
|
|
46
|
+
p->bpos += bufsize; \
|
|
47
|
+
p->buf[p->bpos]= '\0'; \
|
|
48
|
+
} else { printbuf_memappend(p, (bufptr), bufsize); } \
|
|
49
|
+
} while (0)
|
|
50
|
+
|
|
51
|
+
extern int
|
|
52
|
+
sprintbuf(struct printbuf *p, const char *msg, ...);
|
|
53
|
+
|
|
54
|
+
extern void
|
|
55
|
+
printbuf_reset(struct printbuf *p);
|
|
56
|
+
|
|
57
|
+
extern void
|
|
58
|
+
printbuf_free(struct printbuf *p);
|
|
59
|
+
|
|
60
|
+
#ifdef __cplusplus
|
|
61
|
+
}
|
|
62
|
+
#endif
|
|
63
|
+
|
|
64
|
+
#endif
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
timestamp for config.h
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
#! /bin/sh
|
|
2
|
+
|
|
3
|
+
# test1 - temporary wrapper script for .libs/test1
|
|
4
|
+
# Generated by ltmain.sh (GNU libtool) 2.2.6
|
|
5
|
+
#
|
|
6
|
+
# The test1 program cannot be directly executed until all the libtool
|
|
7
|
+
# libraries that it depends on are installed.
|
|
8
|
+
#
|
|
9
|
+
# This wrapper script should never be moved out of the build directory.
|
|
10
|
+
# If it is, it will not operate correctly.
|
|
11
|
+
|
|
12
|
+
# Sed substitution that helps us do robust quoting. It backslashifies
|
|
13
|
+
# metacharacters that are still active within double-quoted strings.
|
|
14
|
+
Xsed='/opt/local/bin/gsed -e 1s/^X//'
|
|
15
|
+
sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
|
|
16
|
+
|
|
17
|
+
# Be Bourne compatible
|
|
18
|
+
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
|
|
19
|
+
emulate sh
|
|
20
|
+
NULLCMD=:
|
|
21
|
+
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
|
|
22
|
+
# is contrary to our usage. Disable this feature.
|
|
23
|
+
alias -g '${1+"$@"}'='"$@"'
|
|
24
|
+
setopt NO_GLOB_SUBST
|
|
25
|
+
else
|
|
26
|
+
case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
|
|
27
|
+
fi
|
|
28
|
+
BIN_SH=xpg4; export BIN_SH # for Tru64
|
|
29
|
+
DUALCASE=1; export DUALCASE # for MKS sh
|
|
30
|
+
|
|
31
|
+
# The HP-UX ksh and POSIX shell print the target directory to stdout
|
|
32
|
+
# if CDPATH is set.
|
|
33
|
+
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
|
|
34
|
+
|
|
35
|
+
relink_command=""
|
|
36
|
+
|
|
37
|
+
# This environment variable determines our operation mode.
|
|
38
|
+
if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
|
|
39
|
+
# install mode needs the following variables:
|
|
40
|
+
generated_by_libtool_version='2.2.6'
|
|
41
|
+
notinst_deplibs=' libjson.la'
|
|
42
|
+
else
|
|
43
|
+
# When we are sourced in execute mode, $file and $ECHO are already set.
|
|
44
|
+
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
|
|
45
|
+
ECHO="/bin/echo"
|
|
46
|
+
file="$0"
|
|
47
|
+
# Make sure echo works.
|
|
48
|
+
if test "X$1" = X--no-reexec; then
|
|
49
|
+
# Discard the --no-reexec flag, and continue.
|
|
50
|
+
shift
|
|
51
|
+
elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
|
|
52
|
+
# Yippee, $ECHO works!
|
|
53
|
+
:
|
|
54
|
+
else
|
|
55
|
+
# Restart under the correct shell, and then maybe $ECHO will work.
|
|
56
|
+
exec /bin/sh "$0" --no-reexec ${1+"$@"}
|
|
57
|
+
fi
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
# Find the directory that this script lives in.
|
|
61
|
+
thisdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'`
|
|
62
|
+
test "x$thisdir" = "x$file" && thisdir=.
|
|
63
|
+
|
|
64
|
+
# Follow symbolic links until we get to the real thisdir.
|
|
65
|
+
file=`ls -ld "$file" | /opt/local/bin/gsed -n 's/.*-> //p'`
|
|
66
|
+
while test -n "$file"; do
|
|
67
|
+
destdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'`
|
|
68
|
+
|
|
69
|
+
# If there was a directory component, then change thisdir.
|
|
70
|
+
if test "x$destdir" != "x$file"; then
|
|
71
|
+
case "$destdir" in
|
|
72
|
+
[\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
|
|
73
|
+
*) thisdir="$thisdir/$destdir" ;;
|
|
74
|
+
esac
|
|
75
|
+
fi
|
|
76
|
+
|
|
77
|
+
file=`$ECHO "X$file" | $Xsed -e 's%^.*/%%'`
|
|
78
|
+
file=`ls -ld "$thisdir/$file" | /opt/local/bin/gsed -n 's/.*-> //p'`
|
|
79
|
+
done
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
# Usually 'no', except on cygwin/mingw when embedded into
|
|
83
|
+
# the cwrapper.
|
|
84
|
+
WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no
|
|
85
|
+
if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then
|
|
86
|
+
# special case for '.'
|
|
87
|
+
if test "$thisdir" = "."; then
|
|
88
|
+
thisdir=`pwd`
|
|
89
|
+
fi
|
|
90
|
+
# remove .libs from thisdir
|
|
91
|
+
case "$thisdir" in
|
|
92
|
+
*[\\/].libs ) thisdir=`$ECHO "X$thisdir" | $Xsed -e 's%[\\/][^\\/]*$%%'` ;;
|
|
93
|
+
.libs ) thisdir=. ;;
|
|
94
|
+
esac
|
|
95
|
+
fi
|
|
96
|
+
|
|
97
|
+
# Try to get the absolute directory name.
|
|
98
|
+
absdir=`cd "$thisdir" && pwd`
|
|
99
|
+
test -n "$absdir" && thisdir="$absdir"
|
|
100
|
+
|
|
101
|
+
program='test1'
|
|
102
|
+
progdir="$thisdir/.libs"
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
if test -f "$progdir/$program"; then
|
|
106
|
+
# Add our own library path to DYLD_LIBRARY_PATH
|
|
107
|
+
DYLD_LIBRARY_PATH="/Users/kyle/Git/parsley/json-c-0.9/.libs:$DYLD_LIBRARY_PATH"
|
|
108
|
+
|
|
109
|
+
# Some systems cannot cope with colon-terminated DYLD_LIBRARY_PATH
|
|
110
|
+
# The second colon is a workaround for a bug in BeOS R4 sed
|
|
111
|
+
DYLD_LIBRARY_PATH=`$ECHO "X$DYLD_LIBRARY_PATH" | $Xsed -e 's/::*$//'`
|
|
112
|
+
|
|
113
|
+
export DYLD_LIBRARY_PATH
|
|
114
|
+
|
|
115
|
+
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
|
|
116
|
+
# Run the actual program with our arguments.
|
|
117
|
+
|
|
118
|
+
exec "$progdir/$program" ${1+"$@"}
|
|
119
|
+
|
|
120
|
+
$ECHO "$0: cannot exec $program $*" 1>&2
|
|
121
|
+
exit 1
|
|
122
|
+
fi
|
|
123
|
+
else
|
|
124
|
+
# The program doesn't exist.
|
|
125
|
+
$ECHO "$0: error: \`$progdir/$program' does not exist" 1>&2
|
|
126
|
+
$ECHO "This script is just a wrapper for $program." 1>&2
|
|
127
|
+
/bin/echo "See the libtool documentation for more information." 1>&2
|
|
128
|
+
exit 1
|
|
129
|
+
fi
|
|
130
|
+
fi
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
#include <stdio.h>
|
|
2
|
+
#include <stdlib.h>
|
|
3
|
+
#include <stddef.h>
|
|
4
|
+
#include <string.h>
|
|
5
|
+
|
|
6
|
+
#include "json.h"
|
|
7
|
+
|
|
8
|
+
int main(int argc, char **argv)
|
|
9
|
+
{
|
|
10
|
+
json_tokener *tok;
|
|
11
|
+
json_object *my_string, *my_int, *my_object, *my_array;
|
|
12
|
+
json_object *new_obj;
|
|
13
|
+
int i;
|
|
14
|
+
|
|
15
|
+
MC_SET_DEBUG(1);
|
|
16
|
+
|
|
17
|
+
my_string = json_object_new_string("\t");
|
|
18
|
+
printf("my_string=%s\n", json_object_get_string(my_string));
|
|
19
|
+
printf("my_string.to_string()=%s\n", json_object_to_json_string(my_string));
|
|
20
|
+
json_object_put(my_string);
|
|
21
|
+
|
|
22
|
+
my_string = json_object_new_string("\\");
|
|
23
|
+
printf("my_string=%s\n", json_object_get_string(my_string));
|
|
24
|
+
printf("my_string.to_string()=%s\n", json_object_to_json_string(my_string));
|
|
25
|
+
json_object_put(my_string);
|
|
26
|
+
|
|
27
|
+
my_string = json_object_new_string("foo");
|
|
28
|
+
printf("my_string=%s\n", json_object_get_string(my_string));
|
|
29
|
+
printf("my_string.to_string()=%s\n", json_object_to_json_string(my_string));
|
|
30
|
+
|
|
31
|
+
my_int = json_object_new_int(9);
|
|
32
|
+
printf("my_int=%d\n", json_object_get_int(my_int));
|
|
33
|
+
printf("my_int.to_string()=%s\n", json_object_to_json_string(my_int));
|
|
34
|
+
|
|
35
|
+
my_array = json_object_new_array();
|
|
36
|
+
json_object_array_add(my_array, json_object_new_int(1));
|
|
37
|
+
json_object_array_add(my_array, json_object_new_int(2));
|
|
38
|
+
json_object_array_add(my_array, json_object_new_int(3));
|
|
39
|
+
json_object_array_put_idx(my_array, 4, json_object_new_int(5));
|
|
40
|
+
printf("my_array=\n");
|
|
41
|
+
for(i=0; i < json_object_array_length(my_array); i++) {
|
|
42
|
+
json_object *obj = json_object_array_get_idx(my_array, i);
|
|
43
|
+
printf("\t[%d]=%s\n", i, json_object_to_json_string(obj));
|
|
44
|
+
}
|
|
45
|
+
printf("my_array.to_string()=%s\n", json_object_to_json_string(my_array));
|
|
46
|
+
|
|
47
|
+
my_object = json_object_new_object();
|
|
48
|
+
json_object_object_add(my_object, "abc", json_object_new_int(12));
|
|
49
|
+
json_object_object_add(my_object, "foo", json_object_new_string("bar"));
|
|
50
|
+
json_object_object_add(my_object, "bool0", json_object_new_boolean(0));
|
|
51
|
+
json_object_object_add(my_object, "bool1", json_object_new_boolean(1));
|
|
52
|
+
json_object_object_add(my_object, "baz", json_object_new_string("bang"));
|
|
53
|
+
json_object_object_add(my_object, "baz", json_object_new_string("fark"));
|
|
54
|
+
json_object_object_del(my_object, "baz");
|
|
55
|
+
/*json_object_object_add(my_object, "arr", my_array);*/
|
|
56
|
+
printf("my_object=\n");
|
|
57
|
+
json_object_object_foreach(my_object, key, val) {
|
|
58
|
+
printf("\t%s: %s\n", key, json_object_to_json_string(val));
|
|
59
|
+
}
|
|
60
|
+
printf("my_object.to_string()=%s\n", json_object_to_json_string(my_object));
|
|
61
|
+
|
|
62
|
+
new_obj = json_tokener_parse("\"\003\"");
|
|
63
|
+
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
|
|
64
|
+
json_object_put(new_obj);
|
|
65
|
+
|
|
66
|
+
new_obj = json_tokener_parse("/* hello */\"foo\"");
|
|
67
|
+
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
|
|
68
|
+
json_object_put(new_obj);
|
|
69
|
+
|
|
70
|
+
new_obj = json_tokener_parse("// hello\n\"foo\"");
|
|
71
|
+
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
|
|
72
|
+
json_object_put(new_obj);
|
|
73
|
+
|
|
74
|
+
new_obj = json_tokener_parse("\"\\u0041\\u0042\\u0043\"");
|
|
75
|
+
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
|
|
76
|
+
json_object_put(new_obj);
|
|
77
|
+
|
|
78
|
+
new_obj = json_tokener_parse("null");
|
|
79
|
+
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
|
|
80
|
+
json_object_put(new_obj);
|
|
81
|
+
|
|
82
|
+
new_obj = json_tokener_parse("True");
|
|
83
|
+
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
|
|
84
|
+
json_object_put(new_obj);
|
|
85
|
+
|
|
86
|
+
new_obj = json_tokener_parse("12");
|
|
87
|
+
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
|
|
88
|
+
json_object_put(new_obj);
|
|
89
|
+
|
|
90
|
+
new_obj = json_tokener_parse("12.3");
|
|
91
|
+
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
|
|
92
|
+
json_object_put(new_obj);
|
|
93
|
+
|
|
94
|
+
new_obj = json_tokener_parse("[\"\\n\"]");
|
|
95
|
+
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
|
|
96
|
+
json_object_put(new_obj);
|
|
97
|
+
|
|
98
|
+
new_obj = json_tokener_parse("[\"\\nabc\\n\"]");
|
|
99
|
+
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
|
|
100
|
+
json_object_put(new_obj);
|
|
101
|
+
|
|
102
|
+
new_obj = json_tokener_parse("[null]");
|
|
103
|
+
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
|
|
104
|
+
json_object_put(new_obj);
|
|
105
|
+
|
|
106
|
+
new_obj = json_tokener_parse("[]");
|
|
107
|
+
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
|
|
108
|
+
json_object_put(new_obj);
|
|
109
|
+
|
|
110
|
+
new_obj = json_tokener_parse("[false]");
|
|
111
|
+
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
|
|
112
|
+
json_object_put(new_obj);
|
|
113
|
+
|
|
114
|
+
new_obj = json_tokener_parse("[\"abc\",null,\"def\",12]");
|
|
115
|
+
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
|
|
116
|
+
json_object_put(new_obj);
|
|
117
|
+
|
|
118
|
+
new_obj = json_tokener_parse("{}");
|
|
119
|
+
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
|
|
120
|
+
json_object_put(new_obj);
|
|
121
|
+
|
|
122
|
+
new_obj = json_tokener_parse("{ \"foo\": \"bar\" }");
|
|
123
|
+
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
|
|
124
|
+
json_object_put(new_obj);
|
|
125
|
+
|
|
126
|
+
new_obj = json_tokener_parse("{ \"foo\": \"bar\", \"baz\": null, \"bool0\": true }");
|
|
127
|
+
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
|
|
128
|
+
json_object_put(new_obj);
|
|
129
|
+
|
|
130
|
+
new_obj = json_tokener_parse("{ \"foo\": [null, \"foo\"] }");
|
|
131
|
+
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
|
|
132
|
+
json_object_put(new_obj);
|
|
133
|
+
|
|
134
|
+
new_obj = json_tokener_parse("{ \"abc\": 12, \"foo\": \"bar\", \"bool0\": false, \"bool1\": true, \"arr\": [ 1, 2, 3, null, 5 ] }");
|
|
135
|
+
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
|
|
136
|
+
json_object_put(new_obj);
|
|
137
|
+
|
|
138
|
+
new_obj = json_tokener_parse("{ foo }");
|
|
139
|
+
if(is_error(new_obj)) printf("got error as expected\n");
|
|
140
|
+
|
|
141
|
+
new_obj = json_tokener_parse("foo");
|
|
142
|
+
if(is_error(new_obj)) printf("got error as expected\n");
|
|
143
|
+
|
|
144
|
+
new_obj = json_tokener_parse("{ \"foo");
|
|
145
|
+
if(is_error(new_obj)) printf("got error as expected\n");
|
|
146
|
+
|
|
147
|
+
/* test incremental parsing */
|
|
148
|
+
tok = json_tokener_new();
|
|
149
|
+
new_obj = json_tokener_parse_ex(tok, "{ \"foo", 6);
|
|
150
|
+
if(is_error(new_obj)) printf("got error as expected\n");
|
|
151
|
+
new_obj = json_tokener_parse_ex(tok, "\": {\"bar", 8);
|
|
152
|
+
if(is_error(new_obj)) printf("got error as expected\n");
|
|
153
|
+
new_obj = json_tokener_parse_ex(tok, "\":13}}", 6);
|
|
154
|
+
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
|
|
155
|
+
json_object_put(new_obj);
|
|
156
|
+
json_tokener_free(tok);
|
|
157
|
+
|
|
158
|
+
json_object_put(my_string);
|
|
159
|
+
json_object_put(my_int);
|
|
160
|
+
json_object_put(my_object);
|
|
161
|
+
//json_object_put(my_array);
|
|
162
|
+
|
|
163
|
+
return 0;
|
|
164
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
#! /bin/sh
|
|
2
|
+
|
|
3
|
+
# test2 - temporary wrapper script for .libs/test2
|
|
4
|
+
# Generated by ltmain.sh (GNU libtool) 2.2.6
|
|
5
|
+
#
|
|
6
|
+
# The test2 program cannot be directly executed until all the libtool
|
|
7
|
+
# libraries that it depends on are installed.
|
|
8
|
+
#
|
|
9
|
+
# This wrapper script should never be moved out of the build directory.
|
|
10
|
+
# If it is, it will not operate correctly.
|
|
11
|
+
|
|
12
|
+
# Sed substitution that helps us do robust quoting. It backslashifies
|
|
13
|
+
# metacharacters that are still active within double-quoted strings.
|
|
14
|
+
Xsed='/opt/local/bin/gsed -e 1s/^X//'
|
|
15
|
+
sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
|
|
16
|
+
|
|
17
|
+
# Be Bourne compatible
|
|
18
|
+
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
|
|
19
|
+
emulate sh
|
|
20
|
+
NULLCMD=:
|
|
21
|
+
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
|
|
22
|
+
# is contrary to our usage. Disable this feature.
|
|
23
|
+
alias -g '${1+"$@"}'='"$@"'
|
|
24
|
+
setopt NO_GLOB_SUBST
|
|
25
|
+
else
|
|
26
|
+
case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
|
|
27
|
+
fi
|
|
28
|
+
BIN_SH=xpg4; export BIN_SH # for Tru64
|
|
29
|
+
DUALCASE=1; export DUALCASE # for MKS sh
|
|
30
|
+
|
|
31
|
+
# The HP-UX ksh and POSIX shell print the target directory to stdout
|
|
32
|
+
# if CDPATH is set.
|
|
33
|
+
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
|
|
34
|
+
|
|
35
|
+
relink_command=""
|
|
36
|
+
|
|
37
|
+
# This environment variable determines our operation mode.
|
|
38
|
+
if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
|
|
39
|
+
# install mode needs the following variables:
|
|
40
|
+
generated_by_libtool_version='2.2.6'
|
|
41
|
+
notinst_deplibs=' libjson.la'
|
|
42
|
+
else
|
|
43
|
+
# When we are sourced in execute mode, $file and $ECHO are already set.
|
|
44
|
+
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
|
|
45
|
+
ECHO="/bin/echo"
|
|
46
|
+
file="$0"
|
|
47
|
+
# Make sure echo works.
|
|
48
|
+
if test "X$1" = X--no-reexec; then
|
|
49
|
+
# Discard the --no-reexec flag, and continue.
|
|
50
|
+
shift
|
|
51
|
+
elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
|
|
52
|
+
# Yippee, $ECHO works!
|
|
53
|
+
:
|
|
54
|
+
else
|
|
55
|
+
# Restart under the correct shell, and then maybe $ECHO will work.
|
|
56
|
+
exec /bin/sh "$0" --no-reexec ${1+"$@"}
|
|
57
|
+
fi
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
# Find the directory that this script lives in.
|
|
61
|
+
thisdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'`
|
|
62
|
+
test "x$thisdir" = "x$file" && thisdir=.
|
|
63
|
+
|
|
64
|
+
# Follow symbolic links until we get to the real thisdir.
|
|
65
|
+
file=`ls -ld "$file" | /opt/local/bin/gsed -n 's/.*-> //p'`
|
|
66
|
+
while test -n "$file"; do
|
|
67
|
+
destdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'`
|
|
68
|
+
|
|
69
|
+
# If there was a directory component, then change thisdir.
|
|
70
|
+
if test "x$destdir" != "x$file"; then
|
|
71
|
+
case "$destdir" in
|
|
72
|
+
[\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
|
|
73
|
+
*) thisdir="$thisdir/$destdir" ;;
|
|
74
|
+
esac
|
|
75
|
+
fi
|
|
76
|
+
|
|
77
|
+
file=`$ECHO "X$file" | $Xsed -e 's%^.*/%%'`
|
|
78
|
+
file=`ls -ld "$thisdir/$file" | /opt/local/bin/gsed -n 's/.*-> //p'`
|
|
79
|
+
done
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
# Usually 'no', except on cygwin/mingw when embedded into
|
|
83
|
+
# the cwrapper.
|
|
84
|
+
WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no
|
|
85
|
+
if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then
|
|
86
|
+
# special case for '.'
|
|
87
|
+
if test "$thisdir" = "."; then
|
|
88
|
+
thisdir=`pwd`
|
|
89
|
+
fi
|
|
90
|
+
# remove .libs from thisdir
|
|
91
|
+
case "$thisdir" in
|
|
92
|
+
*[\\/].libs ) thisdir=`$ECHO "X$thisdir" | $Xsed -e 's%[\\/][^\\/]*$%%'` ;;
|
|
93
|
+
.libs ) thisdir=. ;;
|
|
94
|
+
esac
|
|
95
|
+
fi
|
|
96
|
+
|
|
97
|
+
# Try to get the absolute directory name.
|
|
98
|
+
absdir=`cd "$thisdir" && pwd`
|
|
99
|
+
test -n "$absdir" && thisdir="$absdir"
|
|
100
|
+
|
|
101
|
+
program='test2'
|
|
102
|
+
progdir="$thisdir/.libs"
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
if test -f "$progdir/$program"; then
|
|
106
|
+
# Add our own library path to DYLD_LIBRARY_PATH
|
|
107
|
+
DYLD_LIBRARY_PATH="/Users/kyle/Git/parsley/json-c-0.9/.libs:$DYLD_LIBRARY_PATH"
|
|
108
|
+
|
|
109
|
+
# Some systems cannot cope with colon-terminated DYLD_LIBRARY_PATH
|
|
110
|
+
# The second colon is a workaround for a bug in BeOS R4 sed
|
|
111
|
+
DYLD_LIBRARY_PATH=`$ECHO "X$DYLD_LIBRARY_PATH" | $Xsed -e 's/::*$//'`
|
|
112
|
+
|
|
113
|
+
export DYLD_LIBRARY_PATH
|
|
114
|
+
|
|
115
|
+
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
|
|
116
|
+
# Run the actual program with our arguments.
|
|
117
|
+
|
|
118
|
+
exec "$progdir/$program" ${1+"$@"}
|
|
119
|
+
|
|
120
|
+
$ECHO "$0: cannot exec $program $*" 1>&2
|
|
121
|
+
exit 1
|
|
122
|
+
fi
|
|
123
|
+
else
|
|
124
|
+
# The program doesn't exist.
|
|
125
|
+
$ECHO "$0: error: \`$progdir/$program' does not exist" 1>&2
|
|
126
|
+
$ECHO "This script is just a wrapper for $program." 1>&2
|
|
127
|
+
/bin/echo "See the libtool documentation for more information." 1>&2
|
|
128
|
+
exit 1
|
|
129
|
+
fi
|
|
130
|
+
fi
|