OSSP CVS Repository

ossp - Check-in [1595]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 1595
Date: 2002-Jan-21 14:32:35 (local)
2002-Jan-21 13:32:35 (UTC)
User:rse
Branch:
Comment: Initial revision
Tickets:
Inspections:
Files:
ossp-pkg/path/Makefile.in      1.1 -> 1.1.1.1    
ossp-pkg/path/Makefile.in      added-> 1.1
ossp-pkg/path/configure.ac      added-> 1.1
ossp-pkg/path/devtool      1.1 -> 1.1.1.1    
ossp-pkg/path/devtool      added-> 1.1
ossp-pkg/path/devtool.conf      1.1 -> 1.1.1.1    
ossp-pkg/path/devtool.conf      added-> 1.1
ossp-pkg/path/devtool.func      1.1 -> 1.1.1.1    
ossp-pkg/path/devtool.func      added-> 1.1
ossp-pkg/path/path-config.in      1.1 -> 1.1.1.1    
ossp-pkg/path/path-config.in      added-> 1.1
ossp-pkg/path/path_basename.c      1.1 -> 1.1.1.1    
ossp-pkg/path/path_basename.c      added-> 1.1
ossp-pkg/path/path_dirname.c      1.1 -> 1.1.1.1    
ossp-pkg/path/path_dirname.c      added-> 1.1
ossp-pkg/path/path_resolve.c      1.1 -> 1.1.1.1    
ossp-pkg/path/path_resolve.c      added-> 1.1
ossp-pkg/path/path_test.c      1.1 -> 1.1.1.1    
ossp-pkg/path/path_test.c      added-> 1.1
ossp-pkg/path/path_test.pl      1.1 -> 1.1.1.1    
ossp-pkg/path/path_test.pl      added-> 1.1

ossp-pkg/path/Makefile.in -> 1.1

*** /dev/null    Mon Apr 29 01:22:13 2024
--- -    Mon Apr 29 01:24:38 2024
***************
*** 0 ****
--- 1,112 ----
+ ##
+ ##  path - OSSP Path Library
+ ##  Copyright (c) 2002 Ralf S. Engelschall <rse@engelschall.com>
+ ##  Copyright (c) 2002 The OSSP Project <http://www.ossp.org/>
+ ##  Copyright (c) 2002 Cable & Wireless Deutschland <http://www.cw.com/de/>
+ ##
+ ##  This file is part of OSSP path, a filesystem path manipulation library
+ ##  which can be found at http://www.ossp.org/pkg/path/.
+ ##
+ ##  Permission to use, copy, modify, and distribute this software for
+ ##  any purpose with or without fee is hereby granted, provided that
+ ##  the above copyright notice and this permission notice appear in all
+ ##  copies.
+ ##
+ ##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ ##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ ##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ ##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+ ##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ ##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ ##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ ##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ ##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ ##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ ##  SUCH DAMAGE.
+ ##
+ ##  Makefile.in: make(1) build procedure
+ ##
+ 
+ @SET_MAKE@
+ 
+ DESTDIR     =
+ prefix      = @prefix@
+ exec_prefix = @exec_prefix@
+ bindir      = @bindir@
+ libdir      = @libdir@
+ includedir  = @includedir@
+ mandir      = @mandir@
+ 
+ CC          = @CC@
+ CPPFLAGS    = @CPPFLAGS@
+ CFLAGS      = @DEFS@ @CFLAGS@
+ LDFLAGS     = @LDFLAGS@
+ LIBS        = @LIBS@
+ RM          = rm -f
+ RMDIR       = rmdir
+ SHTOOL      = ./shtool
+ LIBTOOL     = ./libtool
+ TRUE        = true
+ 
+ LIB_NAME    = libpath.la
+ LIB_OBJS    = path_abs2rel.lo path_rel2abs.lo path_resolve.lo path_dirname.lo path_basename.lo 
+ 
+ TST_NAME    = path_test
+ TST_OBJS    = path_test.o
+ 
+ .SUFFIXES:
+ .SUFFIXES: .c .o .lo
+ 
+ all: $(LIB_NAME) $(TST_NAME)
+ 
+ .c.o:
+        $(CC) $(CPPFLAGS) $(CFLAGS) -c $<
+ 
+ .c.lo:
+        @$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -c $<
+ 
+ $(LIB_NAME): $(LIB_OBJS)
+        @$(LIBTOOL) --mode=link $(CC) -o $(LIB_NAME) $(LIB_OBJS) -rpath $(libdir) \
+            -version-info `$(SHTOOL) version -l txt -d libtool VERSION`
+ 
+ $(TST_NAME): $(TST_OBJS) $(LIB_NAME)
+        @$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $(TST_NAME) $(TST_OBJS) $(LIB_NAME) $(LIBS)
+ 
+ check: $(TST_NAME)
+        @$(LIBTOOL) --mode=execute ./$(TST_NAME)
+ 
+ install:
+        $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(prefix)
+        $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(bindir)
+        $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(includedir)
+        $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(libdir)
+        $(SHTOOL) install -c -m 755 path-config $(DESTDIR)$(bindir)/
+        $(SHTOOL) install -c -m 644 path.h $(DESTDIR)$(includedir)/
+        @$(LIBTOOL) --mode=install $(SHTOOL) install -c -m 644 libpath.la $(DESTDIR)$(libdir)/
+ 
+ uninstall:
+        @$(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)$(libdir)/libpath.la
+        -$(RM) $(DESTDIR)$(includedir)/path.h
+        -$(RM) $(DESTDIR)$(bindir)/path-config
+        -$(RMDIR) $(DESTDIR)$(libdir) >/dev/null 2>&1 || $(TRUE)
+        -$(RMDIR) $(DESTDIR)$(includedir) >/dev/null 2>&1 || $(TRUE)
+        -$(RMDIR) $(DESTDIR)$(bindir) >/dev/null 2>&1 || $(TRUE)
+        -$(RMDIR) $(DESTDIR)$(prefix) >/dev/null 2>&1 || $(TRUE)
+ 
+ clean:
+        -$(RM) $(LIB_NAME) $(LIB_OBJS)
+        -$(RM) $(TST_NAME) $(TST_OBJS)
+        -$(RM) -r .libs >/dev/null 2>&1 || $(TRUE)
+        -$(RM) *.o *.lo
+ 
+ distclean: clean
+        -$(RM) config.log config.status config.cache
+        -$(RM) Makefile config.h path-config
+        -$(RM) libtool
+ 
+ realclean: distclean
+        -$(RM) configure config.h.in
+        -$(RM) shtool
+        -$(RM) ltmain.sh libtool.m4 config.guess config.sub
+ 


