Skip to content

Commit

Permalink
Merge branch 'master' of github.com:MidnightBSD/src
Browse files Browse the repository at this point in the history
  • Loading branch information
laffer1 committed Nov 11, 2024
2 parents c6603e9 + 82e0087 commit 58cfc00
Show file tree
Hide file tree
Showing 135 changed files with 3,498 additions and 554 deletions.
58 changes: 22 additions & 36 deletions contrib/libxo/.gitignore
Original file line number Diff line number Diff line change
@@ -1,46 +1,32 @@
# Object files
*.o

# Libraries
*.lib
*.a

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

# Executables
*.exe
*.app

*~
*.orig

tag.sh
Makefile.in
aclocal.m4
ar-lib
autom4te.cache
build
bin
build*
compile
configure
config.guess
config.h.in
config.sub
depcomp
doc/Makefile.in
info*
install-sh
ltmain.sh
missing
m4

Makefile.in
configure
.DS_Store

xoconfig.h.in
xo_config.h.in

.gdbinit
.gdbinit.local
xtest
xtest.dSYM
tests/w
missing
patches*
doc/Makefile.in
encoder/Makefile.in
encoder/cbor/Makefile.in
encoder/test/Makefile.in
libxo/Makefile.in
tests/Makefile.in
tests/core/Makefile.in
tests/gettext/Makefile.in
tests/xo/Makefile.in
xo/Makefile.in
xohtml/Makefile.in
xolint/Makefile.in
xopo/Makefile.in
18 changes: 0 additions & 18 deletions contrib/libxo/.svnignore

This file was deleted.

25 changes: 13 additions & 12 deletions contrib/libxo/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

ACLOCAL_AMFLAGS = -I m4

SUBDIRS = libxo xo xopo xolint xohtml tests doc encoder
SUBDIRS = bin libxo xo xopo xolint xohtml tests doc encoder
bin_SCRIPTS=libxo-config
dist_doc_DATA = Copyright

Expand All @@ -32,7 +32,6 @@ errors:
docs:
@(cd doc ; ${MAKE} docs)


DIST_FILES_DIR = ~/Dropbox/dist-files/
GH_PAGES_DIR = gh-pages/
GH_PAGES_DIR_VER = gh-pages/${PACKAGE_VERSION}
Expand All @@ -49,18 +48,20 @@ upload: dist upload-docs upload-xohtml-files
@echo "Remember to run:"
@echo " gt tag ${PACKAGE_VERSION}"

upload-docs: docs
@echo "Uploading libxo-manual.html ... "
@-[ -d ${GH_PAGES_DIR} ] \
&& echo "Updating manual on gh-pages ..." \
&& mkdir -p ${GH_PAGES_DIR_VER} \
&& cp doc/libxo-manual.html ${GH_PAGES_DIR} \
&& cp doc/libxo-manual.html ${GH_PAGES_DIR_VER} \
upload-docs: docs upload-html

