Skip to content

Commit a321b98

Browse files
obrienobrien
authored andcommitted
Moving libxo to properly tracked, 3rd-Party imported handling.
Reviewed by: phil, sjg
0 parents  commit a321b98

File tree

345 files changed

+54139
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

345 files changed

+54139
-0
lines changed

dist/.travis.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
language: c
2+
3+
script: printenv && uname -a && ls -l && /bin/sh -x ./bin/setup.sh && cd build && ../configure --enable-warnings && make && sudo make install && make test
4+
5+
notifications:
6+
recipients:
7+
- libslax-noise@googlegroups.com
8+
9+
branches:
10+
only:
11+
- master
12+
- develop

dist/Copyright

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Copyright (c) 2014 Juniper Networks, Inc.
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions
6+
are met:
7+
1. Redistributions of source code must retain the above copyright
8+
notice, this list of conditions and the following disclaimer.
9+
2. Redistributions in binary form must reproduce the above copyright
10+
notice, this list of conditions and the following disclaimer in the
11+
documentation and/or other materials provided with the distribution.
12+
13+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16+
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23+
SUCH DAMAGE.

dist/INSTALL.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!---
2+
# $Id$
3+
#
4+
# Copyright 2015, Juniper Networks, Inc.
5+
# All rights reserved.
6+
# This SOFTWARE is licensed under the LICENSE provided in the
7+
# ../Copyright file. By downloading, installing, copying, or otherwise
8+
# using the SOFTWARE, you agree to be bound by the terms of that
9+
# LICENSE.
10+
#-->
11+
12+
## Instructions for building libxo
13+
14+
Instructions for building libxo are now available in the
15+
[wiki](http://juniper.github.io/libxo/libxo-manual.html#getting-libxo).

dist/LICENSE

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Copyright (c) 2014, Juniper Networks
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
7+
* Redistributions of source code must retain the above copyright notice, this
8+
list of conditions and the following disclaimer.
9+
10+
* Redistributions in binary form must reproduce the above copyright notice,
11+
this list of conditions and the following disclaimer in the documentation
12+
and/or other materials provided with the distribution.
13+
14+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
18+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

dist/Makefile.am

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
#
2+
# $Id$
3+
#
4+
# Copyright 2014, Juniper Networks, Inc.
5+
# All rights reserved.
6+
# This SOFTWARE is licensed under the LICENSE provided in the
7+
# ../Copyright file. By downloading, installing, copying, or otherwise
8+
# using the SOFTWARE, you agree to be bound by the terms of that
9+
# LICENSE.
10+
11+
ACLOCAL_AMFLAGS = -I m4
12+
13+
SUBDIRS = libxo xo xopo xolint xohtml tests doc encoder
14+
bin_SCRIPTS=libxo-config
15+
dist_doc_DATA = Copyright
16+
17+
EXTRA_DIST = \
18+
libxo-config.in \
19+
warnings.mk \
20+
README.md \
21+
INSTALL.md \
22+
packaging/libxo.spec
23+
24+
.PHONY: test tests
25+
26+
test tests:
27+
@(cd tests ; ${MAKE} test)
28+
29+
errors:
30+
@(cd tests/errors ; ${MAKE} test)
31+
32+
docs:
33+
@(cd doc ; ${MAKE} docs)
34+
35+
36+
DIST_FILES_DIR = ~/Dropbox/dist-files/
37+
GH_PAGES_DIR = gh-pages/
38+
GH_PAGES_DIR_VER = gh-pages/${PACKAGE_VERSION}
39+
PACKAGE_FILE = ${PACKAGE_TARNAME}-${PACKAGE_VERSION}.tar.gz
40+
41+
upload: dist upload-docs
42+
@echo "Remember to run:"
43+
@echo " gt tag ${PACKAGE_VERSION}"
44+
45+
upload-docs: docs
46+
@echo "Uploading libxo-manual.html ... "
47+
@-[ -d ${GH_PAGES_DIR} ] \
48+
&& echo "Updating manual on gh-pages ..." \
49+
&& mkdir -p ${GH_PAGES_DIR_VER} \
50+
&& cp doc/libxo-manual.html ${GH_PAGES_DIR} \
51+
&& cp doc/libxo-manual.html ${GH_PAGES_DIR_VER} \
52+
&& (cd ${GH_PAGES_DIR} \
53+
&& git add ${PACKAGE_VERSION} \
54+
&& git add libxo-manual.html \
55+
&& git commit -m 'new docs' \
56+
libxo-manual.html ${PACKAGE_VERSION} \
57+
&& git push origin gh-pages ) ; true
58+
59+
pkgconfigdir=$(libdir)/pkgconfig
60+
pkgconfig_DATA = packaging/${PACKAGE_NAME}.pc
61+
62+
get-wiki:
63+
git clone https://github.com/Juniper/${PACKAGE_NAME}.wiki.git wiki
64+
65+
get-gh-pages:
66+
git clone https://github.com/Juniper/${PACKAGE_NAME}.git \
67+
gh-pages -b gh-pages
68+
69+
UPDATE_PACKAGE_FILE = \
70+
-e "s;__SHA1__;$$SHA1;" \
71+
-e "s;__SHA256__;SHA256 (textproc/${PACKAGE_FILE}) = $$SHA256;" \
72+
-e "s;__SIZE__;SIZE (textproc/${PACKAGE_FILE}) = $$SIZE;"
73+
74+
GH_PACKAGING_DIR = ${PACKAGE_VERSION}/packaging
75+
GH_PAGES_PACKAGE_DIR = ${GH_PAGES_DIR}/${GH_PACKAGING_DIR}
76+
77+
packages:
78+
@-[ -d ${GH_PAGES_DIR} ] && set -x \
79+
&& echo "Updating packages on gh-pages ..." \
80+
&& SHA1="`openssl sha1 ${PACKAGE_FILE} | awk '{print $$2}'`" \
81+
&& SHA256="`openssl sha256 ${PACKAGE_FILE} | awk '{print $$2}'`" \
82+
&& SIZE="`ls -l ${PACKAGE_FILE} | awk '{print $$5}'`" \
83+
&& echo "... ${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.rb ..." \
84+
&& sed ${UPDATE_PACKAGE_FILE} \
85+
packaging/${PACKAGE_NAME}.rb.base \
86+
> ${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.rb \
87+
&& echo "... ${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.spec ..." \
88+
&& cp packaging/${PACKAGE_NAME}.spec \
89+
${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.spec \
90+
&& (cd ${GH_PAGES_DIR} \
91+
&& git add ${GH_PACKAGING_DIR} \
92+
&& git add ${GH_PACKAGING_DIR}/libxo.rb \
93+
${GH_PACKAGING_DIR}/libxo.spec \
94+
&& git commit -m 'new packaging data' \
95+
${GH_PACKAGING_DIR} \
96+
&& git push origin gh-pages ) ; true
97+
98+
ANALYZE_DIR = ~/trash/libxo
99+
ANALYZE_CMD = scan-build-mp-3.6
100+
101+
analyze:
102+
${ANALYZE_CMD} -o ${ANALYZE_DIR} ${MAKE}

dist/README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
libxo
2+
=====
3+
4+
libxo - A Library for Generating Text, XML, JSON, and HTML Output
5+
6+
The libxo library allows an application to generate text, XML, JSON,
7+
and HTML output using a common set of function calls. The application
8+
decides at run time which output style should be produced. The
9+
application calls a function "xo_emit" to product output that is
10+
described in a format string. A "field descriptor" tells libxo what
11+
the field is and what it means.
12+
13+
```
14+
xo_emit(" {:lines/%7ju/%ju} {:words/%7ju/%ju} "
15+
"{:characters/%7ju/%ju}{d:filename/%s}\n",
16+
linect, wordct, charct, file);
17+
```
18+
19+
Output can then be generated in various style, using the "--libxo"
20+
option:
21+
22+
```
23+
% wc /etc/motd
24+
25 165 1140 /etc/motd
25+
% wc --libxo xml,pretty,warn /etc/motd
26+
<wc>
27+
<file>
28+
<filename>/etc/motd</filename>
29+
<lines>25</lines>
30+
<words>165</words>
31+
<characters>1140</characters>
32+
</file>
33+
</wc>
34+
% wc --libxo json,pretty,warn /etc/motd
35+
{
36+
"wc": {
37+
"file": [
38+
{
39+
"filename": "/etc/motd",
40+
"lines": 25,
41+
"words": 165,
42+
"characters": 1140
43+
}
44+
]
45+
}
46+
}
47+
% wc --libxo html,pretty,warn /etc/motd
48+
<div class="line">
49+
<div class="text"> </div>
50+
<div class="data" data-tag="lines"> 25</div>
51+
<div class="text"> </div>
52+
<div class="data" data-tag="words"> 165</div>
53+
<div class="text"> </div>
54+
<div class="data" data-tag="characters"> 1140</div>
55+
<div class="text"> </div>
56+
<div class="data" data-tag="filename">/etc/motd</div>
57+
</div>
58+
```
59+
60+
View the beautiful documentation at:
61+
62+
http://juniper.github.io/libxo/libxo-manual.html
63+
64+
[![Analytics](https://ga-beacon.appspot.com/UA-56056421-1/Juniper/libxo/Readme)](https://github.com/Juniper/libxo)

dist/bin/Makefile.am

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#
2+
# Copyright 2013, Juniper Networks, Inc.
3+
# All rights reserved.
4+
# This SOFTWARE is licensed under the LICENSE provided in the
5+
# ../Copyright file. By downloading, installing, copying, or otherwise
6+
# using the SOFTWARE, you agree to be bound by the terms of that
7+
# LICENSE.
8+
9+
ACLOCAL_AMFLAGS = -I m4
10+
11+
EXTRA_DIST = gt setup.sh
12+
13+
GT_INSTALL_DIR = ${prefix}/bin
14+
GT_INSTALL_FILES = gt
15+
16+
install-data-hook:
17+
@echo "Installing gt ... "
18+
@-mkdir -p ${GT_INSTALL_DIR}
19+
@for file in ${GT_INSTALL_FILES} ; do \
20+
if [ -f $$file ]; then \
21+
rfile=$$file ; \
22+
else \
23+
rfile=${srcdir}/$$file ; \
24+
fi ; \
25+
mdir=${GT_INSTALL_DIR}/ ; \
26+
mkdir -p $$mdir ; \
27+
cp $$rfile $$mdir/ ; \
28+
done
29+
@${CHMOD} a+x ${GT_INSTALL_DIR}/gt

dist/bin/Zaliases

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
set top_src=`pwd`
2+
alias Zautoreconf "(cd $top_src ; autoreconf)"
3+
4+
set opts=' \
5+
--with-libslax-prefix=/Users/phil/work/root \
6+
--enable-debug \
7+
--enable-warnings \
8+
--enable-printflike \
9+
--with-gettext=/opt/local \
10+
--prefix ${HOME}/work/root \
11+
'
12+
set opts=`echo $opts`
13+
14+
setenv CONFIGURE_OPTS "$opts"
15+
setenv ADB_PATH $top_src/build/libxo/.libs
16+
17+
alias Zconfigure "(cd $top_src/build; ../configure $opts)"
18+
alias Zbuild "(cd $top_src/build; make \!* )"
19+
alias mi "(cd $top_src/build; make && make install); ."
20+
21+
mkdir -p build
22+
cd build
23+
24+
25+
alias xx 'cc -I.. -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Werror -Waggregate-return -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment -Wformat -Wimplicit -Wmissing-declarations -Wnested-externs -Wparentheses -Wreturn-type -Wshadow -Wswitch -Wtrigraphs -Wuninitialized -Wunused -Wwrite-strings -fno-inline-functions-called-once -g -O2 -o xtest -DUNIT_TEST libxo.c'
26+
27+
alias mm "make CFLAGS='-O0 -g'"
28+
29+
alias mmi 'mm && mi'

dist/bin/setup.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#
2+
# Copyright 2013, Juniper Networks, Inc.
3+
# All rights reserved.
4+
# This SOFTWARE is licensed under the LICENSE provided in the
5+
# ../Copyright file. By downloading, installing, copying, or otherwise
6+
# using the SOFTWARE, you agree to be bound by the terms of that
7+
# LICENSE.
8+
9+
10+
if [ ! -f configure ]; then
11+
vers=`autoreconf --version | head -1`
12+
echo "Using" $vers
13+
14+
mkdir -p m4
15+
16+
autoreconf --install
17+
18+
if [ ! -f configure ]; then
19+
echo "Failed to create configure script"
20+
exit 1
21+
fi
22+
fi
23+
24+
echo "Creating build directory ..."
25+
mkdir build
26+
27+
echo "Setup is complete. To build libslax:"
28+
29+
echo " 1) Type 'cd build ; ../configure' to configure libslax"
30+
echo " 2) Type 'make' to build libslax"
31+
echo " 3) Type 'make install' to install libslax"
32+
33+
exit 0

dist/build/.create

Whitespace-only changes.

0 commit comments

Comments
 (0)