ossp-pkg/path/Makefile.in 1.1 -> 1.1.1.1



ossp-pkg/path/configure.ac -> 1.1

*** /dev/null    Mon Apr 29 01:22:13 2024
--- -    Mon Apr 29 01:24:38 2024
***************
*** 0 ****
--- 1,52 ----
+ dnl ##
+ dnl ##  path - OSSP Path Library
+ dnl ##  Copyright (c) 2002 Ralf S. Engelschall <rse@engelschall.com>
+ dnl ##  Copyright (c) 2002 The OSSP Project <http://www.ossp.org/>
+ dnl ##  Copyright (c) 2002 Cable & Wireless Deutschland <http://www.cw.com/de/>
+ dnl ##
+ dnl ##  This file is part of OSSP path, a filesystem path manipulation library
+ dnl ##  which can be found at http://www.ossp.org/pkg/path/.
+ dnl ##
+ dnl ##  Permission to use, copy, modify, and distribute this software for
+ dnl ##  any purpose with or without fee is hereby granted, provided that
+ dnl ##  the above copyright notice and this permission notice appear in all
+ dnl ##  copies.
+ dnl ##
+ dnl ##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ dnl ##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ dnl ##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ dnl ##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+ dnl ##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ dnl ##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ dnl ##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ dnl ##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ dnl ##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ dnl ##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ dnl ##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ dnl ##  SUCH DAMAGE.
+ dnl ##
+ dnl ##  configure.ac: GNU Autoconf source script
+ dnl ##
+ 
+ AC_PREREQ(2.52)
+ AC_REVISION(1.0)
+ AC_INIT(README)
+ 
+ AC_DIVERT_PUSH(NOTICE)
+ V=`./shtool version -l txt -d long VERSION`
+ ./shtool echo -e "Configuring %BOSSP path%b (Filesystem Path Library), Version %B${V}%b"
+ AC_DIVERT_POP()
+ 
+ AC_SET_MAKE
+ AC_PROG_CC
+ AC_CHECK_DEBUGGING
+ 
+ sinclude(libtool.m4)
+ AC_PROG_LIBTOOL
+ 
+ AC_CONFIG_HEADERS(config.h)
+ AC_CONFIG_FILES(Makefile path-config)
+ AC_OUTPUT
+ 
+ chmod a+x path-config
+ 