upload-html:
@echo "Uploading html ... "
@-[ -d ${GH_PAGES_DIR} -a -d doc/html ] \
&& echo "Updating html on gh-pages ..." \
&& mkdir -p ${GH_PAGES_DIR_VER}/html \
&& cp doc/top-link.html ${GH_PAGES_DIR}/libxo.html \
&& cp -r doc/html/* ${GH_PAGES_DIR_VER}/html/ \
&& (cd ${GH_PAGES_DIR} \
&& git add ${PACKAGE_VERSION} \
&& git add libxo-manual.html \
&& git add libxo.html \
&& git add ${PACKAGE_VERSION}/html \
&& git commit -m 'new docs' \
libxo-manual.html ${PACKAGE_VERSION} \
libxo.html ${PACKAGE_VERSION}/html \
&& git push origin gh-pages ) ; true

upload-xohtml-files:
Expand Down
3 changes: 3 additions & 0 deletions contrib/libxo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ application calls a function "xo_emit" to product output that is
described in a format string. A "field descriptor" tells libxo what
the field is and what it means.

Imagine a simplified ``wc`` that emits its output fields in a single
xo_emit call:

```
xo_emit(" {:lines/%7ju/%ju} {:words/%7ju/%ju} "
"{:characters/%7ju/%ju}{d:filename/%s}\n",
Expand Down
12 changes: 7 additions & 5 deletions contrib/libxo/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
# a particular user has the dist or svn release.
#

AC_PREREQ(2.2)
AC_INIT([libxo], [1.0.4], [[email protected]])
AC_PREREQ([2.69])
AC_INIT([libxo],[1.6.0],[[email protected]])
AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability])

# Support silent build rules. Requires at least automake-1.11.
Expand All @@ -38,8 +38,6 @@ AC_PATH_PROG(MV, mv, /bin/mv)
AC_PATH_PROG(RM, rm, /bin/rm)
AC_PATH_PROG(SED, sed, /bin/sed)

AC_STDC_HEADERS

# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_SIZE_T
Expand Down Expand Up @@ -335,9 +333,10 @@ AM_CONDITIONAL([HAVE_LIBM], [test "$HAVE_LIBM" != "no"])
AC_MSG_CHECKING([compiler for gcc])
HAVE_GCC=no
if test "${CC}" != ""; then
HAVE_GCC=`${CC} --version 2>&1 | grep GCC`
HAVE_GCC=`${CC} --version 2>&1 | grep -i GCC`
if test "${HAVE_GCC}" != ""; then
HAVE_GCC=yes
AC_DEFINE([HAVE_GCC], [1], [Using real gcc])
else
HAVE_GCC=no
fi
Expand Down Expand Up @@ -450,15 +449,18 @@ AC_CONFIG_FILES([
xohtml/xohtml.sh
libxo/Makefile
libxo/add.man
bin/Makefile
encoder/Makefile
encoder/cbor/Makefile
encoder/csv/Makefile
encoder/test/Makefile
xo/Makefile
xolint/Makefile
xohtml/Makefile
xopo/Makefile
packaging/libxo.pc
doc/Makefile
doc/top-link.html
tests/Makefile
tests/core/Makefile
tests/gettext/Makefile
Expand Down
7 changes: 5 additions & 2 deletions contrib/libxo/encoder/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#
# Copyright 2015, Juniper Networks, Inc.
# Copyright 2015-2019, Juniper Networks, Inc.
# All rights reserved.
# This SOFTWARE is licensed under the LICENSE provided in the
# ../Copyright file. By downloading, installing, copying, or otherwise
# using the SOFTWARE, you agree to be bound by the terms of that
# LICENSE.

SUBDIRS = cbor test
SUBDIRS = \
cbor \
csv \
test
5 changes: 3 additions & 2 deletions contrib/libxo/encoder/cbor/enc_cbor.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ cbor_content (xo_handle_t *xop, cbor_private_t *cbor, xo_buffer_t *xbp,

unsigned offset = xo_buf_offset(xbp);

if (value == NULL || *value == '\0' || strcmp(value, "true") == 0)
if (value == NULL || *value == '\0' || xo_streq(value, "true"))
cbor_append(xop, cbor, &cbor->c_data, CBOR_TRUE, 0, NULL);
else if (strcmp(value, "false") == 0)
else if (xo_streq(value, "false"))
cbor_append(xop, cbor, &cbor->c_data, CBOR_FALSE, 0, NULL);
else {
int negative = 0;
Expand Down Expand Up @@ -360,6 +360,7 @@ int
xo_encoder_library_init (XO_ENCODER_INIT_ARGS)
{
arg->xei_handler = cbor_handler;
arg->xei_version = XO_ENCODER_VERSION;

return 0;
}
51 changes: 51 additions & 0 deletions contrib/libxo/encoder/csv/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#
# $Id$
#
# Copyright 2015-2019, Juniper Networks, Inc.
# All rights reserved.
# This SOFTWARE is licensed under the LICENSE provided in the
# ../Copyright file. By downloading, installing, copying, or otherwise
# using the SOFTWARE, you agree to be bound by the terms of that
# LICENSE.

if LIBXO_WARNINGS_HIGH
LIBXO_WARNINGS = HIGH
endif
if HAVE_GCC
GCC_WARNINGS = yes
endif
include ${top_srcdir}/warnings.mk

enc_csvincdir = ${includedir}/libxo

AM_CFLAGS = \
-I${top_srcdir}/libxo \
-I${top_builddir}/libxo \
${WARNINGS}

LIBNAME = libenc_csv
pkglib_LTLIBRARIES = libenc_csv.la
LIBS = \
-L${top_builddir}/libxo -lxo

LDADD = ${top_builddir}/libxo/libxo.la

libenc_csv_la_SOURCES = \
enc_csv.c

pkglibdir = ${XO_ENCODERDIR}

UGLY_NAME = csv.enc

install-exec-hook:
@DLNAME=`sh -c '. ./libenc_csv.la ; echo $$dlname'` ; \
if [ x"$$DLNAME" = x ]; \
then DLNAME=${LIBNAME}.${XO_LIBEXT}; fi ; \
if [ "$(build_os)" = "cygwin" ]; \
then DLNAME="../bin/$$DLNAME"; fi ; \
echo Install link $$DLNAME "->" ${UGLY_NAME} "..." ; \
mkdir -p ${DESTDIR}${XO_ENCODERDIR} ; \
cd ${DESTDIR}${XO_ENCODERDIR} \
&& chmod +w . \
&& rm -f ${UGLY_NAME} \
&& ${LN_S} $$DLNAME ${UGLY_NAME}
Loading

0 comments on commit 58cfc00

Please sign in to comment.