Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bdaad3ec8c | |||
| 7e7bb8978b | |||
| 787611dbd4 | |||
| a5fdc8e119 | |||
| fecbd1286c | |||
|
|
9de915d72f | ||
|
|
e78adae9d6 | ||
|
|
f5c0db55ac |
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
|
build
|
||||||
*~
|
*~
|
||||||
*.o
|
*.o
|
||||||
*.a
|
*.a
|
||||||
@ -42,3 +43,4 @@ debian/files
|
|||||||
debian/tmp
|
debian/tmp
|
||||||
compile
|
compile
|
||||||
INSTALL
|
INSTALL
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
dnl Process this file with autoconf to produce a configure script.
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
|
|
||||||
AC_INIT(libsexpr, m4_esyscmd([tr -d '\n' < VERSION]))
|
AC_INIT([libsexpr],[m4_esyscmd(tr -d '\n' < VERSION)])
|
||||||
|
|
||||||
AC_CONFIG_HEADERS([config.h])
|
AC_CONFIG_HEADERS([config.h])
|
||||||
|
|
||||||
@ -30,8 +30,9 @@ AS_IF([test "x$enable_faststack_alloc" = "xyes"], [
|
|||||||
AC_DEFINE([USE_FASTSTACK_ALLOC], 1, [using faststack allocation within parser])
|
AC_DEFINE([USE_FASTSTACK_ALLOC], 1, [using faststack allocation within parser])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_OUTPUT([
|
AC_CONFIG_FILES([
|
||||||
Makefile
|
Makefile
|
||||||
lib/libsexpr.pc
|
lib/libsexpr.pc
|
||||||
lib/Makefile
|
lib/Makefile
|
||||||
include/Makefile])
|
include/Makefile])
|
||||||
|
AC_OUTPUT
|
||||||
|
|||||||
38
debian/copyright
vendored
38
debian/copyright
vendored
@ -1,38 +0,0 @@
|
|||||||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
|
||||||
Upstream-Name: libsexpr
|
|
||||||
Source: <url://example.com>
|
|
||||||
|
|
||||||
Files: *
|
|
||||||
Copyright: <years> <put author's name and email here>
|
|
||||||
<years> <likewise for another author>
|
|
||||||
License: <special license>
|
|
||||||
<Put the license of the package here indented by 1 space>
|
|
||||||
<This follows the format of Description: lines in control file>
|
|
||||||
.
|
|
||||||
<Including paragraphs>
|
|
||||||
|
|
||||||
# If you want to use GPL v2 or later for the /debian/* files use
|
|
||||||
# the following clauses, or change it to suit. Delete these two lines
|
|
||||||
Files: debian/*
|
|
||||||
Copyright: 2014 Alexander Vdolainen <vdo@daze>
|
|
||||||
License: GPL-2+
|
|
||||||
This package is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
.
|
|
||||||
This package is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
.
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
.
|
|
||||||
On Debian systems, the complete text of the GNU General
|
|
||||||
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
|
|
||||||
|
|
||||||
# Please also look if there are files or directories which have a
|
|
||||||
# different copyright/license attached and list them here.
|
|
||||||
# Please avoid to pick license terms that are more restrictive than the
|
|
||||||
# packaged work, as it may make Debian's contributions unacceptable upstream.
|
|
||||||
@ -97,6 +97,17 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
CSTRING *sadd(CSTRING *s, char *a);
|
CSTRING *sadd(CSTRING *s, char *a);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Concatenate the len bytes of the second argument to the CSTRING
|
||||||
|
* passed in the first.
|
||||||
|
* A NULL return value indicates that something went wrong and that
|
||||||
|
* sexp_errno should be checked for the cause. The contents of s are
|
||||||
|
* left alone. As such, the caller should check the pointer returned
|
||||||
|
* before overwriting the value of s, as this may result in a memory
|
||||||
|
* leak if an error condition occurs.
|
||||||
|
*/
|
||||||
|
CSTRING *snadd(CSTRING *s, char *a, size_t len);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Append a character to the end of the CSTRING.
|
* Append a character to the end of the CSTRING.
|
||||||
* A NULL return value indicates that something went wrong and that
|
* A NULL return value indicates that something went wrong and that
|
||||||
|
|||||||
@ -17,13 +17,8 @@ libsexpr_la_SOURCES = \
|
|||||||
cstring.c event_temp.c faststack.c io.c cswrap.c \
|
cstring.c event_temp.c faststack.c io.c cswrap.c \
|
||||||
parser.c sexp.c sexp_memory.c sexp_ops.c sexp_vis.c
|
parser.c sexp.c sexp_memory.c sexp_ops.c sexp_vis.c
|
||||||
|
|
||||||
libsexpr_la_LDFLAGS =
|
|
||||||
|
|
||||||
libsexpr_la_LIBADD =
|
|
||||||
|
|
||||||
pkgconfigdir = $(libdir)/pkgconfig
|
pkgconfigdir = $(libdir)/pkgconfig
|
||||||
pkgconfig_DATA = libsexpr.pc
|
pkgconfig_DATA = libsexpr.pc
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
libsexpr.pc.in
|
libsexpr.pc.in
|
||||||
|
|
||||||
|
|||||||
@ -86,7 +86,18 @@ CSTRING *snew(size_t s) {
|
|||||||
return cs;
|
return cs;
|
||||||
}
|
}
|
||||||
|
|
||||||
CSTRING *sadd(CSTRING *s, char *a) {
|
CSTRING *sadd(CSTRING *s, char *a)
|
||||||
|
{
|
||||||
|
size_t len = strlen(a);
|
||||||
|
|
||||||
|
if(!s) return NULL;
|
||||||
|
if(!a || !len) return s;
|
||||||
|
|
||||||
|
return snadd(s, a, len);
|
||||||
|
}
|
||||||
|
|
||||||
|
CSTRING *snadd(CSTRING *s, char *a, size_t len)
|
||||||
|
{
|
||||||
size_t alen;
|
size_t alen;
|
||||||
char *newbase;
|
char *newbase;
|
||||||
|
|
||||||
@ -100,7 +111,7 @@ CSTRING *sadd(CSTRING *s, char *a) {
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
alen = strlen(a);
|
alen = len;
|
||||||
|
|
||||||
if (s->curlen + alen >= s->len) {
|
if (s->curlen + alen >= s->len) {
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@ -125,9 +136,10 @@ CSTRING *sadd(CSTRING *s, char *a) {
|
|||||||
s->base = newbase;
|
s->base = newbase;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(&s->base[s->curlen],a,alen);
|
memcpy(&s->base[s->curlen], a, alen);
|
||||||
s->curlen += alen;
|
s->curlen += alen;
|
||||||
s->base[s->curlen] = 0;
|
s->base[s->curlen] = 0;
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
1
packaging/debian/.gitignore
vendored
Normal file
1
packaging/debian/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.debhelper
|
||||||
@ -1,3 +1,10 @@
|
|||||||
|
libsexpr (1.3.3) stable; urgency=medium
|
||||||
|
|
||||||
|
* Release 1.3.3 More helper functions to easy works on a simple S expressions
|
||||||
|
* Updates to the new and uptodate libraries
|
||||||
|
|
||||||
|
-- Alexander Vdolainen <alex@vapaa.xyz> Mon, 3 Jun 2019 23:34:56 +0100
|
||||||
|
|
||||||
libsexpr (1.3.1) stable; urgency=medium
|
libsexpr (1.3.1) stable; urgency=medium
|
||||||
|
|
||||||
* Release 1.3.1 Added helper functions to operate with S-expressions
|
* Release 1.3.1 Added helper functions to operate with S-expressions
|
||||||
39
packaging/debian/copyright
Normal file
39
packaging/debian/copyright
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
Upstream-Name: libsexpr
|
||||||
|
Source: <https://vapaa.work/public/libsexpr>
|
||||||
|
|
||||||
|
Files: *
|
||||||
|
Copyright: 2003 - 2006 Matthew Sottile <mjsottile@gmail.com>
|
||||||
|
2010 - 2014 Alexander Vdolainen <alex@vapaa.xyz>
|
||||||
|
License: LGPL-2
|
||||||
|
Additionally, this library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Lesser General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2.1 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public License
|
||||||
|
along with this library; if not, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, U SA
|
||||||
|
|
||||||
|
Files: debian/*
|
||||||
|
Copyright: 2014, 2025 Alexander Vdolainen <alex@vapaa.xyz>
|
||||||
|
License: GPL-2+
|
||||||
|
This package is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
.
|
||||||
|
This package is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
.
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
.
|
||||||
|
On Debian systems, the complete text of the GNU General
|
||||||
|
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
|
||||||
101
packaging/gentoo/libsexpr.ebuild
Normal file
101
packaging/gentoo/libsexpr.ebuild
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
# Copyright 1999-2025 Gentoo Authors
|
||||||
|
EAPI=8
|
||||||
|
|
||||||
|
# This is an ebuild template
|
||||||
|
# Modify it accordingly
|
||||||
|
DESCRIPTION="S-Expr — simple library to work with S-expressions"
|
||||||
|
HOMEPAGE="https://vapaa.work/public/libsexpr"
|
||||||
|
SRC_URI="https://vapaa.work/public/libsexpr/archive/v1.3.3d.tar.gz"
|
||||||
|
|
||||||
|
LICENSE="LGPL-2.1"
|
||||||
|
SLOT="0"
|
||||||
|
KEYWORDS=""
|
||||||
|
IUSE=""
|
||||||
|
|
||||||
|
# Build-time and run-time dependencies
|
||||||
|
DEPEND="
|
||||||
|
sys-devel/autoconf
|
||||||
|
sys-devel/automake
|
||||||
|
sys-devel/libtool
|
||||||
|
sys-devel/make
|
||||||
|
"
|
||||||
|
|
||||||
|
RDEPEND=""
|
||||||
|
|
||||||
|
src_unpack() {
|
||||||
|
default
|
||||||
|
# If archive extracts into a subdir not equal to ${P%,*}, adjust here.
|
||||||
|
# e.g. mv "${WORKDIR}/${PF}" "${WORKDIR}/${PN}-${PV}"
|
||||||
|
}
|
||||||
|
|
||||||
|
src_prepare() {
|
||||||
|
default
|
||||||
|
|
||||||
|
# If project ships autotools files missing, regenerate
|
||||||
|
if ! [[ -x configure ]]; then
|
||||||
|
einfo "Regenerating configure with autoreconf"
|
||||||
|
aclocal
|
||||||
|
autoconf
|
||||||
|
automake --add-missing --copy
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Apply any necessary patches here with epatch or quilt
|
||||||
|
}
|
||||||
|
|
||||||
|
src_configure() {
|
||||||
|
local my_cflags="${CFLAGS}"
|
||||||
|
local my_ldflags="${LDFLAGS}"
|
||||||
|
|
||||||
|
export CFLAGS="${my_cflags}"
|
||||||
|
export LDFLAGS="${my_ldflags}"
|
||||||
|
|
||||||
|
econf \
|
||||||
|
--prefix="${EPREFIX}/usr" \
|
||||||
|
--libdir="${EPREFIX}/usr/lib64" \
|
||||||
|
--sysconfdir="${EPREFIX}/etc" \
|
||||||
|
--disable-static \
|
||||||
|
--enable-shared
|
||||||
|
}
|
||||||
|
|
||||||
|
src_compile() {
|
||||||
|
emake -j"${MAKEOPTS}"
|
||||||
|
}
|
||||||
|
|
||||||
|
src_install() {
|
||||||
|
emake DESTDIR="${D}" install
|
||||||
|
|
||||||
|
# Ensure pkg-config file is installed to /usr/lib/pkgconfig (or multiarch dir)
|
||||||
|
dodir "${EPREFIX}/usr/lib64/pkgconfig"
|
||||||
|
if [[ -f "${D}${EPREFIX}/usr/lib64/pkgconfig/libsexpr.pc" ]]; then
|
||||||
|
# already installed by 'make install'
|
||||||
|
:
|
||||||
|
else
|
||||||
|
# If build created mylib.pc in build dir (mylib.pc.in processed by configure),
|
||||||
|
# install it explicitly
|
||||||
|
if [[ -f "${S}/libsexpr.pc" ]]; then
|
||||||
|
doins -m 0644 "${S}/libsexpr.pc" "${EPREFIX}/usr/lib64/pkgconfig/"
|
||||||
|
elif [[ -f "${S}/libsexpr.pc.in" ]]; then
|
||||||
|
# generate from template using sed substitutions performed by configure
|
||||||
|
# but usually configure already created the .pc in build tree
|
||||||
|
eseinfo "Warning: libsexpr.pc not found after make install"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# strip binaries & libs
|
||||||
|
if [[ -n "${STRIP}" ]]; then
|
||||||
|
dodoc COPYING README || true
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_preinst() {
|
||||||
|
elog "Installing ${PF}"
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postinst() {
|
||||||
|
elog "Installed ${PF}"
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postrm() {
|
||||||
|
elog "Removed ${PF}"
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user