ossp-pkg/path/devtool -> 1.1

*** /dev/null    Mon Apr 29 01:22:13 2024
--- -    Mon Apr 29 01:24:38 2024
***************
*** 0 ****
--- 1,47 ----
+ #!/bin/sh
+ ##
+ ##  devtool -- Development Tool
+ ##  Copyright (c) 2001 Ralf S. Engelschall <rse@engelschall.com> 
+ ##
+ 
+ if [ $# -eq 0 ]; then
+     echo "devtool:USAGE: devtool <command> [<arg> ...]" 1>&2
+     exit 1
+ fi
+ 
+ cmd="$1"
+ shift
+ 
+ devtoolfunc="./devtool.func"
+ 
+ if [ ! -f devtool.conf ]; then
+     echo "devtool:ERROR: no devtool.conf in current directory" 1>&2
+     exit 1
+ fi
+ 
+ cmdline=`grep "^%$cmd" devtool.conf`
+ if [ ".$cmdline" = . ]; then
+     echo "devtool:ERROR: command $cmd not found in devtool.conf" 1>&2
+     exit 1
+ fi
+ 
+ if [ ".$TMPDIR" != . ]; then
+     tmpdir="$TMPDIR"
+ elif [ ".$TEMPDIR" != . ]; then
+     tmpdir="$TEMPDIR"
+ else
+     tmpdir="/tmp"
+ fi
+ tmpfile="$tmpdir/rc.$$.tmp"
+ 
+ rm -f $tmpfile
+ touch $tmpfile
+ echo ". $devtoolfunc" >>$tmpfile
+ ( sed <devtool.conf -e "1,/^%common/d" -e '/^%.*/,$d'
+   sed <devtool.conf -e "1,/^%$cmd/d" -e '/^%.*/,$d' ) |\
+ sed -e 's;\([  ]\)@\([a-zA-Z_][a-zA-Z0-9_]*\);\1devtool_\2;' >>$tmpfile
+ 
+ sh $tmpfile "$@"
+ 
+ rm -f $tmpfile >/dev/null 2>&1 || true
+ 


ossp-pkg/path/devtool 1.1 -> 1.1.1.1



ossp-pkg/path/devtool.conf -> 1.1

*** /dev/null    Mon Apr 29 01:22:13 2024
--- -    Mon Apr 29 01:24:38 2024
***************
*** 0 ****
--- 1,31 ----
+ ##
+ ##  devtool.conf -- Development Tool Configuration
+ ##
+ 
+ %autogen
+     @autogen shtool   1.5.4 "1.5.*" all
+     @autogen libtool  1.4.2 "1.4*"
+     @autogen autoconf 2.52  "2.5.*"
+ 
+ %autoclean
+     @autoclean shtool
+     @autoclean libtool
+     @autoclean autoconf
+ 
+ %configure
+     ./configure \
+         --prefix=/tmp/path \
+         --disable-shared \
+         --enable-debug \
+         "$@"
+ 
+ %version
+     ./shtool version -l txt -n "OSSP path" -e VERSION
+ 
+ %dist
+     make distclean >/dev/null 2>&1
+     ./shtool fixperm -v .
+     V=`./shtool version -l txt -d short VERSION`
+     ./shtool tarball -o path-${V}.tar.gz -d path-${V} -u ossp -g ossp \
+                      -e 'CVS,\.cvsignore,\.[ao],^\.,devtool.conf' -c 'gzip --best' .
+ 


ossp-pkg/path/devtool.conf 1.1 -> 1.1.1.1



ossp-pkg/path/devtool.func -> 1.1

*** /dev/null    Mon Apr 29 01:22:13 2024
--- -    Mon Apr 29 01:24:38 2024
***************
*** 0 ****
--- 1,72 ----
+ ##
+ ##  devtool.func -- Development Tool Functions
+ ##  Copyright (c) 2001 Ralf S. Engelschall <rse@engelschall.com> 
+ ##
+ 
+ devtool_require () {
+     t="$1"; o="$2"; p="$3"; e="$4"; a="$5"
+     v=`($t $o | head -1 | awk "{ print \\\$$p; }") 2>/dev/null`
+     if [ ".$v" = . ]; then
+         echo "devtool:ERROR: unable to determine version of $t" 1>&2
+         exit 1
+     fi
+     case "$v" in
+         $e )
+             ;;
+         $a )
+             echo "devtool:WARNING: $t version $v still accepted, although expected $e." 1>&2
+             ;;
+         * )
+             echo "devtool:ERROR: $t version $e expected, but found $v." 1>&2
+             exit 1
+             ;;
+     esac
+     echo "$v"
+ }
+ 
+ devtool_autogen () {
+     tool=$1
+     shift
+     case $tool in
+         autoconf )
+             autoconf_version=`devtool_require autoconf --version 4 "$1" "$2"`
+             echo "generating (GNU Autoconf $autoconf_version): configure config.h.in"
+             autoconf
+             autoheader 2>&1 | grep -v "is unchanged"
+             ;;
+         libtool )
+             libtoolize_version=`devtool_require libtoolize --version 4 "$1" "$2"`
+             echo "generating (GNU Libtool $libtoolize_version): ltmain.sh, libtool.m4, config.guess, config.sub"
+             libtoolize --force --copy >/dev/null 2>&1
+             cp `libtoolize --force --copy --dry-run | grep "add the contents of" |\
+                 sed -e 's;^[^\`]*\`;;' -e "s;'.*;;"` libtool.m4
+             ;;
+         shtool )
+             shtoolize_version=`devtool_require shtoolize -v 3 "$1" "$2"`
+             echo "generating (GNU Shtool $shtoolize_version): shtool"
+             shift
+             shift
+             shtoolize -q "$@"
+             ;;
+     esac
+ }
+ 
+ devtool_autoclean () {
+     tool=$1
+     shift
+     case $tool in
+         autoconf )
+             echo "removing: configure config.h.in"
+             rm -f configure config.h.in
+             ;;
+         libtool )
+             echo "removing: ltmain.sh libtool.m4 config.guess config.sub"
+             rm -f ltmain.sh libtool.m4 config.guess config.sub
+             ;;
+         shtool )
+             echo "removing: shtool"
+             rm -f shtool
+             ;;
+     esac
+ }
+ 


ossp-pkg/path/devtool.func 1.1 -> 1.1.1.1



ossp-pkg/path/path-config.in -> 1.1

*** /dev/null    Mon Apr 29 01:22:13 2024
--- -    Mon Apr 29 01:24:38 2024
***************
*** 0 ****
--- 1,145 ----
+ #!/bin/sh
+ ##
+ ##  path - OSSP Path Library
+ ##  Copyright (c) 2002 Ralf S. Engelschall <rse@engelschall.com>
+ ##  Copyright (c) 2002 The OSSP Project <http://www.ossp.org/>
+ ##  Copyright (c) 2002 Cable & Wireless Deutschland <http://www.cw.com/de/>
+ ##
+ ##  This file is part of OSSP path, a filesystem path manipulation library
+ ##  which can be found at http://www.ossp.org/pkg/path/.
+ ##
+ ##  Permission to use, copy, modify, and distribute this software for
+ ##  any purpose with or without fee is hereby granted, provided that
+ ##  the above copyright notice and this permission notice appear in all
+ ##  copies.
+ ##
+ ##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ ##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ ##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ ##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+ ##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ ##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ ##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ ##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ ##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ ##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ ##  SUCH DAMAGE.
+ ##
+ ##  path-config.in: library build utility
+ ##
+ 
+ DIFS='         
+ '
+ 
+ prefix="@prefix@"
+ exec_prefix="@exec_prefix@"
+ 
+ my_prefix="$prefix"
+ my_exec_prefix="$exec_prefix"
+ my_bindir="@bindir@"
+ my_libdir="@libdir@"
+ my_includedir="@includedir@"
+ my_mandir="@mandir@"
+ my_datadir="@datadir@"
+ my_acdir="@datadir@/aclocal"
+ my_cflags="@CFLAGS@"
+ my_ldflags="@LDFLAGS@"
+ my_libs="@LIBS@"
+ my_version="@PATH_VERSION_STR@"
+ 
+ help=no
+ version=no
+ 
+ usage="path-config"
+ usage="$usage [--help] [--version] [--all]"
+ usage="$usage [--prefix] [--exec-prefix] [--bindir] [--libdir] [--includedir] [--mandir] [--datadir] [--acdir]"
+ usage="$usage [--cflags] [--ldflags] [--libs]"
+ if [ $# -eq 0 ]; then
+     echo "path-config:Error: Invalid option" 1>&2
+     echo "path-config:Usage: $usage" 1>&2
+     exit 1
+ fi
+ output=''
+ output_extra=''
+ all=no
+ prev=''
+ OIFS="$IFS" IFS="$DIFS"
+ for option
+ do
+     if [ ".$prev" != . ]; then
+         eval "$prev=\$option"
+         prev=''
+         continue
+     fi
+     case "$option" in
+         -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+            *) optarg='' ;;
+     esac
+     case "$option" in
+         --help|-h)
+             echo "Usage: $usage"
+             exit 0
+             ;;
+         --version|-v)
+             echo "OSSP path $my_version"
+             exit 0
+             ;;
+         --all)
+             all=yes
+             ;;
+         --prefix)
+             output="$output $my_prefix"
+             ;;
+         --exec-prefix)
+             output="$output $my_exec_prefix"
+             ;;
+         --bindir)
+             output="$output $my_bindir"
+             ;;
+         --libdir)
+             output="$output $my_libdir"
+             ;;
+         --includedir)
+             output="$output $my_includedir"
+             ;;
+         --mandir)
+             output="$output $my_mandir"
+             ;;
+         --datadir)
+             output="$output $my_datadir"
+             ;;
+         --acdir)
+             output="$output $my_acdir"
+             ;;
+         --cflags)
+             output="$output -I$my_includedir"
+             output_extra="$output_extra $my_cflags"
+             ;;
+         --ldflags)
+             output="$output -L$my_libdir"
+             output_extra="$output_extra $my_ldflags"
+             ;;
+         --libs)
+             output="$output -lpath"
+             output_extra="$output_extra $my_libs"
+             ;;
+         * )
+             echo "sa-config:Error: Invalid option" 1>&2
+             echo "sa-config:Usage: $usage" 1>&2
+             exit 1;
+             ;;
+     esac
+ done
+ IFS="$OIFS"
+ if [ ".$prev" != . ]; then
+     echo "path-config:Error: missing argument to --`echo $prev | sed 's/_/-/g'`" 1>&2
+     exit 1
+ fi
+ if [ ".$output" != . ]; then
+     if [ ".$all" = .yes ]; then
+         output="$output $output_extra"
+     fi
+     echo $output
+ fi
+ 


ossp-pkg/path/path-config.in 1.1 -> 1.1.1.1



ossp-pkg/path/path_basename.c -> 1.1

*** /dev/null    Mon Apr 29 01:22:13 2024
--- -    Mon Apr 29 01:24:38 2024
***************
*** 0 ****
--- 1,76 ----
+ 
+ /*-
+  * Copyright (c) 2000 Chris Costello <chris@FreeBSD.org>
+  * All rights reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+  * are met:
+  * 1. Redistributions of source code must retain the above copyright
+  *    notice, this list of conditions and the following disclaimer.
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in the
+  *    documentation and/or other materials provided with the distribution.
+  *
+  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  *
+  */
+ 
+ #include <string.h>
+ #include <sys/param.h>
+ 
+ #include "path.h"
+ 
+ char *
+ path_basename(
+        char *outbuf,
+     size_t outsize,
+        const char *path)
+ {
+        const char *cp;
+        size_t len;
+     int n;
+ 
+     /* argument consistency check */
+        if (path == NULL || *path == '\0')
+                return (strncpy(outbuf, ".", outsize));
+ 
+     /* skip leading slashes */ 
+        len = strspn(path, "/");
+        if (len > 0)
+                path += len - 1;
+        if (path[0] == '/' && path[1] == '\0')
+                return (strncpy(outbuf, "/", outsize));
+ 
+        /* skip trailing slashes. */
+        len = strlen(path) - 1;
+        for (; len > 0 && path[len] == '/'; len--)
+                ;
+        cp = path + len;
+ 
+        /* look for the beginning of the final path component */
+        for (; *cp != '/' && cp > path; cp--)
+                ;
+ 
+     /* copy basename to result buffer */
+     if (cp != path)
+         cp++; /* the path consisted of more than one component */
+        n = len - (cp - path) + 1;
+     if (n > MAXPATHLEN)
+         n = MAXPATHLEN;
+     strncpy(outbuf, cp, n);
+     outbuf[n] = '\0';
+ 
+        return outbuf;
+ }
+ 


ossp-pkg/path/path_basename.c 1.1 -> 1.1.1.1



ossp-pkg/path/path_dirname.c -> 1.1

*** /dev/null    Mon Apr 29 01:22:13 2024
--- -    Mon Apr 29 01:24:38 2024
***************
*** 0 ****
--- 1,75 ----
+ 
+ /*-
+  * Copyright (c) 2000 Chris Costello <chris@FreeBSD.org>
+  * All rights reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+  * are met:
+  * 1. Redistributions of source code must retain the above copyright
+  *    notice, this list of conditions and the following disclaimer.
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in the
+  *    documentation and/or other materials provided with the distribution.
+  *
+  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  *
+  *  $FreeBSD$
+  */
+ 
+ #include <sys/param.h>
+ #include <errno.h>
+ #include <string.h>
+ 
+ #include "path.h"
+ 
+ char *
+ path_dirname(
+     char *outbuf,
+     size_t outsize,
+     const char *path)
+ {
+     const char *cp;
+     int n;
+ 
+     /* argument consistency check */
+     if (path == NULL || path[0] == '\0')
+         return (strncpy(outbuf, ".", outsize));
+ 
+     /* skip trailing slashes */
+     cp = path + strlen(path) - 1;
+     for (; cp > path && *cp == '/'; cp--)
+         ;
+     if (cp == path)
+         return (strncpy(outbuf, "/", outsize));
+ 
+     /* skip last path component */
+     for (; cp > path && *cp != '/'; cp--)
+         ;
+     if (cp == path && *cp != '/')
+         return (strncpy(outbuf, ".", outsize));
+ 
+     /* skip slashes off before the final path component */
+     for (; cp > path && *cp == '/'; cp--)
+         ;
+ 
+     /* copy directory to output buffer */
+     n = cp - path + 1;
+     if (n > MAXPATHLEN)
+         n = MAXPATHLEN;
+     strncpy(outbuf, path, n);
+     outbuf[n] = '\0';
+ 
+     return outbuf;
+ }
+ 


ossp-pkg/path/path_dirname.c 1.1 -> 1.1.1.1



ossp-pkg/path/path_resolve.c -> 1.1

*** /dev/null    Mon Apr 29 01:22:13 2024
--- -    Mon Apr 29 01:24:38 2024
***************
*** 0 ****
--- 1,160 ----
+ 
+ /*
+  * Copyright (c) 1994
+  *  The Regents of the University of California.  All rights reserved.
+  *
+  * This code is derived from software contributed to Berkeley by
+  * Jan-Simon Pendry.
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+  * are met:
+  * 1. Redistributions of source code must retain the above copyright
+  *    notice, this list of conditions and the following disclaimer.
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in the
+  *    documentation and/or other materials provided with the distribution.
+  * 3. All advertising materials mentioning features or use of this software
+  *    must display the following acknowledgement:
+  *       This product includes software developed by the University of
+  *       California, Berkeley and its contributors.
+  * 4. Neither the name of the University nor the names of its contributors
+  *    may be used to endorse or promote products derived from this software
+  *    without specific prior written permission.
+  *
+  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  */
+ 
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ 
+ #include "path.h"
+ 
+ char *
+ path_resolve(
+     char *outbuf,
+     size_t outsize,
+     const char *path)
+ {
+     struct stat sb;
+     int fd, n, rootd, serrno;
+     char *p, *q, wbuf[MAXPATHLEN];
+     char resolved[MAXPATHLEN];
+     int symlinks = 0;
+ 
+     /* save the starting point */
+     if ((fd = open(".", O_RDONLY)) < 0) {
+         strcpy(resolved, ".");
+         return NULL;
+     }
+ 
+     /*
+      * Find the dirname and basename from the path to be resolved.
+      * Change directory to the dirname component.
+      * lstat() the basename part.
+      *     if it is a symlink, read in the value and loop.
+      *     if it is a directory, then change to that directory.
+      * get the current directory name and append the basename.
+      */
+     strncpy(resolved, path, MAXPATHLEN - 1);
+     resolved[MAXPATHLEN-1] = '\0';
+ loop:
+     if ((q = strrchr(resolved, '/')) != NULL) {
+         p = q + 1;
+         if (q == resolved)
+             q = "/";
+         else {
+             do {
+                 --q;
+             } while (q > resolved && *q == '/');
+             q[1] = '\0';
+             q = resolved;
+         }
+         if (chdir(q) < 0)
+             goto err1;
+     } else
+         p = resolved;
+ 
+     /* Deal with the last component. */
+     if (*p != '\0' && lstat(p, &sb) == 0) {
+         if (S_ISLNK(sb.st_mode)) {
+             if (++symlinks > MAXSYMLINKS) {
+                 errno = ELOOP;
+                 goto err1;
+             }
+             n = readlink(p, resolved, MAXPATHLEN - 1);
+             if (n < 0)
+                 goto err1;
+             resolved[n] = '\0';
+             goto loop;
+         }
+         if (S_ISDIR(sb.st_mode)) {
+             if (chdir(p) < 0)
+                 goto err1;
+             p = "";
+         }
+     }
+ 
+     /*
+      * Save the last component name and get the full pathname of
+      * the current directory.
+      */
+     strcpy(wbuf, p);
+     if (getcwd(resolved, MAXPATHLEN) == 0)
+         goto err1;
+ 
+     /*
+      * Join the two strings together, ensuring that the right thing
+      * happens if the last component is empty, or the dirname is root.
+      */
+     if (resolved[0] == '/' && resolved[1] == '\0')
+         rootd = 1;
+     else
+         rootd = 0;
+ 
+     if (*wbuf) {
+         if (strlen(resolved) + strlen(wbuf) + rootd + 1 > MAXPATHLEN) {
+             errno = ENAMETOOLONG;
+             goto err1;
+         }
+         if (rootd == 0)
+             strcat(resolved, "/");
+         strcat(resolved, wbuf);
+     }
+ 
+     /* Go back to where we came from. */
+     if (fchdir(fd) < 0) {
+         serrno = errno;
+         goto err2;
+     }
+ 
+     /* It's okay if the close fails, what's an fd more or less? */
+     close(fd);
+     strncpy(outbuf, resolved, outsize);
+     outbuf[outsize-1] = '\0';
+     return outbuf;
+ 
+ err1:   
+     serrno = errno;
+     fchdir(fd);
+ err2:
+     close(fd);
+     errno = serrno;
+     return NULL;
+ }
+ 


ossp-pkg/path/path_resolve.c 1.1 -> 1.1.1.1



ossp-pkg/path/path_test.c -> 1.1

*** /dev/null    Mon Apr 29 01:22:13 2024
--- -    Mon Apr 29 01:24:38 2024
***************
*** 0 ****
--- 1,40 ----
+ 
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <unistd.h>
+ #include <string.h>
+ #include <sys/param.h>
+ 
+ #include "path.h"
+ 
+ int main(int argc, char *argv[])
+ {
+        char result[MAXPATHLEN];
+        char cwd[MAXPATHLEN];
+     char *rv;
+ 
+        if (argc < 3) {
+                fprintf(stderr, "usage: test abs2rel|rel2abs path [base]\n");
+                exit(1);
+        }
+        if (argc == 3) {
+                if (getcwd(cwd, MAXPATHLEN) == NULL) {
+                        fprintf(stderr, "cannot get current directory.\n");
+                        exit(1);
+                }
+        } else
+                strcpy(cwd, argv[3]);
+        
+     if (strcmp(argv[1], "abs2rel") == 0)
+            rv = path_abs2rel(result, MAXPATHLEN, argv[2], cwd);
+     else                                                  
+            rv = path_rel2abs(result, MAXPATHLEN, argv[2], cwd);
+         
+     if (rv != NULL)
+                printf("%s\n", result);
+        else
+                printf("ERROR\n");
+        exit(0);
+ }
+ 


ossp-pkg/path/path_test.c 1.1 -> 1.1.1.1



ossp-pkg/path/path_test.pl -> 1.1

*** /dev/null    Mon Apr 29 01:22:13 2024
--- -    Mon Apr 29 01:24:38 2024
***************
*** 0 ****
--- 1,106 ----
+ 
+ @abs2rel = (
+         'a/b/c          /               a/b/c',
+         'a/b/c          /a              a/b/c',
+         '/a/b/c         a               ERROR',
+ );
+ 
+ @rel2abs = (
+         '/a/b/c         /               /a/b/c',
+         '/a/b/c         /a              /a/b/c',
+         'a/b/c          a               ERROR',
+         '..             /a              /',
+         '../            /a              /',
+         '../..          /a              /',
+         '../../         /a              /',
+         '../../..       /a              /',
+         '../../../      /a              /',
+         '../b           /a              /b',
+         '../b/          /a              /b/',
+         '../../b        /a              /b',
+         '../../b/       /a              /b/',
+         '../../../b     /a              /b',
+         '../../../b/    /a              /b/',
+         '../b/c         /a              /b/c',
+         '../b/c/        /a              /b/c/',
+         '../../b/c      /a              /b/c',
+         '../../b/c/     /a              /b/c/',
+         '../../../b/c   /a              /b/c',
+         '../../../b/c/  /a              /b/c/',
+ );
+ 
+ @common = (
+         '/a/b/c         /a/b/c          .',
+         '/a/b/c         /a/b/           c',
+         '/a/b/c         /a/b            c',
+         '/a/b/c         /a/             b/c',
+         '/a/b/c         /a              b/c',
+         '/a/b/c         /               a/b/c',
+         '/a/b/c         /a/b/c          .',
+         '/a/b/c         /a/b/c/         .',
+         '/a/b/c/        /a/b/c          ./',
+         '/a/b/          /a/b/c          ../',
+         '/a/b           /a/b/c          ..',
+         '/a/            /a/b/c          ../../',
+         '/a             /a/b/c          ../..',
+         '/              /a/b/c          ../../../',
+         '/a/b/c         /a/b/z          ../c',
+         '/a/b/c         /a/y/z          ../../b/c',
+         '/a/b/c         /x/y/z          ../../../a/b/c',
+ );
+ 
+ $cnt = 0;
+ $progname = './path_test';
+ 
+ foreach (@abs2rel) {
+     @d = split;
+     chop($result = `./$progname abs2rel $d[0] $d[1]`);
+     if ($d[2] eq $result) {
+         print STDERR "OK: abs2rel: $d[0] $d[1] -> $result\n";
+     } else {
+         print STDERR "ERROR: abs2rel: $d[0] $d[1] -> $result (It should be '$d[2]')\n";
+         $cnt++;
+     }
+ }
+ foreach (@common) {
+     @d = split;
+     chop($result = `./$progname abs2rel $d[0] $d[1]`);
+     if ($d[2] eq $result) {
+         print STDERR "OK: abs2rel: $d[0] $d[1] -> $result\n";
+     } else {
+         print STDERR "ERROR: abs2rel: $d[0] $d[1] -> $result (It should be '$d[2]')\n";
+         $cnt++;
+     }
+ }
+ 
+ foreach (@rel2abs) {
+     @d = split;
+     chop($result = `./$progname rel2abs $d[0] $d[1]`);
+     if ($d[2] eq $result) {
+         print STDERR "OK: rel2abs: $d[0] $d[1] -> $result\n";
+     } else {
+         print STDERR "ERROR: rel2abs: $d[0] $d[1] -> $result (It should be '$d[2]')\n";
+         $cnt++;
+     }
+ }
+ 
+ foreach (@common) {
+     @d = split;
+     chop($result = `./$progname rel2abs $d[2] $d[1]`);
+     if ($d[0] eq $result) {
+         print STDERR "OK: rel2abs: $d[0] $d[1] -> $result\n";
+     } else {
+         print 'X';
+         print STDERR "ERROR: rel2abs: $d[0] $d[1] -> $result (It should be '$d[2]')\n";
+         $cnt++;
+     }
+ }
+ 
+ close(LOG);
+ 
+ if ($cnt == 0) {
+     print STDERR "Total: OK.\n";
+ } else {
+     print STDERR "Total: $cnt errors detected.\n";
+ }
+ 


ossp-pkg/path/path_test.pl 1.1 -> 1.1.1.1


CVSTrac 2.0.1