[Debburn-changes] r462 - in cdrkit/trunk: debian include libschily libusal netscsid readom wodim

Eduard Bloch blade at alioth.debian.org
Sat Nov 25 01:20:22 CET 2006


Author: blade
Date: 2006-11-25 01:20:20 +0100 (Sat, 25 Nov 2006)
New Revision: 462

Added:
   cdrkit/trunk/debian/mkisofs.links
Removed:
   cdrkit/trunk/libschily/cmpnullbytes.c
   cdrkit/trunk/libschily/cvt.c
   cdrkit/trunk/libschily/cvt.h
   cdrkit/trunk/libschily/fconv.c
   cdrkit/trunk/libschily/findline.c
   cdrkit/trunk/libschily/format.c
   cdrkit/trunk/libschily/getfp.c
   cdrkit/trunk/libschily/jsprintf.c
   cdrkit/trunk/libschily/jssnprintf.c
   cdrkit/trunk/libschily/jssprintf.c
   cdrkit/trunk/libschily/match.c
   cdrkit/trunk/libschily/matchl.c
   cdrkit/trunk/libschily/printf.c
   cdrkit/trunk/libschily/serrmsg.c
   cdrkit/trunk/libschily/setfp.c
   cdrkit/trunk/libschily/strtod.c
Modified:
   cdrkit/trunk/include/CMakeLists.txt
   cdrkit/trunk/include/schily.h
   cdrkit/trunk/include/xconfig.h.in
   cdrkit/trunk/libschily/CMakeLists.txt
   cdrkit/trunk/libschily/comerr.c
   cdrkit/trunk/libschily/libschily-mapvers
   cdrkit/trunk/libschily/rename.c
   cdrkit/trunk/libusal/scsi-aix.c
   cdrkit/trunk/libusal/scsi-amigaos.c
   cdrkit/trunk/libusal/scsi-apollo.c
   cdrkit/trunk/libusal/scsi-beos.c
   cdrkit/trunk/libusal/scsi-bsd-os.c
   cdrkit/trunk/libusal/scsi-bsd.c
   cdrkit/trunk/libusal/scsi-dos.c
   cdrkit/trunk/libusal/scsi-hpux.c
   cdrkit/trunk/libusal/scsi-linux-ata.c
   cdrkit/trunk/libusal/scsi-linux-pg.c
   cdrkit/trunk/libusal/scsi-linux-sg.c
   cdrkit/trunk/libusal/scsi-mac-iokit.c
   cdrkit/trunk/libusal/scsi-next.c
   cdrkit/trunk/libusal/scsi-openserver.c
   cdrkit/trunk/libusal/scsi-os2.c
   cdrkit/trunk/libusal/scsi-osf.c
   cdrkit/trunk/libusal/scsi-qnx.c
   cdrkit/trunk/libusal/scsi-remote.c
   cdrkit/trunk/libusal/scsi-sgi.c
   cdrkit/trunk/libusal/scsi-sun.c
   cdrkit/trunk/libusal/scsi-unixware.c
   cdrkit/trunk/libusal/scsi-vms.c
   cdrkit/trunk/libusal/scsi-wnt.c
   cdrkit/trunk/libusal/scsierrs.c
   cdrkit/trunk/libusal/scsiopen.c
   cdrkit/trunk/libusal/scsitransp.c
   cdrkit/trunk/netscsid/netscsid.c
   cdrkit/trunk/readom/readom.c
   cdrkit/trunk/wodim/clone.c
   cdrkit/trunk/wodim/cue.c
Log:
Cleanup with lots of libschily/* libc reinventions

Added: cdrkit/trunk/debian/mkisofs.links
===================================================================
--- cdrkit/trunk/debian/mkisofs.links	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/debian/mkisofs.links	2006-11-25 00:20:20 UTC (rev 462)
@@ -0,0 +1,6 @@
+usr/bin/genisoimage usr/bin/mkisofs
+usr/bin/genisoimage usr/bin/mkhybrid
+usr/share/man/man8/genisoimage.8.gz usr/share/man/man8/mkisofs.8.gz
+usr/share/man/man8/genisoimage.8.gz usr/share/man/man8/mkhybrid.8.gz
+usr/share/doc/genisoimage usr/share/doc/mkisofs
+

Modified: cdrkit/trunk/include/CMakeLists.txt
===================================================================
--- cdrkit/trunk/include/CMakeLists.txt	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/include/CMakeLists.txt	2006-11-25 00:20:20 UTC (rev 462)
@@ -54,7 +54,6 @@
 
 FIND_FILE(HAVE_SYS_DKIO_H "sys/dkio.h")
 FIND_FILE(HAVE_SUN_DKIO_H "sun/dkio.h")
-FIND_FILE(HAVE_NAN_H "nan.h")
 FIND_FILE(HAVE_STDARG_H "stdarg.h")
 FIND_FILE(HAVE_STDLIB_H "stdlib.h")
 FIND_FILE(HAVE_STRING_H "string.h")
@@ -93,12 +92,24 @@
 
 INCLUDE(CheckCSourceCompiles)
 
+
    SET(TESTSRC " 
-#include <math.h>
-         int main() { return isinf(1); }
+#include <stdlib.h>
+         int main() { return ( (int) drand48()  )  ; }
          ")
 SET(CMAKE_REQUIRED_LIBRARIES )
-   CHECK_C_SOURCE_COMPILES("${TESTSRC}" HAVE_ISINF)
+   CHECK_C_SOURCE_COMPILES("${TESTSRC}" HAVE_DRAND48)
 
+
+
+   SET(TESTSRC " 
+#include <stdlib.h>
+         int main() { return ( (int) drand()  )  ; }
+         ")
+SET(CMAKE_REQUIRED_LIBRARIES )
+   CHECK_C_SOURCE_COMPILES("${TESTSRC}" HAVE_DRAND)
+
+
+
 CONFIGURE_FILE( xconfig.h.in xconfig.h)
 

Modified: cdrkit/trunk/include/schily.h
===================================================================
--- cdrkit/trunk/include/schily.h	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/include/schily.h	2006-11-25 00:20:20 UTC (rev 462)
@@ -148,7 +148,6 @@
 extern	int	ffilewrite(FILE *, void *, int);
 extern	int	flush(void);
 extern	int	fpipe(FILE **);
-/*extern	int	fprintf __PR((FILE *, const char *, ...)) __printflike__(2, 3);*/
 extern	int	getbroken(FILE *, char *, char, char **, int);
 extern	int	ofindline(FILE *, char, const char *, int, char **, int);
 extern	int	peekc(FILE *);
@@ -216,7 +215,6 @@
 extern	unsigned char	*patlmatch(const unsigned char *, const int *,
 											  const unsigned char *, int, int, int, int[]);
 
-/*extern	int	printf __PR((const char *, ...)) __printflike__(1, 2);*/
 extern	char	*movebytes(const void *, void *, int);
 
 extern	void	save_args(int, char **);
@@ -233,17 +231,6 @@
 extern	int	wait_chld(int);		/* for fspawnv_nowait() */
 extern	int	geterrno(void);
 extern	void	raisecond(const char *, long);
-#ifdef	FOUND_SIZE_T
-/*
- * We currently cannot define this here because there IXIX has a definition
- * than violates the standard.
- */
-#ifndef	HAVE_SNPRINTF
-/*PRINTFLIKE3*/
-extern	int	snprintf(char *, size_t, const char *, ...) __printflike__(3, 4);
-#endif
-#endif
-/*extern	int	sprintf __PR((char *, const char *, ...)); ist woanders falsch deklariert !!!*/
 extern	char	*strcatl(char *, ...);
 extern	int	streql(const char *, const char *);
 #ifdef	va_arg
@@ -255,19 +242,6 @@
 extern	int	ftoes(char *, double, int, int);
 extern	int	ftofs(char *, double, int, int);
 
-#ifdef	EOF	/* stdio.h has been included */
-/*PRINTFLIKE2*/
-extern	int	js_fprintf(FILE *, const char *, ...) __printflike__(2, 3);
-/*PRINTFLIKE1*/
-extern	int	js_printf(const char *, ...) __printflike__(1, 2);
-#ifdef	FOUND_SIZE_T
-/*PRINTFLIKE3*/
-extern	int	js_snprintf(char *, size_t, const char *, ...) __printflike__(3, 4);
-#endif
-/*PRINTFLIKE2*/
-extern	int	js_sprintf(char *, const char *, ...) __printflike__(2, 3);
-#endif	/* EOF */
-
 extern	void	swabbytes(void *, int);
 extern	char	**getmainfp(void);
 extern	char	**getavp(void);

Modified: cdrkit/trunk/include/xconfig.h.in
===================================================================
--- cdrkit/trunk/include/xconfig.h.in	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/include/xconfig.h.in	2006-11-25 00:20:20 UTC (rev 462)
@@ -155,15 +155,11 @@
 #define HAVE_LSTAT 1		/* lstat() is present in libc */
 #define HAVE_READLINK 1		/* readlink() is present in libc */
 #define HAVE_RENAME 1		/* rename() is present in libc */
-#define HAVE_ECVT 1		/* ecvt() is present in libc */
-#define HAVE_FCVT 1		/* fcvt() is present in libc */
-#define HAVE_GCVT 1		/* gcvt() is present in libc */
 
-/* isinf() is present in libc */
-#cmakedefine HAVE_ISINF
-#define HAVE_ISNAN 1		/* isnan() is present in libc OR LIBM , linker test elsewhere */
-#define HAVE_RAND 1		/* rand() is present in libc */
-#define HAVE_DRAND48 1		/* drand48() is present in libc */
+#cmakedefine HAVE_RAND 
+		/* rand() is present in libc */
+#cmakedefine HAVE_DRAND48
+  /* drand48() is present in libc */
 #define HAVE_SETPRIORITY 1		/* setpriority() is present in libc */
 #define HAVE_NICE 1		/* nice() is present in libc */
 #define HAVE_UNAME 1		/* uname() is present in libc */

Modified: cdrkit/trunk/libschily/CMakeLists.txt
===================================================================
--- cdrkit/trunk/libschily/CMakeLists.txt	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libschily/CMakeLists.txt	2006-11-25 00:20:20 UTC (rev 462)
@@ -1,7 +1,7 @@
 PROJECT (LIBSCHILY)
 INCLUDE_DIRECTORIES(../include ../libhfs_iso ${CMAKE_BINARY_DIR} ../wodim)
 
-SET(LIBSCHILY_SRCS  astoi.c astoll.c astoull.c breakline.c cmpbytes.c cmpnullbytes.c comerr.c cvt.c error.c fconv.c fexec.c fillbytes.c findbytes.c findline.c format.c getargs.c getav0.c getdomainname.c geterrno.c getfp.c gethostid.c gethostname.c getpagesize.c handlecond.c jsprintf.c jssnprintf.c jssprintf.c match.c matchl.c movebytes.c printf.c raisecond.c rename.c saveargs.c serrmsg.c seterrno.c setfp.c snprintf.c spawn.c sprintf.c strcatl.c strdup.c streql.c strtod.c swabbytes.c usleep.c stdio/cvmod.c stdio/dat.c stdio/fcons.c stdio/fcons64.c stdio/fdown.c stdio/fdup.c stdio/fdup64.c stdio/ffileread.c stdio/ffilewrite.c stdio/fgetline.c stdio/fgetstr.c stdio/file_raise.c stdio/fileclose.c stdio/fileluopen.c stdio/fileluopen64.c stdio/filemopen.c stdio/filemopen64.c stdio/fileopen.c stdio/fileopen64.c stdio/filepos.c stdio/filepos64.c stdio/fileread.c stdio/filereopen.c stdio/filereopen64.c stdio/fileseek.c stdio/fileseek64.c stdio/filesize.c stdio/filesize64.c stdio/filestat.c stdio/filestat64.c stdio/filewrite.c stdio/flag.c stdio/flush.c stdio/fpipe.c stdio/niread.c stdio/niwrite.c stdio/nixread.c stdio/nixwrite.c stdio/openfd.c stdio/openfd64.c stdio/peekc.c )
+SET(LIBSCHILY_SRCS  astoi.c astoll.c astoull.c breakline.c cmpbytes.c comerr.c error.c fexec.c fillbytes.c findbytes.c getargs.c getav0.c getdomainname.c geterrno.c gethostid.c gethostname.c getpagesize.c handlecond.c movebytes.c raisecond.c rename.c saveargs.c seterrno.c spawn.c strcatl.c strdup.c streql.c swabbytes.c usleep.c stdio/cvmod.c stdio/dat.c stdio/fcons.c stdio/fcons64.c stdio/fdown.c stdio/fdup.c stdio/fdup64.c stdio/ffileread.c stdio/ffilewrite.c stdio/fgetline.c stdio/fgetstr.c stdio/file_raise.c stdio/fileclose.c stdio/fileluopen.c stdio/fileluopen64.c stdio/filemopen.c stdio/filemopen64.c stdio/fileopen.c stdio/fileopen64.c stdio/filepos.c stdio/filepos64.c stdio/fileread.c stdio/filereopen.c stdio/filereopen64.c stdio/fileseek.c stdio/fileseek64.c stdio/filesize.c stdio/filesize64.c stdio/filestat.c stdio/filestat64.c stdio/filewrite.c stdio/flag.c stdio/flush.c stdio/fpipe.c stdio/niread.c stdio/niwrite.c stdio/nixread.c stdio/nixwrite.c stdio/openfd.c stdio/openfd64.c stdio/peekc.c )
 
 ADD_LIBRARY (schily STATIC ${CMAKE_CURRENT_SOURCE_DIR}/../include/xconfig.h  ${CMAKE_CURRENT_SOURCE_DIR}/../include/align.h ${LIBSCHILY_SRCS})
 

Deleted: cdrkit/trunk/libschily/cmpnullbytes.c
===================================================================
--- cdrkit/trunk/libschily/cmpnullbytes.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libschily/cmpnullbytes.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -1,118 +0,0 @@
-/*
- * This file has been modified for the cdrkit suite.
- *
- * The behaviour and appearence of the program code below can differ to a major
- * extent from the version distributed by the original author(s).
- *
- * For details, see Changelog file distributed with the cdrkit package. If you
- * received this file from another source then ask the distributing person for
- * a log of modifications.
- *
- */
-
-/* @(#)cmpnullbytes.c	1.2 03/06/15 Copyright 1988,2002-2003 J. Schilling */
-#ifndef lint
-static	char sccsid[] =
-	"@(#)cmpnullbytes.c	1.2 03/06/15 Copyright 1988,2002-2003 J. Schilling";
-#endif  /* lint */
-/*
- *	compare data against null
- *
- *	Copyright (c) 1988,2002-2003 J. Schilling
- */
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- * This program 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; see the file COPYING.  If not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <standard.h>
-#include <align.h>
-#include <schily.h>
-
-#define	DO8(a)	a; a; a; a; a; a; a; a;
-
-EXPORT int
-cmpnullbytes(fromp, cnt)
-	const void	*fromp;
-	int		cnt;
-{
-	register const char	*from	= (char *)fromp;
-	register int		n;
-
-	/*
-	 * If we change cnt to be unsigned, check for == instead of <=
-	 */
-	if ((n = cnt) <= 0)
-		return (cnt);
-
-	/*
-	 * Compare byte-wise until properly aligned for a long pointer.
-	 */
-	while (--n >= 0 && !laligned(from)) {
-		if (*from++ != 0)
-			goto cdiff;
-	}
-	n++;
-
-	if (n >= (int)(8 * sizeof (long))) {
-		if (laligned(from)) {
-			register const long *froml = (const long *)from;
-			register int rem = n % (8 * sizeof (long));
-
-			n /= (8 * sizeof (long));
-			do {
-				DO8(
-					if (*froml++ != 0)
-						break;
-				);
-			} while (--n > 0);
-
-			if (n > 0) {
-				--froml;
-				from = (const char *)froml;
-				goto ldiff;
-			}
-			from = (const char *)froml;
-			n = rem;
-		}
-
-		if (n >= 8) {
-			n -= 8;
-			do {
-				DO8(
-					if (*from++ != 0)
-						goto cdiff;
-				);
-			} while ((n -= 8) >= 0);
-			n += 8;
-		}
-		if (n > 0) do {
-			if (*from++ != 0)
-				goto cdiff;
-		} while (--n > 0);
-		return (cnt);
-	}
-	if (n > 0) do {
-		if (*from++ != 0)
-			goto cdiff;
-	} while (--n > 0);
-	return (cnt);
-ldiff:
-	n = sizeof (long);
-	do {
-		if (*from++ != 0)
-			goto cdiff;
-	} while (--n > 0);
-cdiff:
-	return (--from - (char *)fromp);
-}

Modified: cdrkit/trunk/libschily/comerr.c
===================================================================
--- cdrkit/trunk/libschily/comerr.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libschily/comerr.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -213,7 +213,7 @@
 	} else {
 		errnam = errmsgstr(err);
 		if (errnam == NULL) {
-			(void) js_snprintf(errbuf, sizeof (errbuf),
+			(void) snprintf(errbuf, sizeof (errbuf),
 						"Error %d", err);
 			errnam = errbuf;
 		}

Deleted: cdrkit/trunk/libschily/cvt.c
===================================================================
--- cdrkit/trunk/libschily/cvt.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libschily/cvt.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -1,253 +0,0 @@
-/*
- * This file has been modified for the cdrkit suite.
- *
- * The behaviour and appearence of the program code below can differ to a major
- * extent from the version distributed by the original author(s).
- *
- * For details, see Changelog file distributed with the cdrkit package. If you
- * received this file from another source then ask the distributing person for
- * a log of modifications.
- *
- */
-
-/* @(#)cvt.c	1.7 03/06/15 Copyright 1998 J. Schilling */
-/*
- *	Compatibility routines for 4.4BSD based C-libraries ecvt()/fcvt()
- *	and a working gcvt() that is needed on 4.4BSD and GNU libc systems.
- *
- *	On 4.4BSD, gcvt() is missing, the gcvt() implementation from GNU libc
- *	is not working correctly.
- *
- *	Neither __dtoa() nor [efg]cvt() are MT safe.
- *
- *	Copyright (c) 1998 J. Schilling
- */
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- * This program 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; see the file COPYING.  If not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <stdxlib.h>
-#include <utypes.h>
-#include <standard.h>
-
-#include "cvt.h"
-
-#ifndef	HAVE_DTOA	/* 4.4BSD floating point implementation */
-/*
- * As a hint from Thomas Langer <Langer.Thomas at gmx.net>, we use strtod.c in
- * hope that we then will be able to print floating point numbers on all
- * platforms, even those without *cvt() and without __dtoa() in libc.
- *
- * ... of course, we need to decide when we need to include strtod.c ...
- *
- * We come into this file if autoconf found that gcvt(), fcvt() or ecvt() is
- * missing. If we are on a *BSD alike system, there is __dtoa() but neither
- * gcvt() nor fcvt() or ecvt(), so we emulate all three functions via __dtoa().
- * Glibc has a buggy gcvt() which causes an endless recursion,
- * fcvt() from Cygwin32 is buggy, so we emulate fcvt() via ecvt() on Cygwin.
- *
- * If at least ecvt() is present, we don't need __dtoa() from strtod.c
- */
-#include "strtod.c"
-/* #define	HAVE_DTOA */
-#endif	/* !defined(HAVE_DTOA) */
-
-#if !defined(HAVE_ECVT)
-char *
-ecvt(value, ndigit, decpt, sign)
-	double	value;
-	int	ndigit;
-	int	*decpt;
-	int	*sign;
-{
-static	Uint	bufsize;
-static	char	*buf;
-	char	*bufend;
-	char	*ep;
-	char	*bp;
-#ifdef	HAVE_DTOA_R
-static	char	*result;
-#endif
-
-#ifdef	HAVE_DTOA_R
-	if (result) {
-		free(result);
-		result = NULL;
-	}
-	bp = __dtoa(value, 2, ndigit, decpt, sign, &ep, &result);
-#else
-	bp = __dtoa(value, 2, ndigit, decpt, sign, &ep);
-#endif
-
-	if (value == 0.0) {
-		/*
-		 * Handle __dtoa()'s deviation from ecvt():
-		 * 0.0 is converted to "0" instead of 'ndigit' zeroes.
-		 * The string "0" is not allocated, so
-		 * we need to allocate buffer to hold 'ndigit' zeroes.
-		 */
-		if (bufsize < ndigit + 1) {
-			if (buf != (char *)0)
-				free(buf);
-			bufsize = ndigit + 1;
-			buf = malloc(bufsize);
-		}
-		ep = bp = buf;
-	}
-
-	/*
-	 * Fill up trailing zeroes suppressed by __dtoa()
-	 * From an internal __dtoa() comment:
-	 *	Sufficient space is allocated to the return value
-	 *	to hold the suppressed trailing zeros.
-	 */
-	for (bufend = &bp[ndigit]; ep < bufend; )
-		*ep++ = '0';
-	*ep = '\0';
-
-	return (bp);
-}
-#endif
-
-#if !defined(HAVE_FCVT)
-char *
-fcvt(value, ndigit, decpt, sign)
-	double	value;
-	int	ndigit;
-	int	*decpt;
-	int	*sign;
-{
-static	Uint	bufsize;
-static	char	*buf;
-	char	*bufend;
-	char	*ep;
-	char	*bp;
-#ifdef	HAVE_DTOA_R
-static	char	*result;
-#endif
-
-#ifdef	HAVE_DTOA_R
-	if (result) {
-		free(result);
-		result = NULL;
-	}
-	bp = __dtoa(value, 3, ndigit, decpt, sign, &ep, &result);
-#else
-	bp = __dtoa(value, 3, ndigit, decpt, sign, &ep);
-#endif
-
-	if (value == 0.0) {
-		/*
-		 * Handle __dtoa()'s deviation from fcvt():
-		 * 0.0 is converted to "0" instead of 'ndigit' zeroes.
-		 * The string "0" is not allocated, so
-		 * we need to allocate buffer to hold 'ndigit' zeroes.
-		 */
-		if (bufsize < ndigit + 1) {
-			if (buf != (char *)0)
-				free(buf);
-			bufsize = ndigit + 1;
-			buf = malloc(bufsize);
-		}
-		ep = bp = buf;
-		*decpt = 0;
-	}
-
-	/*
-	 * Fill up trailing zeroes suppressed by __dtoa()
-	 * From an internal __dtoa() comment:
-	 *	Sufficient space is allocated to the return value
-	 *	to hold the suppressed trailing zeros.
-	 */
-	for (bufend = &bp[*decpt + ndigit]; ep < bufend; )
-		*ep++ = '0';
-	*ep = '\0';
-
-	return (bp);
-}
-#endif
-
-#ifndef	HAVE_GCVT
-char *
-gcvt(number, ndigit, buf)
-	double	number;
-	int	ndigit;
-	char	*buf;
-{
-		int	sign;
-		int	decpt;
-	register char	*b;
-	register char	*rs;
-	register int	i;
-
-	b = ecvt(number, ndigit, &decpt, &sign);
-	rs = buf;
-	if (sign)
-		*rs++ = '-';
-	for (i = ndigit-1; i > 0 && b[i] == '0'; i--)
-		ndigit--;
-#ifdef	V7_FLOATSTYLE
-	if ((decpt >= 0 && decpt-ndigit > 4) ||
-#else
-	if ((decpt >= 0 && decpt-ndigit > 0) ||
-#endif
-	    (decpt < 0 && decpt < -3)) {	/* e-format */
-		decpt--;
-		*rs++ = *b++;
-		*rs++ = '.';
-		for (i = 1; i < ndigit; i++)
-			*rs++ = *b++;
-		*rs++ = 'e';
-		if (decpt < 0) {
-			decpt = -decpt;
-			*rs++ = '-';
-		} else {
-			*rs++ = '+';
-		}
-		if (decpt >= 100) {
-			*rs++ = decpt / 100 + '0';
-			decpt %= 100;
-		}
-		*rs++ = decpt / 10 + '0';
-		*rs++ = decpt % 10 + '0';
-	} else {				/* f-format */
-		if (decpt <= 0) {
-			if (*b != '0') {
-#ifndef	V7_FLOATSTYLE
-				*rs++ = '0';
-#endif
-				*rs++ = '.';
-			}
-			while (decpt < 0) {
-				decpt++;
-				*rs++ = '0';
-			}
-		}
-		for (i = 1; i <= ndigit; i++) {
-			*rs++ = *b++;
-			if (i == decpt)
-				*rs++ = '.';
-		}
-		if (ndigit < decpt) {
-			while (ndigit++ < decpt)
-				*rs++ = '0';
-			*rs++ = '.';
-		}
-	}
-	if (rs[-1] == '.')
-		rs--;
-	*rs = '\0';
-	return (buf);
-}
-#endif

Deleted: cdrkit/trunk/libschily/cvt.h
===================================================================
--- cdrkit/trunk/libschily/cvt.h	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libschily/cvt.h	2006-11-25 00:20:20 UTC (rev 462)
@@ -1,51 +0,0 @@
-/*
-	cvt
-
-	Numeric conversion routines. libshily provides replacements for
-	ecvt, fcvt, gcvt, __dtoa and strtod if those are not available
-	in the standard C library.  #include "cvt.h" to use them.
-
-	This file is part of the cdrkit suite.
-
-	(C) 2006, the cdrkit project. License: GPL.
-
- */
-
-#ifndef CVT_H
-#define CVT_H
-
-#include <stdlib.h>
-
-#include "prototyp.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef HAVE_ECVT
-char	*ecvt __PR((double, int, int *, int *));
-#endif
-#ifndef HAVE_FCVT
-char	*fcvt __PR((double, int, int *, int *));
-#endif
-#ifndef	HAVE_GCVT
-char	*gcvt __PR((double value, int ndigit, char *buf));
-#endif
-
-#ifdef	HAVE_DTOA	/* 4.4BSD floating point implementation */
-#ifdef	HAVE_DTOA_R
-char *__dtoa __PR((double value, int mode, int ndigit, int *decpt,
-				int *sign, char **ep, char **resultp));
-#else
-char *__dtoa __PR((double value, int mode, int ndigit, int *decpt, int *sign,
-							char **ep));
-#endif
-#endif
-
-double strtod(const char *s00, char **se);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* CVT_H */

Deleted: cdrkit/trunk/libschily/fconv.c
===================================================================
--- cdrkit/trunk/libschily/fconv.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libschily/fconv.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -1,277 +0,0 @@
-/*
- * This file has been modified for the cdrkit suite.
- *
- * The behaviour and appearence of the program code below can differ to a major
- * extent from the version distributed by the original author(s).
- *
- * For details, see Changelog file distributed with the cdrkit package. If you
- * received this file from another source then ask the distributing person for
- * a log of modifications.
- *
- */
-
-/* @(#)fconv.c	1.33 03/11/23 Copyright 1985, 1995-2003 J. Schilling */
-/*
- *	Convert floating point numbers to strings for format.c
- *	Should rather use the MT-safe routines [efg]convert()
- *
- *	Copyright (c) 1985, 1995-2003 J. Schilling
- */
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- * This program 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; see the file COPYING.  If not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <mconfig.h>	/* <- may define NO_FLOATINGPOINT */
-#ifndef	NO_FLOATINGPOINT
-
-#include <stdxlib.h>
-#include <standard.h>
-#include <strdefs.h>
-#include <schily.h>
-
-#include "cvt.h"
-
-#if	defined(HAVE_ISNAN) && defined(HAVE_ISINF)
-/*
- * *BSD alike libc
- */
-#define	FOUND_ISXX
-#endif
-
-#include <math.h>
-
-#if	defined(HAVE_FP_H) && !defined(FOUND_ISXX)
-/*
- * WAS:
- * #if	defined(__osf__) || defined(_IBMR2) || defined(_AIX)
- */
-/*
- * Moved before HAVE_IEEEFP_H for True64 due to a hint
- * from Bert De Knuydt <Bert.Deknuydt at esat.kuleuven.ac.be>
- *
- * True64 has both fp.h & ieeefp.h but the functions
- * isnand() & finite() seem to be erreneously not implemented
- * as a macro and the function lives in libm.
- * Let's hope that we will not get problems with the new order.
- */
-#include <fp.h>
-#ifndef	isnan
-#define	isnan	IS_NAN
-#endif
-#ifndef	isinf
-#define	isinf	!FINITE
-/*#define	isinf	IS_INF*/
-#endif
-#define	FOUND_ISXX
-#endif
-
-#ifdef HAVE_NAN_H
-#include <nan.h>
-#define isinf(x) IsINF(x)
-#endif
-   
-#if	defined(HAVE_IEEEFP_H) && !defined(FOUND_ISXX)
-/*
- * SVR4
- */
-#include <ieeefp.h>
-#ifndef	isnan
-#define	isnan	isnand
-#endif
-#ifndef	isinf
-#define	isinf	!finite
-#endif
-#define	FOUND_ISXX
-#endif
-
-/*
- * WAS:
- * #if	defined(__hpux) || defined(VMS) || defined(_SCO_DS) || defined(__QNX__)
- */
-#if	defined(__hpux) || defined(__QNX__) || defined(__DJGPP__)
-#undef	isnan
-#undef	isinf
-#endif
-
-#if	!defined(isnan) && !defined(HAVE_ISNAN)
-#define	isnan(val)	(0)
-#endif
-#if	!defined(isinf) && !defined(HAVE_ISINF)
-#define	isinf(val)	(0)
-#endif
-
-static	char	_js_nan[] = "(NaN)";
-static	char	_js_inf[] = "(Infinity)";
-
-static	int	_ferr __PR((char *, double));
-
-#ifdef	abs
-#	undef	abs
-#endif
-#define	abs(i)	((i) < 0 ? -(i) : (i))
-
-EXPORT int
-ftoes(s, val, fieldwidth, ndigits)
-	register	char	*s;
-			double	val;
-	register	int	fieldwidth;
-	register	int	ndigits;
-{
-	register	char	*b;
-	register	char	*rs;
-	register	int	len;
-	register	int	rdecpt;
-			int	decpt;
-			int	sign;
-
-	if ((len = _ferr(s, val)) > 0)
-		return (len);
-	rs = s;
-#ifdef	V7_FLOATSTYLE
-	b = ecvt(val, ndigits, &decpt, &sign);
-	rdecpt = decpt;
-#else
-	b = ecvt(val, ndigits+1, &decpt, &sign);
-	rdecpt = decpt-1;
-#endif
-	len = ndigits + 6;			/* Punkt e +/- nnn */
-	if (sign)
-		len++;
-	if (fieldwidth > len)
-		while (fieldwidth-- > len)
-			*rs++ = ' ';
-	if (sign)
-		*rs++ = '-';
-#ifndef	V7_FLOATSTYLE
-	if (*b)
-		*rs++ = *b++;
-#endif
-	*rs++ = '.';
-	while (*b && ndigits-- > 0)
-		*rs++ = *b++;
-	*rs++ = 'e';
-	*rs++ = rdecpt >= 0 ? '+' : '-';
-	rdecpt = abs(rdecpt);
-#ifndef	V7_FLOATSTYLE
-	if (rdecpt >= 100)
-#endif
-	{
-		*rs++ = rdecpt / 100 + '0';
-		rdecpt %= 100;
-	}
-	*rs++ = rdecpt / 10 + '0';
-	*rs++ = rdecpt % 10 + '0';
-	*rs = '\0';
-	return (rs - s);
-}
-
-/*
- * fcvt() from Cygwin32 is buggy.
- */
-#if	!defined(HAVE_FCVT) && defined(HAVE_ECVT)
-#define	USE_ECVT
-#endif
-
-EXPORT int
-ftofs(s, val, fieldwidth, ndigits)
-	register	char 	*s;
-			double	val;
-	register	int	fieldwidth;
-	register	int	ndigits;
-{
-	register	char	*b;
-	register	char	*rs;
-	register	int	len;
-	register	int	rdecpt;
-			int 	decpt;
-			int	sign;
-
-	if ((len = _ferr(s, val)) > 0)
-		return (len);
-	rs = s;
-#ifdef	USE_ECVT
-	/*
-	 * Needed on systems with broken fcvt() implementation
-	 * (e.g. Cygwin32)
-	 */
-	b = ecvt(val, ndigits, &decpt, &sign);
-	/*
-	 * The next call is needed to force higher precision.
-	 */
-	if (decpt > 0)
-		b = ecvt(val, ndigits+decpt, &decpt, &sign);
-#else
-	b = fcvt(val, ndigits, &decpt, &sign);
-#endif
-	rdecpt = decpt;
-	len = rdecpt + ndigits + 1;
-	if (rdecpt < 0)
-		len -= rdecpt;
-	if (sign)
-		len++;
-	if (fieldwidth > len)
-		while (fieldwidth-- > len)
-			*rs++ = ' ';
-	if (sign)
-		*rs++ = '-';
-	if (rdecpt > 0) {
-		len = rdecpt;
-		while (*b && len-- > 0)
-			*rs++ = *b++;
-#ifdef	USE_ECVT
-		while (len-- > 0)
-			*rs++ = '0';
-#endif
-	}
-#ifndef	V7_FLOATSTYLE
-	else {
-		*rs++ = '0';
-	}
-#endif
-	*rs++ = '.';
-	if (rdecpt < 0) {
-		len = rdecpt;
-		while (len++ < 0 && ndigits-- > 0)
-			*rs++ = '0';
-	}
-	while (*b && ndigits-- > 0)
-		*rs++ = *b++;
-#ifdef	USE_ECVT
-	while (ndigits-- > 0)
-		*rs++ = '0';
-#endif
-	*rs = '\0';
-	return (rs - s);
-}
-
-LOCAL int
-_ferr(s, val)
-	char	*s;
-	double	val;
-{
-	if (isnan(val)) {
-		strcpy(s, _js_nan);
-		return (sizeof (_js_nan) - 1);
-	}
-
-	/*
-	 * Check first for NaN because finite() will return 1 on Nan too.
-	 */
-	if (isinf(val)) {
-		strcpy(s, _js_inf);
-		return (sizeof (_js_inf) - 1);
-	}
-	return (0);
-}
-#endif	/* NO_FLOATINGPOINT */

Deleted: cdrkit/trunk/libschily/findline.c
===================================================================
--- cdrkit/trunk/libschily/findline.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libschily/findline.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -1,188 +0,0 @@
-/*
- * This file has been modified for the cdrkit suite.
- *
- * The behaviour and appearence of the program code below can differ to a major
- * extent from the version distributed by the original author(s).
- *
- * For details, see Changelog file distributed with the cdrkit package. If you
- * received this file from another source then ask the distributing person for
- * a log of modifications.
- *
- */
-
-/* @(#)findline.c	1.16 04/09/25 Copyright 1985, 1995-2003 J. Schilling */
-/*
- *	findline
- *	get a line from a file with matching string in a given field
- *
- *	ofindline
- *	get a line from open file with matching string in a given field
- *
- *	getbroken
- *	separate a line into fields
- *
- *	all fill pointers into the given array, allocated to new storage
- *
- *	Copyright (c) 1985, 1995-2003 J. Schilling
- */
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- * This program 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; see the file COPYING.  If not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#define	USE_LARGEFILES	/* We must make this module large file aware */
-
-#include <mconfig.h>
-#include <stdio.h>
-#include <standard.h>
-#include <stdxlib.h>
-#include <unixstd.h>	/* Include sys/types.h to make off_t available */
-#include <strdefs.h>
-#include <schily.h>
-
-#define	MAXLBUF		4096
-
-/*
- * Return codes:
- */
-#define	SUCCESS		 1	/* Found match */
-#define	NO_MATCH	-1	/* Found no line with matching string	*/
-#define	ARG_ERROR	-2	/* Bad parameter combination:		*/
-				/* calls raisecond("findline_arg_err") before */
-#define	OPEN_ERROR	-3	/* Cannot open file */
-#define	NO_MEM		-4	/* No memory:				*/
-				/* calls raisescond("findline_storage") before */
-
-EXPORT	int	ofindline	__PR((FILE *, char, const char *, int,
-								char **, int));
-EXPORT	int	findline	__PR((const char *, char, const char *, int,
-								char **, int));
-EXPORT	int	getbroken	__PR((FILE *, char *, char, char **, int));
-
-LOCAL	char	*savestr	__PR((const char *));
-
-#ifdef	PROTOTYPES
-EXPORT int
-ofindline(FILE	*f,
-		char	delim,
-		const char *string,
-		int	field,
-		char	*array[],
-		int	arraysize)
-#else
-EXPORT int
-ofindline(f, delim, string, field, array, arraysize)
-	FILE	*f;
-	char	delim;
-	char	*string;
-	int	field;
-	char	*array[];
-	int	arraysize;
-#endif
-{
-	int	i;
-	char	lbuf[MAXLBUF];
-
-	if (field >= arraysize) {
-		raisecond("findline_arg_err", 0L);
-		return (ARG_ERROR);
-	}
-
-	fileseek(f, (off_t)0);	/* XXX ??? Interface ändern!!! */
-	for (;;) {
-		if (getbroken(f, lbuf, delim, array, arraysize) < 0) {
-			return (NO_MATCH);
-		}
-		if (streql(string, array[field])) {
-			for (i = 0; i < arraysize; i++) {
-				if ((array[i] = savestr(array[i])) == NULL) {
-					raisecond("findline_storage", 0L);
-					while (--i >= 0)
-						free(array[i]);
-					return (NO_MEM);
-				}
-			}
-			return (SUCCESS);
-		}
-	}
-}
-
-#ifdef	PROTOTYPES
-EXPORT int
-findline(const char *fname,
-		char	delim,
-		const char *string,
-		int	field,
-		char	*array[],
-		int	arraysize)
-#else
-EXPORT int
-findline(fname, delim, string, field, array, arraysize)
-	char	*fname;
-	char	delim;
-	char	*string;
-	int	field;
-	char	*array[];
-	int	arraysize;
-#endif
-{
-	FILE	*f;
-	int	ret;
-
-	if ((f = fileopen(fname, "r")) == 0)
-		return (OPEN_ERROR);
-
-	ret = ofindline(f, delim, string, field, array, arraysize);
-	fclose(f);
-	return (ret);
-}
-
-#ifdef	PROTOTYPES
-EXPORT int
-getbroken(FILE	*f,
-		char	*linebuf,
-		char	delim,
-		char	*array[],
-		int 	len)
-#else
-EXPORT int
-getbroken(f, linebuf, delim, array, len)
-	FILE	*f;
-	char	*linebuf;
-	char	delim;
-	char	*array[];
-	int	len;
-#endif
-{
-	if (fgetline(f, linebuf, MAXLBUF) < 0)
-		return (EOF);
-
-	breakline(linebuf, delim, array, len);
-	return (SUCCESS);
-}
-
-LOCAL char *
-savestr(s)
-	register const char	*s;
-{
-	register char	*p;
-		char	*ret;
-
-	if ((p = malloc(strlen(s)+1)) == NULL)
-		return (p);
-	ret = p;
-	while ((*p++ = *s++) != '\0')
-		/* LINTED */
-		;
-	return (ret);
-}

Deleted: cdrkit/trunk/libschily/format.c
===================================================================
--- cdrkit/trunk/libschily/format.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libschily/format.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -1,979 +0,0 @@
-/*
- * This file has been modified for the cdrkit suite.
- *
- * The behaviour and appearence of the program code below can differ to a major
- * extent from the version distributed by the original author(s).
- *
- * For details, see Changelog file distributed with the cdrkit package. If you
- * received this file from another source then ask the distributing person for
- * a log of modifications.
- *
- */
-
-/* @(#)format.c	1.39 04/09/25 Copyright 1985-2003 J. Schilling */
-/*
- *	format
- *	common code for printf fprintf & sprintf
- *
- *	allows recursive printf with "%r", used in:
- *	error, comerr, comerrno, errmsg, errmsgno and the like
- *
- *	Copyright (c) 1985-2003 J. Schilling
- */
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- * This program 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; see the file COPYING.  If not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <mconfig.h>
-#include <vadefs.h>
-#include <strdefs.h>
-#include <stdxlib.h>
-#ifdef	DEBUG
-#include <unixstd.h>
-#endif
-
-#include <standard.h>
-#include <utypes.h>
-#include <schily.h>
-
-#include "cvt.h"
-
-/*
- * As Llong is currently a 'best effort' long long, we usually need to
- * include long long print formats.
- * This may go away, if we implement maxint_t formats.
- */
-#define	USE_LONGLONG
-
-#ifdef	NO_LONGLONG
-#undef	USE_LONGLONG
-#endif
-
-/*
- * Some CPU's (e.g. PDP-11) cannot do logical shifts.
- * They use rotate instead. Masking the low bits before,
- * makes rotate work too.
- */
-#define	allmask(t)	((unsigned t)~((unsigned t)0))
-#define	lowmask(t, x)	((unsigned t)~((unsigned t)((1 << (x))-1)))
-#define	rshiftmask(t, s)((allmask(t) & lowmask(t, s)) >> (s))
-
-#define	CHARMASK	makemask(char)
-#define	SHORTMASK	makemask(short)
-#define	INTMASK		makemask(int)
-#define	LONGMASK	makemask(long)
-
-#ifdef	DIVLBYS
-extern	long	divlbys();
-extern	long	modlbys();
-#else
-#define	divlbys(val, base)	((val)/(base))
-#define	modlbys(val, base)	((val)%(base))
-#endif
-
-/*
- *	We use macros here to avoid the need to link to the international
- *	character routines.
- *	We don't need internationalization for our purpose.
- */
-#define	is_dig(c)	(((c) >= '0') && ((c) <= '9'))
-#define	is_cap(c)	((c) >= 'A' && (c) <= 'Z')
-#define	to_cap(c)	(is_cap(c) ? c : c - 'a' + 'A')
-#define	cap_ty(c)	(is_cap(c) ? 'L' : 'I')
-
-#ifdef	HAVE_LONGLONG
-typedef union {
-	Ullong	ll;
-	Ulong	l[2];
-	char	c[8];
-} quad_u;
-#endif
-
-typedef struct f_args {
-	void  (*outf)__PR((char, long)); /* Func from format(fun, arg)	*/
-	long	farg;			/* Arg from format (fun, arg)	*/
-	int	minusflag;		/* Fieldwidth is negative	*/
-	int	flags;			/* General flags (+-#)		*/
-	int	fldwidth;		/* Field width as in %3d	*/
-	int	signific;		/* Significant chars as in %.4d	*/
-	int	lzero;			/* Left '0' pad flag		*/
-	char	*buf;			/* Out print buffer		*/
-	char	*bufp;			/* Write ptr into buffer	*/
-	char	fillc;			/* Left fill char (' ' or '0')	*/
-	char	*prefix;		/* Prefix to print before buf	*/
-	int	prefixlen;		/* Len of prefix ('+','-','0x')	*/
-} f_args;
-
-#define	MINUSFLG	1	/* '-' flag */
-#define	PLUSFLG		2	/* '+' flag */
-#define	SPACEFLG	4	/* ' ' flag */
-#define	HASHFLG		8	/* '#' flag */
-
-LOCAL	void	prnum  __PR((Ulong, unsigned, f_args *));
-LOCAL	void	prdnum __PR((Ulong, f_args *));
-LOCAL	void	pronum __PR((Ulong, f_args *));
-LOCAL	void	prxnum __PR((Ulong, f_args *));
-LOCAL	void	prXnum __PR((Ulong, f_args *));
-#ifdef	USE_LONGLONG
-LOCAL	void	prlnum  __PR((Ullong, unsigned, f_args *));
-LOCAL	void	prldnum __PR((Ullong, f_args *));
-LOCAL	void	prlonum __PR((Ullong, f_args *));
-LOCAL	void	prlxnum __PR((Ullong, f_args *));
-LOCAL	void	prlXnum __PR((Ullong, f_args *));
-#endif
-LOCAL	int	prbuf  __PR((const char *, f_args *));
-LOCAL	int	prc    __PR((char, f_args *));
-LOCAL	int	prstring __PR((const char *, f_args *));
-#ifdef	DEBUG
-LOCAL	void	dbg_print __PR((char *fmt, int a, int b, int c, int d, int e, int f, int g, int h, int i));
-#endif
-
-
-#ifdef	PROTOTYPES
-EXPORT int
-format(void (*fun)(char, long),
-			long farg,
-			const char *fmt,
-			va_list args)
-#else
-EXPORT int
-format(fun, farg, fmt, args)
-	register void	(*fun)();
-	register long	farg;
-	register char	*fmt;
-	va_list		args;
-#endif
-{
-#ifdef	FORMAT_LOW_MEM
-	char buf[512];
-#else
-	char buf[8192];
-#endif
-	const char *sfmt;
-	register int unsflag;
-	register long val;
-	register char type;
-	register char mode;
-	register char c;
-	int count;
-	int i;
-	short sh;
-	const char *str;
-	double dval;
-#ifdef	USE_LONGLONG
-	Llong llval = 0;
-#endif
-	Ulong res;
-	char *rfmt;
-	f_args	fa;
-
-	fa.outf = fun;
-	fa.farg = farg;
-	count = 0;
-	/*
-	 * Main loop over the format string.
-	 * Increment and check for end of string is made here.
-	 */
-	for (; *fmt != '\0'; fmt++) {
-		c = *fmt;
-		while (c != '%') {
-			if (c == '\0')
-				return (count);
-			(*fun)(c, farg);
-			c = *(++fmt);
-			count++;
-		}
-
-		/*
-		 * We reached a '%' sign.
-		 */
-		buf[0] = '\0';
-		fa.buf = fa.bufp = buf;
-		fa.minusflag = 0;
-		fa.flags = 0;
-		fa.fldwidth = 0;
-		fa.signific = -1;
-		fa.lzero = 0;
-		fa.fillc = ' ';
-		fa.prefixlen = 0;
-		sfmt = fmt;
-		unsflag = FALSE;
-		type = '\0';
-		mode = '\0';
-	newflag:
-		switch (*(++fmt)) {
-
-		case '+':
-			fa.flags |= PLUSFLG;
-			goto newflag;
-
-		case '-':
-			fa.minusflag++;
-			goto newflag;
-
-		case ' ':
-			/*
-			 * If the space and the + flag are present,
-			 * the space flag will be ignored.
-			 */
-			fa.flags |= SPACEFLG;
-			goto newflag;
-
-		case '#':
-			fa.flags |= HASHFLG;
-			goto newflag;
-
-		case '0':
-			/*
-			 * '0' is a flag.
-			 */
-			fa.fillc = '0';
-			goto newflag;
-		}
-		if (*fmt == '*') {
-			fmt++;
-			fa.fldwidth = va_arg(args, int);
-			/*
-			 * A negative fieldwith is a minus flag with a
-			 * positive fieldwidth.
-			 */
-			if (fa.fldwidth < 0) {
-				fa.fldwidth = -fa.fldwidth;
-/*				fa.minusflag ^= 1;*/
-				fa.minusflag = 1;
-			}
-		} else while (c = *fmt, is_dig(c)) {
-			fa.fldwidth *= 10;
-			fa.fldwidth += c - '0';
-			fmt++;
-		}
-		if (*fmt == '.') {
-			fmt++;
-			fa.signific = 0;
-			if (*fmt == '*') {
-				fmt++;
-				fa.signific = va_arg(args, int);
-				if (fa.signific < 0)
-					fa.signific = 0;
-			} else while (c = *fmt, is_dig(c)) {
-				fa.signific *= 10;
-				fa.signific += c - '0';
-				fmt++;
-			}
-		}
-		if (strchr("UCSIL", *fmt)) {
-			/*
-			 * Enhancements to K&R and ANSI:
-			 *
-			 * got a type specifyer
-			 *
-			 * XXX 'S' in C99 is %ls, 'S' should become 'H'
-			 */
-			if (*fmt == 'U') {
-				fmt++;
-				unsflag = TRUE;
-			}
-			if (!strchr("CSILZODX", *fmt)) {
-				/*
-				 * Got only 'U'nsigned specifyer,
-				 * use default type and mode.
-				 */
-				type = 'I';
-				mode = 'D';
-				fmt--;
-			} else if (!strchr("CSIL", *fmt)) {
-				/*
-				 * no type, use default
-				 */
-				type = 'I';
-				mode = *fmt;
-			} else {
-				/*
-				 * got CSIL
-				 */
-				type = *fmt++;
-				if (!strchr("ZODX", mode = *fmt)) {
-					fmt--;
-					mode = 'D'; /* default mode */
-				}
-			}
-		} else switch (*fmt) {
-
-		case 'h':
-			if (!type)
-				type = 'H';	/* convert to short type */
-			goto getmode;
-
-		case 'l':
-			if (!type)
-				type = 'L';	/* convert to long type */
-			goto getmode;
-
-		case 'j':
-			if (!type)
-				type = 'J';	/* convert to intmax_t type */
-		/*
-		 * XXX Future length modifiers:
-		 * XXX	'z' size_t
-		 * XXX	't' ptrdiff_t
-		 * XXX	'L' with double: long double
-		 */
-
-		getmode:
-			if (!strchr("udioxX", *(++fmt))) {
-				if (type == 'H' && *fmt == 'h') {
-					type = 'C';
-					goto getmode;
-				}
-#ifdef	USE_LONGLONG
-				if (type == 'L' && *fmt == 'l') {
-					type = 'Q';
-					goto getmode;
-				}
-#endif
-				fmt--;
-				mode = 'D';
-			} else {
-				mode = *fmt;
-				if (mode != 'x')
-					mode = to_cap(mode);
-				if (mode == 'U')
-					unsflag = TRUE;
-				else if (mode == 'I')	/*XXX */
-					mode = 'D';
-			}
-			break;
-		case 'x':
-			mode = 'x';
-			goto havemode;
-		case 'X':
-			mode = 'X';
-			type = 'I';
-			goto havemode;
-		case 'u':
-			unsflag = TRUE;
-		/*
-		 * XXX Need to remove uppercase letters for 'long'
-		 * XXX in future for POSIX/C99 compliance.
-		 */
-			/* FALLTHRU */
-		case 'o': case 'O':
-		case 'd': case 'D':
-		case 'i': case 'I':
-		case 'z': case 'Z':
-			mode = to_cap(*fmt);
-		havemode:
-			if (!type)
-				type = cap_ty(*fmt);
-#ifdef	DEBUG
-/*dbg_print("*fmt: '%c' mode: '%c' type: '%c'\n", *fmt, mode, type);*/
-#endif
-			if (mode == 'I')	/*XXX kann entfallen*/
-				mode = 'D';	/*wenn besseres uflg*/
-			break;
-		case 'p':
-			mode = 'P';
-			type = 'L';
-			break;
-
-		case '%':
-			count += prc('%', &fa);
-			continue;
-		case ' ':
-			count += prbuf("", &fa);
-			continue;
-		case 'c':
-			c = va_arg(args, int);
-			count += prc(c, &fa);
-			continue;
-		case 's':
-			str = va_arg(args, char *);
-			count += prstring(str, &fa);
-			continue;
-		case 'b':
-			str = va_arg(args, char *);
-			fa.signific = va_arg(args, int);
-			count += prstring(str, &fa);
-			continue;
-
-#ifndef	NO_FLOATINGPOINT
-		case 'e':
-			if (fa.signific == -1)
-				fa.signific = 6;
-			dval = va_arg(args, double);
-			ftoes(buf, dval, 0, fa.signific);
-			count += prbuf(buf, &fa);
-			continue;
-		case 'f':
-			if (fa.signific == -1)
-				fa.signific = 6;
-			dval = va_arg(args, double);
-			ftofs(buf, dval, 0, fa.signific);
-			count += prbuf(buf, &fa);
-			continue;
-		case 'g':
-			if (fa.signific == -1)
-				fa.signific = 6;
-			if (fa.signific == 0)
-				fa.signific = 1;
-			dval = va_arg(args, double);
-			gcvt(dval, fa.signific, buf);
-			count += prbuf(buf, &fa);
-			continue;
-#else
-#	ifdef	USE_FLOATINGARGS
-		case 'e':
-		case 'f':
-		case 'g':
-			dval = va_arg(args, double);
-			continue;
-#	endif
-#endif
-
-		case 'r':			/* recursive printf */
-		case 'R':			/* recursive printf */
-			rfmt  = va_arg(args, char *);
-			/*
-			 * I don't know any portable way to get an arbitrary
-			 * C object from a var arg list so I use a
-			 * system-specific routine __va_arg_list() that knows
-			 * if 'va_list' is an array. You will not be able to
-			 * assign the value of __va_arg_list() but it works
-			 * to be used as an argument of a function.
-			 * It is a requirement for recursive printf to be able
-			 * to use this function argument. If your system
-			 * defines va_list to be an array you need to know this
-			 * via autoconf or another mechanism.
-			 * It would be nice to have something like
-			 * __va_arg_list() in stdarg.h
-			 */
-			count += format(fun, farg, rfmt, __va_arg_list(args));
-			continue;
-
-		case 'n':
-			{
-				int	*ip = va_arg(args, int *);
-
-				*ip = count;
-			}
-			continue;
-
-		default:			/* Unknown '%' format */
-			sfmt++;			/* Dont't print '%'   */
-			count += fmt - sfmt;
-			while (sfmt < fmt)
-				(*fun)(*(sfmt++), farg);
-			if (*fmt == '\0') {
-				fmt--;
-				continue;
-			} else {
-				(*fun)(*fmt, farg);
-				count++;
-				continue;
-			}
-		}
-		/*
-		 * print numbers:
-		 * first prepare type 'C'har, s'H'ort, 'I'nt, or 'L'ong
-		 * or 'Q'ad and 'J'==maxint_t
-		 */
-		switch (type) {
-
-		case 'C':
-			c = va_arg(args, int);
-			val = c;		/* extend sign here */
-			if (unsflag || mode != 'D')
-#ifdef	DO_MASK
-				val &= CHARMASK;
-#else
-				val = (unsigned char)val;
-#endif
-			break;
-		case 'H':
-		case 'S':			/* XXX remove 'S' in future */
-			sh = va_arg(args, int);
-			val = sh;		/* extend sign here */
-			if (unsflag || mode != 'D')
-#ifdef	DO_MASK
-				val &= SHORTMASK;
-#else
-				val = (unsigned short)val;
-#endif
-			break;
-		case 'I':
-		default:
-			i = va_arg(args, int);
-			val = i;		/* extend sign here */
-			if (unsflag || mode != 'D')
-#ifdef	DO_MASK
-				val &= INTMASK;
-#else
-				val = (unsigned int)val;
-#endif
-			break;
-		case 'P':
-		case 'L':
-			val = va_arg(args, long);
-			break;
-#ifdef	USE_LONGLONG
-		case 'J':			/* For now Intmax_t is Llong */
-		case 'Q':
-			llval = va_arg(args, Llong);
-			val = llval != 0;
-			break;
-#endif
-		}
-
-		/*
-		 * Final print out, take care of mode:
-		 * mode is one of: 'O'ctal, 'D'ecimal, or he'X'
-		 * oder 'Z'weierdarstellung.
-		 */
-		fa.bufp = &buf[sizeof (buf)-1];
-		*--fa.bufp = '\0';
-
-		if (val == 0 && mode != 'D') {
-		printzero:
-			/*
-			 * Printing '0' with fieldwidth 0 results in no chars.
-			 */
-			fa.lzero = -1;
-			if (fa.signific >= 0)
-				fa.fillc = ' ';
-			count += prstring("0", &fa);
-			continue;
-		} else switch (mode) {
-
-		case 'D':
-#ifdef	USE_LONGLONG
-			if (type == 'Q') {
-				if (!unsflag && llval < 0) {
-					fa.prefix = "-";
-					fa.prefixlen = 1;
-					llval = -llval;
-				} else if (fa.flags & PLUSFLG) {
-					fa.prefix = "+";
-					fa.prefixlen = 1;
-				} else if (fa.flags & SPACEFLG) {
-					fa.prefix = " ";
-					fa.prefixlen = 1;
-				}
-				if (llval == 0)
-					goto printzero;
-				goto prunsigned;
-			}
-#endif
-			if (!unsflag && val < 0) {
-				fa.prefix = "-";
-				fa.prefixlen = 1;
-				val = -val;
-			} else if (fa.flags & PLUSFLG) {
-				fa.prefix = "+";
-				fa.prefixlen = 1;
-			} else if (fa.flags & SPACEFLG) {
-				fa.prefix = " ";
-				fa.prefixlen = 1;
-			}
-			if (val == 0)
-				goto printzero;
-			/* FALLTHRU */
-		case 'U':
-			/* output a long unsigned decimal number */
-#ifdef	USE_LONGLONG
-		prunsigned:
-			if (type == 'Q')
-				prldnum(llval, &fa);
-			else
-#endif
-			prdnum(val, &fa);
-			break;
-		case 'O':
-			/* output a long octal number */
-			if (fa.flags & HASHFLG) {
-				fa.prefix = "0";
-				fa.prefixlen = 1;
-			}
-#ifdef	USE_LONGLONG
-			if (type == 'Q') {
-				prlonum(llval, &fa);
-			} else
-#endif
-			{
-				pronum(val & 07, &fa);
-				if ((res = (val>>3) & rshiftmask(long, 3)) != 0)
-					pronum(res, &fa);
-			}
-			break;
-		case 'p':
-		case 'x':
-			/* output a hex long */
-			if (fa.flags & HASHFLG) {
-				fa.prefix = "0x";
-				fa.prefixlen = 2;
-			}
-#ifdef	USE_LONGLONG
-			if (type == 'Q')
-				prlxnum(llval, &fa);
-			else
-#endif
-			{
-				prxnum(val & 0xF, &fa);
-				if ((res = (val>>4) & rshiftmask(long, 4)) != 0)
-					prxnum(res, &fa);
-			}
-			break;
-		case 'P':
-		case 'X':
-			/* output a hex long */
-			if (fa.flags & HASHFLG) {
-				fa.prefix = "0X";
-				fa.prefixlen = 2;
-			}
-#ifdef	USE_LONGLONG
-			if (type == 'Q')
-				prlXnum(llval, &fa);
-			else
-#endif
-			{
-				prXnum(val & 0xF, &fa);
-				if ((res = (val>>4) & rshiftmask(long, 4)) != 0)
-					prXnum(res, &fa);
-			}
-			break;
-		case 'Z':
-			/* output a binary long */
-#ifdef	USE_LONGLONG
-			if (type == 'Q')
-				prlnum(llval, 2, &fa);
-			else
-#endif
-			{
-				prnum(val & 0x1, 2, &fa);
-				if ((res = (val>>1) & rshiftmask(long, 1)) != 0)
-					prnum(res, 2, &fa);
-			}
-		}
-		fa.lzero = -1;
-		/*
-		 * If a precision (fielwidth) is specified
-		 * on diouXx conversions, the '0' flag is ignored.
-		 */
-		if (fa.signific >= 0)
-			fa.fillc = ' ';
-		count += prbuf(fa.bufp, &fa);
-	}
-	return (count);
-}
-
-/*
- * Routines to print (not negative) numbers in an arbitrary base
- */
-LOCAL	unsigned char	dtab[]  = "0123456789abcdef";
-LOCAL	unsigned char	udtab[] = "0123456789ABCDEF";
-
-LOCAL void
-prnum(val, base, fa)
-	register Ulong val;
-	register unsigned base;
-	f_args *fa;
-{
-	register char *p = fa->bufp;
-
-	do {
-		*--p = dtab[modlbys(val, base)];
-		val = divlbys(val, base);
-	} while (val > 0);
-
-	fa->bufp = p;
-}
-
-LOCAL void
-prdnum(val, fa)
-	register Ulong val;
-	f_args *fa;
-{
-	register char *p = fa->bufp;
-
-	do {
-		*--p = dtab[modlbys(val, (unsigned)10)];
-		val = divlbys(val, (unsigned)10);
-	} while (val > 0);
-
-	fa->bufp = p;
-}
-
-/*
- * We may need to use division here too (PDP-11, non two's complement ...)
- */
-LOCAL void
-pronum(val, fa)
-	register Ulong val;
-	f_args *fa;
-{
-	register char *p = fa->bufp;
-
-	do {
-		*--p = dtab[val & 7];
-		val >>= 3;
-	} while (val > 0);
-
-	fa->bufp = p;
-}
-
-LOCAL void
-prxnum(val, fa)
-	register Ulong val;
-	f_args *fa;
-{
-	register char *p = fa->bufp;
-
-	do {
-		*--p = dtab[val & 15];
-		val >>= 4;
-	} while (val > 0);
-
-	fa->bufp = p;
-}
-
-LOCAL void
-prXnum(val, fa)
-	register Ulong val;
-	f_args *fa;
-{
-	register char *p = fa->bufp;
-
-	do {
-		*--p = udtab[val & 15];
-		val >>= 4;
-	} while (val > 0);
-
-	fa->bufp = p;
-}
-
-#ifdef	USE_LONGLONG
-LOCAL void
-prlnum(val, base, fa)
-	register Ullong val;
-	register unsigned base;
-	f_args *fa;
-{
-	register char *p = fa->bufp;
-
-	do {
-		*--p = dtab[modlbys(val, base)];
-		val = divlbys(val, base);
-	} while (val > 0);
-
-	fa->bufp = p;
-}
-
-LOCAL void
-prldnum(val, fa)
-	register Ullong val;
-	f_args *fa;
-{
-	register char *p = fa->bufp;
-
-	do {
-		*--p = dtab[val % (unsigned)10];
-		val = val / (unsigned)10;
-	} while (val > 0);
-
-	fa->bufp = p;
-}
-
-LOCAL void
-prlonum(val, fa)
-	register Ullong val;
-	f_args *fa;
-{
-	register char *p = fa->bufp;
-
-	do {
-		*--p = dtab[val & 7];
-		val >>= 3;
-	} while (val > 0);
-
-	fa->bufp = p;
-}
-
-LOCAL void
-prlxnum(val, fa)
-	register Ullong val;
-	f_args *fa;
-{
-	register char *p = fa->bufp;
-
-	do {
-		*--p = dtab[val & 15];
-		val >>= 4;
-	} while (val > 0);
-
-	fa->bufp = p;
-}
-
-LOCAL void
-prlXnum(val, fa)
-	register Ullong val;
-	f_args *fa;
-{
-	register char *p = fa->bufp;
-
-	do {
-		*--p = udtab[val & 15];
-		val >>= 4;
-	} while (val > 0);
-
-	fa->bufp = p;
-}
-
-#endif
-
-/*
- * Final buffer print out routine.
- */
-LOCAL int
-prbuf(s, fa)
-	register const char *s;
-	f_args *fa;
-{
-	register int diff;
-	register int rfillc;
-	register long arg			= fa->farg;
-	register void (*fun) __PR((char, long))	= fa->outf;
-	register int count;
-	register int lzero = 0;
-
-	count = strlen(s);
-
-	/*
-	 * lzero becomes the number of left fill chars needed to reach signific
-	 */
-	if (fa->lzero < 0 && count < fa->signific)
-		lzero = fa->signific - count;
-	count += lzero + fa->prefixlen;
-	diff = fa->fldwidth - count;
-	if (diff > 0)
-		count += diff;
-
-	if (fa->prefixlen && fa->fillc != ' ') {
-		while (*fa->prefix != '\0')
-			(*fun)(*fa->prefix++, arg);
-	}
-	if (!fa->minusflag) {
-		rfillc = fa->fillc;
-		while (--diff >= 0)
-			(*fun)(rfillc, arg);
-	}
-	if (fa->prefixlen && fa->fillc == ' ') {
-		while (*fa->prefix != '\0')
-			(*fun)(*fa->prefix++, arg);
-	}
-	if (lzero > 0) {
-		rfillc = '0';
-		while (--lzero >= 0)
-			(*fun)(rfillc, arg);
-	}
-	while (*s != '\0')
-		(*fun)(*s++, arg);
-	if (fa->minusflag) {
-		rfillc = ' ';
-		while (--diff >= 0)
-			(*fun)(rfillc, arg);
-	}
-	return (count);
-}
-
-/*
- * Print out one char, allowing prc('\0')
- * Similar to prbuf()
- */
-#ifdef	PROTOTYPES
-
-LOCAL int
-prc(char c, f_args *fa)
-
-#else
-
-LOCAL int
-prc(c, fa)
-	char	c;
-	f_args *fa;
-#endif
-{
-	register int diff;
-	register int rfillc;
-	register long arg			= fa->farg;
-	register void (*fun) __PR((char, long))	= fa->outf;
-	register int count;
-
-	count = 1;
-	diff = fa->fldwidth - 1;
-	if (diff > 0)
-		count += diff;
-
-	if (!fa->minusflag) {
-		rfillc = fa->fillc;
-		while (--diff >= 0)
-			(*fun)(rfillc, arg);
-	}
-	(*fun)(c, arg);
-	if (fa->minusflag) {
-		rfillc = ' ';
-		while (--diff >= 0)
-			(*fun)(rfillc, arg);
-	}
-	return (count);
-}
-
-/*
- * String output routine.
- * If fa->signific is >= 0, it uses only fa->signific chars.
- * If fa->signific is 0, print no characters.
- */
-LOCAL int
-prstring(s, fa)
-	register const char	*s;
-	f_args *fa;
-{
-	register char	*bp;
-	register int	signific;
-
-	if (s == NULL)
-		return (prbuf("(NULL POINTER)", fa));
-
-	if (fa->signific < 0)
-		return (prbuf(s, fa));
-
-	bp = fa->buf;
-	signific = fa->signific;
-
-	while (--signific >= 0 && *s != '\0')
-		*bp++ = *s++;
-	*bp = '\0';
-
-	return (prbuf(fa->buf, fa));
-}
-
-#ifdef	DEBUG
-LOCAL void
-dbg_print(fmt, a, b, c, d, e, f, g, h, i)
-char *fmt;
-{
-	char	ff[1024];
-
-	sprintf(ff, fmt, a, b, c, d, e, f, g, h, i);
-	write(STDERR_FILENO, ff, strlen(ff));
-}
-#endif

Deleted: cdrkit/trunk/libschily/getfp.c
===================================================================
--- cdrkit/trunk/libschily/getfp.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libschily/getfp.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -1,109 +0,0 @@
-/*
- * This file has been modified for the cdrkit suite.
- *
- * The behaviour and appearence of the program code below can differ to a major
- * extent from the version distributed by the original author(s).
- *
- * For details, see Changelog file distributed with the cdrkit package. If you
- * received this file from another source then ask the distributing person for
- * a log of modifications.
- *
- */
-
-/* @(#)getfp.c	1.14 03/07/13 Copyright 1988-2003 J. Schilling */
-/*
- *	Get frame pointer
- *
- *	Copyright (c) 1988-2003 J. Schilling
- */
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- * This program 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; see the file COPYING.  If not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <mconfig.h>
-#include <standard.h>
-#include <schily.h>
-
-#ifndef	IS_AVOFFSET
-/*
- * We usually don't like to compile a getfp() that returns junk data in case
- * we cannot scan the stack.
- * The only way to find this out is by including avoffset.h. Unfortunately, we
- * need to be able to use getfp() from avoffset.c in order to check if the
- * return value is usable or junk. To be able to do this, we include getfp.c
- * from avoffset.c and define IS_AVOFFSET before.
- */
-#include <avoffset.h>
-
-#if	!defined(AV_OFFSET) || !defined(FP_INDIR)
-#	ifdef	HAVE_SCANSTACK
-#	undef	HAVE_SCANSTACK
-#	endif
-#endif
-#endif
-
-#ifdef	HAVE_SCANSTACK
-#include <stkframe.h>
-
-#define	MAXWINDOWS	32
-#define	NWINDOWS	7
-
-#if defined(sparc) && defined(__GNUC__)
-#	define	FP_OFF		0x10	/* some strange things on sparc gcc */
-#else
-#	define	FP_OFF		0
-#endif
-
-EXPORT	void	**___fpoff	__PR((char *cp));
-
-EXPORT void **
-getfp()
-{
-		long	**dummy[1];
-
-#ifdef	sparc
-	flush_reg_windows(MAXWINDOWS-2);
-#endif
-	return ((void **)((struct frame *)___fpoff((char *)&dummy[0]))->fr_savfp);
-}
-
-/*
- * Don't make it static to avoid inline optimization.
- *
- * We need this function to fool GCCs check for returning addresses
- * from outside the functions local address space.
- */
-EXPORT void **
-___fpoff(cp)
-	char	*cp;
-{
-	long ***lp;
-
-	lp = (long ***)(cp + FP_OFF);
-	lp++;
-	return ((void **)lp);
-}
-
-#ifdef	sparc
-EXPORT int
-flush_reg_windows(n)
-	int	n;
-{
-	if (--n > 0)
-		flush_reg_windows(n);
-	return (0);
-}
-#endif
-
-#endif	/* HAVE_SCANSTACK */

Deleted: cdrkit/trunk/libschily/jsprintf.c
===================================================================
--- cdrkit/trunk/libschily/jsprintf.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libschily/jsprintf.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -1,140 +0,0 @@
-/*
- * This file has been modified for the cdrkit suite.
- *
- * The behaviour and appearence of the program code below can differ to a major
- * extent from the version distributed by the original author(s).
- *
- * For details, see Changelog file distributed with the cdrkit package. If you
- * received this file from another source then ask the distributing person for
- * a log of modifications.
- *
- */
-
-/* @(#)jsprintf.c	1.15 04/09/25 Copyright 1985, 1995-2003 J. Schilling */
-/*
- *	Copyright (c) 1985, 1995-2003 J. Schilling
- */
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- * This program 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; see the file COPYING.  If not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <mconfig.h>
-#include <stdio.h>
-#include <vadefs.h>
-#include <standard.h>
-#include <schily.h>
-
-#define	BFSIZ	256
-
-typedef struct {
-	short	cnt;
-	char	*ptr;
-	char	buf[BFSIZ];
-	int	count;
-	FILE	*f;
-} *BUF, _BUF;
-
-LOCAL	void	_bflush		__PR((BUF));
-LOCAL	void	_bput		__PR((char, long));
-EXPORT	int	js_fprintf	__PR((FILE *, const char *, ...));
-EXPORT	int	js_printf	__PR((const char *, ...));
-
-LOCAL void
-_bflush(bp)
-	register BUF	bp;
-{
-	bp->count += bp->ptr - bp->buf;
-	if (filewrite(bp->f, bp->buf, bp->ptr - bp->buf) < 0)
-		bp->count = EOF;
-	bp->ptr = bp->buf;
-	bp->cnt = BFSIZ;
-}
-
-#ifdef	PROTOTYPES
-LOCAL void
-_bput(char c, long l)
-#else
-LOCAL void
-_bput(c, l)
-		char	c;
-		long	l;
-#endif
-{
-	register BUF	bp = (BUF)l;
-
-	*bp->ptr++ = c;
-	if (--bp->cnt <= 0)
-		_bflush(bp);
-}
-
-/* VARARGS1 */
-#ifdef	PROTOTYPES
-EXPORT int
-js_printf(const char *form, ...)
-#else
-EXPORT int
-js_printf(form, va_alist)
-	char	*form;
-	va_dcl
-#endif
-{
-	va_list	args;
-	_BUF	bb;
-
-	bb.ptr = bb.buf;
-	bb.cnt = BFSIZ;
-	bb.count = 0;
-	bb.f = stdout;
-#ifdef	PROTOTYPES
-	va_start(args, form);
-#else
-	va_start(args);
-#endif
-	format(_bput, (long)&bb, form, args);
-	va_end(args);
-	if (bb.cnt < BFSIZ)
-		_bflush(&bb);
-	return (bb.count);
-}
-
-/* VARARGS2 */
-#ifdef	PROTOTYPES
-EXPORT int
-js_fprintf(FILE *file, const char *form, ...)
-#else
-EXPORT int
-js_fprintf(file, form, va_alist)
-	FILE	*file;
-	char	*form;
-	va_dcl
-#endif
-{
-	va_list	args;
-	_BUF	bb;
-
-	bb.ptr = bb.buf;
-	bb.cnt = BFSIZ;
-	bb.count = 0;
-	bb.f = file;
-#ifdef	PROTOTYPES
-	va_start(args, form);
-#else
-	va_start(args);
-#endif
-	format(_bput, (long)&bb, form, args);
-	va_end(args);
-	if (bb.cnt < BFSIZ)
-		_bflush(&bb);
-	return (bb.count);
-}

Deleted: cdrkit/trunk/libschily/jssnprintf.c
===================================================================
--- cdrkit/trunk/libschily/jssnprintf.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libschily/jssnprintf.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -1,100 +0,0 @@
-/*
- * This file has been modified for the cdrkit suite.
- *
- * The behaviour and appearence of the program code below can differ to a major
- * extent from the version distributed by the original author(s).
- *
- * For details, see Changelog file distributed with the cdrkit package. If you
- * received this file from another source then ask the distributing person for
- * a log of modifications.
- *
- */
-
-/* @(#)jssnprintf.c	1.10 04/05/09 Copyright 1985, 1995-2004 J. Schilling */
-/*
- *	Copyright (c) 1985, 1995-2004 J. Schilling
- */
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- * This program 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; see the file COPYING.  If not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <mconfig.h>
-#include <unixstd.h>		/* include <sys/types.h> try to get size_t */
-#include <stdio.h>		/* Try again for size_t	*/
-#include <stdxlib.h>		/* Try again for size_t	*/
-#include <vadefs.h>
-#include <standard.h>
-#include <schily.h>
-
-EXPORT	int js_snprintf __PR((char *, size_t maxcnt, const char *, ...));
-
-typedef struct {
-	char	*ptr;
-	int	count;
-} *BUF, _BUF;
-
-#ifdef	PROTOTYPES
-static void _cput(char c, long l)
-#else
-static void _cput(c, l)
-	char	c;
-	long	l;
-#endif
-{
-	register BUF	bp = (BUF)l;
-
-	if (--bp->count > 0) {
-		*bp->ptr++ = c;
-	} else {
-		/*
-		 * Make sure that there will never be a negative overflow.
-		 */
-		bp->count++;
-	}
-}
-
-/* VARARGS2 */
-#ifdef	PROTOTYPES
-EXPORT int
-js_snprintf(char *buf, size_t maxcnt, const char *form, ...)
-#else
-EXPORT int
-js_snprintf(buf, maxcnt, form, va_alist)
-	char	*buf;
-	unsigned maxcnt;
-	char	*form;
-	va_dcl
-#endif
-{
-	va_list	args;
-	int	cnt;
-	_BUF	bb;
-
-	bb.ptr = buf;
-	bb.count = maxcnt;
-
-#ifdef	PROTOTYPES
-	va_start(args, form);
-#else
-	va_start(args);
-#endif
-	cnt = format(_cput, (long)&bb, form,  args);
-	va_end(args);
-	if (maxcnt > 0)
-		*(bb.ptr) = '\0';
-	if (bb.count < 0)
-		return (-1);
-
-	return (cnt);
-}

Deleted: cdrkit/trunk/libschily/jssprintf.c
===================================================================
--- cdrkit/trunk/libschily/jssprintf.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libschily/jssprintf.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -1,79 +0,0 @@
-/*
- * This file has been modified for the cdrkit suite.
- *
- * The behaviour and appearence of the program code below can differ to a major
- * extent from the version distributed by the original author(s).
- *
- * For details, see Changelog file distributed with the cdrkit package. If you
- * received this file from another source then ask the distributing person for
- * a log of modifications.
- *
- */
-
-/* @(#)jssprintf.c	1.15 03/06/15 Copyright 1985, 1995-2003 J. Schilling */
-/*
- *	Copyright (c) 1985, 1995-2003 J. Schilling
- */
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- * This program 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; see the file COPYING.  If not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <mconfig.h>
-#include <vadefs.h>
-#include <standard.h>
-#include <schily.h>
-
-/*
- * Do not include stdio.h, BSD systems define sprintf the wrong way!
- */
-EXPORT	int js_sprintf __PR((char *, const char *, ...));
-
-#ifdef	PROTOTYPES
-static void _cput(char c, long ba)
-#else
-static void _cput(c, ba)
-	char	c;
-	long	ba;
-#endif
-{
-	*(*(char **) ba)++ = c;
-}
-
-/* VARARGS2 */
-#ifdef	PROTOTYPES
-EXPORT int
-js_sprintf(char *buf, const char *form, ...)
-#else
-EXPORT int
-js_sprintf(buf, form, va_alist)
-	char	*buf;
-	char	*form;
-	va_dcl
-#endif
-{
-	va_list	args;
-	int	cnt;
-	char	*bp = buf;
-
-#ifdef	PROTOTYPES
-	va_start(args, form);
-#else
-	va_start(args);
-#endif
-	cnt = format(_cput, (long)&bp, form,  args);
-	va_end(args);
-	*bp = '\0';
-
-	return (cnt);
-}

Modified: cdrkit/trunk/libschily/libschily-mapvers
===================================================================
--- cdrkit/trunk/libschily/libschily-mapvers	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libschily/libschily-mapvers	2006-11-25 00:20:20 UTC (rev 462)
@@ -92,7 +92,7 @@
 	handlecond;
 	js_fprintf;
 	js_printf;
-	js_snprintf;
+	snprintf;
 	js_sprintf;
 	movebytes;
 	ofindline;

Deleted: cdrkit/trunk/libschily/match.c
===================================================================
--- cdrkit/trunk/libschily/match.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libschily/match.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -1,469 +0,0 @@
-/*
- * This file has been modified for the cdrkit suite.
- *
- * The behaviour and appearence of the program code below can differ to a major
- * extent from the version distributed by the original author(s).
- *
- * For details, see Changelog file distributed with the cdrkit package. If you
- * received this file from another source then ask the distributing person for
- * a log of modifications.
- *
- */
-
-/* @(#)match.c	1.21 04/09/25 Copyright 1985, 1995-2003 J. Schilling */
-#include <standard.h>
-#include <patmatch.h>
-/*
- *	Pattern matching functions
- *
- *	Copyright (c) 1985, 1995-2003 J. Schilling
- */
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- * This program 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; see the file COPYING.  If not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-/*
- *	The pattern matching functions below are based on the algorithm
- *	presented by Martin Richards in:
- *
- *	"A Compact Function for Regular Expression Pattern Matching",
- *	Software-Practice and Experience, Vol. 9, 527-534 (1979)
- *
- *	Several changes have been made to the original source which has been
- *	written in BCPL:
- *
- *	'/'	is replaced by	'!'		(to allow UNIX filenames)
- *	'(',')' are replaced by	'{', '}'
- *	'\''	is replaced by	'\\'		(UNIX compatible quote)
- *
- *	Character classes have been added to allow "[<character list>]"
- *	to be used.
- *	Start of line '^' and end of line '$' have been added.
- */
-
-#ifdef	__LINE_MATCH
-#define	opatmatch	opatlmatch
-#define	patmatch	patlmatch
-#endif
-
-#define	ENDSTATE	(-1)
-typedef	unsigned char	Uchar;
-
-/*---------------------------------------------------------------------------
-|
-|	The Interpreter
-|
-+---------------------------------------------------------------------------*/
-
-
-/*
- *	put adds a new state to the active list
- */
-#define	 put(ret, state, sp, n)	{		\
-	register int *lstate	= state;	\
-	register int *lsp	= sp;		\
-	register int ln		= n;		\
-						\
-	while (lstate < lsp) {			\
-		if (*lstate++ == ln) {		\
-			ret = lsp;		\
-			lsp = 0;		\
-			break;			\
-		}				\
-	}					\
-	if (lsp) {				\
-		*lstate++ = ln;			\
-		ret = lstate;			\
-	}					\
-}
-
-
-/*
- *	match a character in class
- */
-#define	in_class(found, pat, c)	{			\
-	register const Uchar	*lpat	= pat;		\
-	register int		lc	= c;		\
-	int	lo_bound;				\
-	int	hi_bound;				\
-							\
-	found = FALSE;					\
-							\
-	if (*lpat == NOT) {				\
-		lpat++;					\
-		found = TRUE;				\
-	}						\
-	while (*lpat != RCLASS) {			\
-		if (*lpat == QUOTE)			\
-			lpat++;				\
-		lo_bound = *lpat++;			\
-		if (*lpat == RANGE) {			\
-			lpat++;				\
-			if (*lpat == QUOTE)		\
-				lpat++;			\
-			hi_bound = *lpat++;		\
-		} else {				\
-			hi_bound = lo_bound;		\
-		}					\
-		if (lo_bound <= lc && lc <= hi_bound) {	\
-			found = !found;			\
-			break;				\
-		}					\
-	}						\
-}
-
-/*
- *	opatmatch - the old external interpreter interface.
- *
- *	Trys to match a string beginning at offset
- *	against the compiled pattern.
- */
-EXPORT Uchar
-*opatmatch(pat, aux, str, soff, slen, alt)
-	const Uchar	*pat;
-	const int	*aux;
-	const Uchar	*str;
-	int		soff;
-	int		slen;
-	int		alt;
-{
-	int		state[MAXPAT];
-
-	return (patmatch(pat, aux, str, soff, slen, alt, state));
-}
-
-/*
- *	patmatch - the external interpreter interface.
- *
- *	Trys to match a string beginning at offset
- *	against the compiled pattern.
- */
-EXPORT Uchar *
-patmatch(pat, aux, str, soff, slen, alt, state)
-	const Uchar	*pat;
-	const int	*aux;
-	const Uchar	*str;
-	int		soff;
-	int		slen;
-	int		alt;
-	int		state[];
-{
-	register int	*sp;
-	register int	*n;
-	register int	*i;
-	register int	p;
-	register int	q, s, k;
-	int		c;
-	const Uchar	*lastp = (Uchar *)NULL;
-
-#ifdef	__LINE_MATCH
-for (; soff <= slen; soff++) {
-#endif
-
-	sp = state;
-	put(sp, state, state, 0);
-	if (alt != ENDSTATE)
-		put(sp, state, sp, alt);
-
-	for (s = soff; ; s++) {
-		/*
-		 * next char from input string
-		 */
-		if (s >= slen)
-			c = 0;
-		else
-			c = str[s];
-		/*
-		 * first complete the closure
-		 */
-		for (n = state; n < sp; ) {
-			p = *n++;		/* next state number */
-			if (p == ENDSTATE)
-				continue;
-			q = aux[p];		/* get next state for pat */
-			k = pat[p];		/* get next char from pat */
-			switch (k) {
-
-			case REP:
-				put(sp, state, sp, p+1);
-				/* FALLTHRU */
-			case NIL:		/* NIL matches always */
-			case STAR:
-				put(sp, state, sp, q);
-				break;
-			case LBRACK:		/* alternations */
-			case ALT:
-				put(sp, state, sp, p+1);
-				if (q != ENDSTATE)
-					put(sp, state, sp, q);
-				break;
-			case START:
-				if (s == 0)
-					put(sp, state, sp, q);
-				break;
-			case END:
-				if (c == '\0')
-					put(sp, state, sp, q);
-				break;
-			}
-		}
-
-		for (i = state; i < sp; ) {
-			if (*i++ == ENDSTATE) {
-				lastp = &str[s];
-				break;
-			}
-		}
-		if (c == 0)
-			return ((Uchar *)lastp);
-
-		/*
-		 * now try to match next character
-		 */
-		n = sp;
-		sp = state;
-		for (i = sp; i < n; ) {
-			p = *i++;		/* next active state number */
-			if (p == ENDSTATE)
-				continue;
-			k = pat[p];
-			switch (k) {
-
-			case ALT:
-			case REP:
-			case NIL:
-			case LBRACK:
-			case START:
-			case END:
-				continue;
-			case LCLASS:
-				in_class(q, &pat[p+1], c);
-				if (!q)
-					continue;
-				break;
-			case STAR:
-				put(sp, state, sp, p);
-				continue;
-			case QUOTE:
-				k = pat[p+1];
-			default:
-				if (k != c)
-					continue;
-				/* FALLTHRU */
-			case ANY:
-				break;
-			}
-			put(sp, state, sp, aux[p]);
-		}
-		if (sp == state) {		/* if no new states return */
-#ifdef	__LINE_MATCH
-
-			if (lastp || (soff == slen - 1))
-				return ((Uchar *)lastp);
-			else
-				break;
-#else
-			return ((Uchar *)lastp);
-#endif
-		}
-	}
-#ifdef	__LINE_MATCH
-}
-return ((Uchar *)lastp);
-#endif
-}
-
-
-#ifndef	__LINE_MATCH
-/*---------------------------------------------------------------------------
-|
-|	The Compiler
-|
-+---------------------------------------------------------------------------*/
-
-typedef	struct args {
-	const Uchar	*pattern;
-	int		*aux;
-	int		patp;
-	int		length;
-	Uchar		Ch;
-} arg_t;
-
-LOCAL	void	nextitem __PR((arg_t *));
-LOCAL	int	prim	 __PR((arg_t *));
-LOCAL	int	expr	 __PR((arg_t *, int *));
-LOCAL	void	setexits __PR((int *, int, int));
-LOCAL	int	join	 __PR((int *, int, int));
-
-/*
- *	'read' the next character from pattern
- */
-#define	rch(ap)						\
-{							\
-	if (++(ap)->patp >= (ap)->length)		\
-		(ap)->Ch = 0;				\
-	else						\
-		(ap)->Ch = (ap)->pattern[(ap)->patp];	\
-}
-
-/*
- *	get the next item from pattern
- */
-LOCAL void
-nextitem(ap)
-	arg_t	*ap;
-{
-	if (ap->Ch == QUOTE)
-		rch(ap);
-	rch(ap);
-}
-
-/*
- *	parse a primary
- */
-LOCAL int
-prim(ap)
-	arg_t	*ap;
-{
-	int	a  = ap->patp;
-	int	op = ap->Ch;
-	int	t;
-
-	nextitem(ap);
-	switch (op) {
-
-	case '\0':
-	case ALT:
-	case RBRACK:
-		return (ENDSTATE);
-	case LCLASS:
-		while (ap->Ch != RCLASS && ap->Ch != '\0')
-			nextitem(ap);
-		if (ap->Ch == '\0')
-			return (ENDSTATE);
-		nextitem(ap);
-		break;
-	case REP:
-		t = prim(ap);
-		if (t == ENDSTATE)
-			return (ENDSTATE);
-		setexits(ap->aux, t, a);
-		break;
-	case LBRACK:
-		a = expr(ap, &ap->aux[a]);
-		if (a == ENDSTATE || ap->Ch != RBRACK)
-			return (ENDSTATE);
-		nextitem(ap);
-		break;
-	}
-	return (a);
-}
-
-/*
- *	parse an expression (a sequence of primaries)
- */
-LOCAL int
-expr(ap, altp)
-	arg_t	*ap;
-	int	*altp;
-{
-	int	exits = ENDSTATE;
-	int	a;
-	int	*aux = ap->aux;
-	Uchar	Ch;
-
-	for (;;) {
-		a = prim(ap);
-		Ch = ap->Ch;
-		if (Ch == ALT || Ch == RBRACK || Ch == '\0') {
-			exits = join(aux, exits, a);
-			if (Ch != ALT)
-				return (exits);
-			*altp = ap->patp;
-			altp = &aux[ap->patp];
-			nextitem(ap);
-		} else
-			setexits(aux, a, ap->patp);
-	}
-}
-
-/*
- *	set all exits in a list to a specified value
- */
-LOCAL void
-setexits(aux, list, val)
-	int	*aux;
-	int	list;
-	int	val;
-{
-	int	a;
-
-	while (list != ENDSTATE) {
-		a = aux[list];
-		aux[list] = val;
-		list = a;
-	}
-}
-
-/*
- *	concatenate two lists
- */
-LOCAL int
-join(aux, a, b)
-	int	*aux;
-	int	a;
-	int	b;
-{
-	int	t;
-
-	if (a == ENDSTATE)
-		return (b);
-	t = a;
-	while (aux[t] != ENDSTATE)
-		t = aux[t];
-	aux[t] = b;
-	return (a);
-}
-
-/*
- *	patcompile - the external compiler interface.
- *
- *	The pattern is compiled into the aux array.
- *	Return value on success, is the outermost alternate which is != 0.
- *	Error is indicated by return of 0.
- */
-EXPORT int
-patcompile(pat, len, aux)
-	const Uchar	*pat;
-	int		len;
-	int		*aux;
-{
-	arg_t	a;
-	int	alt = ENDSTATE;
-	int	i;
-
-	a.pattern = pat;
-	a.length  = len;
-	a.aux	  = aux;
-	a.patp    = -1;
-
-	for (i = 0; i < len; i++)
-		aux[i] = ENDSTATE;
-	rch(&a);
-	i = expr(&a, &alt);
-	if (i == ENDSTATE)
-		return (0);
-	setexits(aux, i, ENDSTATE);
-	return (alt);
-}
-#endif	/* LMATCH */

Deleted: cdrkit/trunk/libschily/matchl.c
===================================================================
--- cdrkit/trunk/libschily/matchl.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libschily/matchl.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -1,35 +0,0 @@
-/*
- * This file has been modified for the cdrkit suite.
- *
- * The behaviour and appearence of the program code below can differ to a major
- * extent from the version distributed by the original author(s).
- *
- * For details, see Changelog file distributed with the cdrkit package. If you
- * received this file from another source then ask the distributing person for
- * a log of modifications.
- *
- */
-
-/* @(#)matchl.c	1.1 00/11/10 Copyright 1998 J. Schilling */
-/*
- *	Pattern matching function for line match (grep like).
- *
- *	Copyright (c) 1998 J. Schilling
- */
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- * This program 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; see the file COPYING.  If not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#define	__LINE_MATCH
-#include "match.c"

Deleted: cdrkit/trunk/libschily/printf.c
===================================================================
--- cdrkit/trunk/libschily/printf.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libschily/printf.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -1,159 +0,0 @@
-/*
- * This file has been modified for the cdrkit suite.
- *
- * The behaviour and appearence of the program code below can differ to a major
- * extent from the version distributed by the original author(s).
- *
- * For details, see Changelog file distributed with the cdrkit package. If you
- * received this file from another source then ask the distributing person for
- * a log of modifications.
- *
- */
-
-/* @(#)printf.c	1.15 04/09/25 Copyright 1985, 1989, 1995-2003 J. Schilling */
-/*
- *	Copyright (c) 1985, 1989, 1995-2003 J. Schilling
- */
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- * This program 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; see the file COPYING.  If not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <mconfig.h>
-
-#ifdef	printf
-#	define	__no_undef__
-#else
-#	define	printf		__nothing__
-#endif
-#ifdef	fprintf
-#	define	__no_undef2__
-#else
-#	define	fprintf		__nothing2__
-#endif
-
-#include <stdio.h>
-#include <vadefs.h>
-#include <standard.h>
-#include <schily.h>
-
-#ifndef	__no_undef__
-#	undef	printf
-#endif
-#ifndef	__no_undef2__
-#	undef	fprintf
-#endif
-
-#define	BFSIZ	256
-
-typedef struct {
-	short	cnt;
-	char	*ptr;
-	char	buf[BFSIZ];
-	int	count;
-	FILE	*f;
-} *BUF, _BUF;
-
-LOCAL	void	_bflush	__PR((BUF));
-LOCAL	void	_bput	__PR((char, long));
-EXPORT	int	fprintf	__PR((FILE *, const char *, ...))	__printflike__(2, 3);
-EXPORT	int	printf	__PR((const char *, ...))		__printflike__(1, 2);
-
-LOCAL void
-_bflush(bp)
-	register BUF	bp;
-{
-	bp->count += bp->ptr - bp->buf;
-	if (filewrite(bp->f, bp->buf, bp->ptr - bp->buf) < 0)
-		bp->count = EOF;
-	bp->ptr = bp->buf;
-	bp->cnt = BFSIZ;
-}
-
-#ifdef	PROTOTYPES
-LOCAL void
-_bput(char c, long l)
-#else
-LOCAL void
-_bput(c, l)
-		char	c;
-		long	l;
-#endif
-{
-	register BUF	bp = (BUF)l;
-
-	*bp->ptr++ = c;
-	if (--bp->cnt <= 0)
-		_bflush(bp);
-}
-
-/* VARARGS1 */
-#ifdef	PROTOTYPES
-EXPORT int
-printf(const char *form, ...)
-#else
-EXPORT int
-printf(form, va_alist)
-	char	*form;
-	va_dcl
-#endif
-{
-	va_list	args;
-	_BUF	bb;
-
-	bb.ptr = bb.buf;
-	bb.cnt = BFSIZ;
-	bb.count = 0;
-	bb.f = stdout;
-#ifdef	PROTOTYPES
-	va_start(args, form);
-#else
-	va_start(args);
-#endif
-	format(_bput, (long)&bb, form, args);
-	va_end(args);
-	if (bb.cnt < BFSIZ)
-		_bflush(&bb);
-	return (bb.count);
-}
-
-/* VARARGS2 */
-#ifdef	PROTOTYPES
-EXPORT int
-fprintf(FILE *file, const char *form, ...)
-#else
-EXPORT int
-fprintf(file, form, va_alist)
-	FILE	*file;
-	char	*form;
-	va_dcl
-#endif
-{
-	va_list	args;
-	_BUF	bb;
-
-	bb.ptr = bb.buf;
-	bb.cnt = BFSIZ;
-	bb.count = 0;
-	bb.f = file;
-#ifdef	PROTOTYPES
-	va_start(args, form);
-#else
-	va_start(args);
-#endif
-	format(_bput, (long)&bb, form, args);
-	va_end(args);
-	if (bb.cnt < BFSIZ)
-		_bflush(&bb);
-	return (bb.count);
-}

Modified: cdrkit/trunk/libschily/rename.c
===================================================================
--- cdrkit/trunk/libschily/rename.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libschily/rename.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -96,7 +96,7 @@
 			return (0);		/* old == new we are done */
 	}
 
-	strplen = js_snprintf(strpid, sizeof (strpid), ".%lld",
+	strplen = snprintf(strpid, sizeof (strpid), ".%lld",
 							(Llong)getpid());
 
 	if (strlen(new) <= (MAXNAME-strplen) ||
@@ -106,7 +106,7 @@
 		 */
 		strncpy(nname, new, MAXNAME-strplen);
 		nname[MAXNAME-strplen] = '\0';
-		js_snprintf(bakname, sizeof (bakname), "%s%s", nname, strpid);
+		snprintf(bakname, sizeof (bakname), "%s%s", nname, strpid);
 		unlink(bakname);
 		if (link(new, bakname) >= 0)
 			savpresent = TRUE;

Deleted: cdrkit/trunk/libschily/serrmsg.c
===================================================================
--- cdrkit/trunk/libschily/serrmsg.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libschily/serrmsg.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -1,129 +0,0 @@
-/*
- * This file has been modified for the cdrkit suite.
- *
- * The behaviour and appearence of the program code below can differ to a major
- * extent from the version distributed by the original author(s).
- *
- * For details, see Changelog file distributed with the cdrkit package. If you
- * received this file from another source then ask the distributing person for
- * a log of modifications.
- *
- */
-
-/* @(#)serrmsg.c	1.3 03/06/15 Copyright 1985, 2000-2003 J. Schilling */
-/*
- *	Routines for printing command errors
- *
- *	Copyright (c) 1985, 2000-2003 J. Schilling
- */
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- * This program 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; see the file COPYING.  If not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <mconfig.h>
-#include <unixstd.h>		/* include <sys/types.h> try to get size_t */
-#include <stdio.h>		/* Try again for size_t	*/
-#include <stdxlib.h>		/* Try again for size_t	*/
-#include <standard.h>
-#include <stdxlib.h>
-#include <vadefs.h>
-#include <strdefs.h>
-#include <schily.h>
-#ifndef	HAVE_STRERROR
-extern	char	*sys_errlist[];
-extern	int	sys_nerr;
-#endif
-
-EXPORT	int	serrmsg		__PR((char *buf, size_t maxcnt, const char *, ...));
-EXPORT	int	serrmsgno	__PR((int, char *buf, size_t maxcnt, const char *, ...));
-LOCAL	int	_serrmsg	__PR((int, char *buf, size_t maxcnt, const char *, va_list));
-
-/* VARARGS1 */
-EXPORT int
-#ifdef	PROTOTYPES
-serrmsg(char *buf, size_t maxcnt, const char *msg, ...)
-#else
-serrmsg(buf, maxcnt, msg, va_alist)
-	char	*buf;
-	size_t	maxcnt;
-	char	*msg;
-	va_dcl
-#endif
-{
-	va_list	args;
-	int	ret;
-
-#ifdef	PROTOTYPES
-	va_start(args, msg);
-#else
-	va_start(args);
-#endif
-	ret = _serrmsg(geterrno(), buf, maxcnt, msg, args);
-	va_end(args);
-	return (ret);
-}
-
-/* VARARGS2 */
-#ifdef	PROTOTYPES
-EXPORT int
-serrmsgno(int err, char *buf, size_t maxcnt, const char *msg, ...)
-#else
-serrmsgno(err, buf, maxcnt, msg, va_alist)
-	int	err;
-	char	*buf;
-	size_t	maxcnt;
-	char	*msg;
-	va_dcl
-#endif
-{
-	va_list	args;
-	int	ret;
-
-#ifdef	PROTOTYPES
-	va_start(args, msg);
-#else
-	va_start(args);
-#endif
-	ret = _serrmsg(err, buf, maxcnt, msg, args);
-	va_end(args);
-	return (ret);
-}
-
-LOCAL int
-_serrmsg(err, buf, maxcnt, msg, args)
-	int		err;
-	char		*buf;
-	size_t		maxcnt;
-	const char	*msg;
-	va_list		args;
-{
-	int	ret;
-	char	errbuf[20];
-	char	*errnam;
-	char	*prognam = get_progname();
-
-	if (err < 0) {
-		ret = js_snprintf(buf, maxcnt, "%s: %r", prognam, msg, args);
-	} else {
-		errnam = errmsgstr(err);
-		if (errnam == NULL) {
-			(void) js_snprintf(errbuf, sizeof (errbuf),
-						"Error %d", err);
-			errnam = errbuf;
-		}
-		ret = js_snprintf(buf, maxcnt,
-				"%s: %s. %r", prognam, errnam, msg, args);
-	}
-	return (ret);
-}

Deleted: cdrkit/trunk/libschily/setfp.c
===================================================================
--- cdrkit/trunk/libschily/setfp.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libschily/setfp.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -1,78 +0,0 @@
-/*
- * This file has been modified for the cdrkit suite.
- *
- * The behaviour and appearence of the program code below can differ to a major
- * extent from the version distributed by the original author(s).
- *
- * For details, see Changelog file distributed with the cdrkit package. If you
- * received this file from another source then ask the distributing person for
- * a log of modifications.
- *
- */
-
-/* @(#)setfp.c	1.11 03/07/13 Copyright 1988, 1995-2003 J. Schilling */
-/*
- *	Set frame pointer
- *
- *	Copyright (c) 1988, 1995-2003 J. Schilling
- */
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- * This program 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; see the file COPYING.  If not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <mconfig.h>
-#include <standard.h>
-#include <avoffset.h>
-#include <schily.h>
-
-#if	!defined(AV_OFFSET) || !defined(FP_INDIR)
-#	ifdef	HAVE_SCANSTACK
-#	undef	HAVE_SCANSTACK
-#	endif
-#endif
-
-#	ifdef	HAVE_SCANSTACK
-#include <stkframe.h>
-
-#define	MAXWINDOWS	32
-#define	NWINDOWS	7
-
-extern	void	**___fpoff	__PR((char *cp));
-
-EXPORT void
-setfp(fp)
-	void	* const *fp;
-{
-		long	**dummy[1];
-
-#ifdef	sparc
-	flush_reg_windows(MAXWINDOWS-2);
-#endif
-	*(long ***)(&((struct frame *)___fpoff((char *)&dummy[0]))->fr_savfp) =
-								(long **)fp;
-#ifdef	sparc
-	flush_reg_windows(MAXWINDOWS-2);
-#endif
-}
-
-#else
-
-EXPORT void
-setfp(fp)
-	void	* const *fp;
-{
-	raisecond("setfp_not_implemented", 0L);
-}
-
-#endif

Deleted: cdrkit/trunk/libschily/strtod.c
===================================================================
--- cdrkit/trunk/libschily/strtod.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libschily/strtod.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -1,2541 +0,0 @@
-/*
- * This file has been modified for the cdrkit suite.
- *
- * The behaviour and appearence of the program code below can differ to a major
- * extent from the version distributed by the original author(s).
- *
- * For details, see Changelog file distributed with the cdrkit package. If you
- * received this file from another source then ask the distributing person for
- * a log of modifications.
- *
- */
-
-/*	$NetBSD: strtod.c,v 1.23 1996/10/13 00:07:55 christos Exp $	*/
-
-/****************************************************************
- *
- * The author of this software is David M. Gay.
- *
- * Copyright (c) 1991 by AT&T.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose without fee is hereby granted, provided that this entire notice
- * is included in all copies of any software which is or includes a copy
- * or modification of this software and in all copies of the supporting
- * documentation for such software.
- *
- * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTY.  IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY
- * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
- * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
- *
- ***************************************************************/
-
-/* Please send bug reports to
-	David M. Gay
-	AT&T Bell Laboratories, Room 2C-463
-	600 Mountain Avenue
-	Murray Hill, NJ 07974-2070
-	U.S.A.
-	dmg at research.att.com or research!dmg
- */
-
-/* strtod for IEEE-, VAX-, and IBM-arithmetic machines.
- *
- * This strtod returns a nearest machine number to the input decimal
- * string (or sets errno to ERANGE).  With IEEE arithmetic, ties are
- * broken by the IEEE round-even rule.  Otherwise ties are broken by
- * biased rounding (add half and chop).
- *
- * Inspired loosely by William D. Clinger's paper "How to Read Floating
- * Point Numbers Accurately" [Proc. ACM SIGPLAN '90, pp. 92-101].
- *
- * Modifications:
- *
- *	1. We only require IEEE, IBM, or VAX double-precision
- *		arithmetic (not IEEE double-extended).
- *	2. We get by with floating-point arithmetic in a case that
- *		Clinger missed -- when we're computing d * 10^n
- *		for a small integer d and the integer n is not too
- *		much larger than 22 (the maximum integer k for which
- *		we can represent 10^k exactly), we may be able to
- *		compute (d*10^k) * 10^(e-k) with just one roundoff.
- *	3. Rather than a bit-at-a-time adjustment of the binary
- *		result in the hard case, we use floating-point
- *		arithmetic to determine the adjustment to within
- *		one bit; only in really hard cases do we need to
- *		compute a second residual.
- *	4. Because of 3., we don't need a large table of powers of 10
- *		for ten-to-e (just some small tables, e.g. of 10^k
- *		for 0 <= k <= 22).
- */
-
-/*
- * #define IEEE_LITTLE_ENDIAN for IEEE-arithmetic machines where the least
- *	significant byte has the lowest address.
- * #define IEEE_BIG_ENDIAN for IEEE-arithmetic machines where the most
- *	significant byte has the lowest address.
- * #define Long int on machines with 32-bit ints and 64-bit longs.
- * #define Sudden_Underflow for IEEE-format machines without gradual
- *	underflow (i.e., that flush to zero on underflow).
- * #define IBM for IBM mainframe-style floating-point arithmetic.
- * #define VAX for VAX-style floating-point arithmetic.
- * #define Unsigned_Shifts if >> does treats its left operand as unsigned.
- * #define No_leftright to omit left-right logic in fast floating-point
- *	computation of dtoa.
- * #define Check_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3.
- * #define RND_PRODQUOT to use rnd_prod and rnd_quot (assembly routines
- *	that use extended-precision instructions to compute rounded
- *	products and quotients) with IBM.
- * #define ROUND_BIASED for IEEE-format with biased rounding.
- * #define Inaccurate_Divide for IEEE-format with correctly rounded
- *	products but inaccurate quotients, e.g., for Intel i860.
- * #define Just_16 to store 16 bits per 32-bit Long when doing high-precision
- *	integer arithmetic.  Whether this speeds things up or slows things
- *	down depends on the machine and the number being converted.
- * #define KR_headers for old-style C function headers.
- * #define Bad_float_h if your system lacks a float.h or if it does not
- *	define some or all of DBL_DIG, DBL_MAX_10_EXP, DBL_MAX_EXP,
- *	FLT_RADIX, FLT_ROUNDS, and DBL_MAX.
- * #define MALLOC your_malloc, where your_malloc(n) acts like malloc(n)
- *	if memory is available and otherwise does something you deem
- *	appropriate.  If MALLOC is undefined, malloc will be invoked
- *	directly -- and assumed always to succeed.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$NetBSD: strtod.c,v 1.23 1996/10/13 00:07:55 christos Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-#include <mconfig.h>
-#include <btorder.h>
-
-#ifdef	__OLD_NETBSD_DEFINES__
-
-#if defined(__m68k__) || defined(__sparc__) || defined(__i386__) || \
-    defined(__mips__) || defined(__ns32k__) || defined(__alpha__) || \
-    defined(__powerpc__)
-#include <sys/types.h>
-#if BYTE_ORDER == BIG_ENDIAN
-#define IEEE_BIG_ENDIAN
-#else
-#define IEEE_LITTLE_ENDIAN
-#endif
-#endif
-
-#else	/* __OLD_NETBSD_DEFINES__ */
-
-#if !defined(__arm32__) && !defined(vax) && !defined(IBM)
-
-/*#ifdef	_BIG_ENDIAN*/
-#ifdef	WORDS_BIGENDIAN
-#define IEEE_BIG_ENDIAN
-#else
-#define IEEE_LITTLE_ENDIAN
-#endif
-
-#endif	/* !defined(__arm32__) && !defined(vax) && !defined(IBM) */
-
-#endif	/* __OLD_NETBSD_DEFINES__ */
-
-#ifdef __arm32__
-/*
- * Although the CPU is little endian the FP has different
- * byte and word endianness. The byte order is still little endian
- * but the word order is big endian.
- */
-#define IEEE_BIG_ENDIAN
-#endif
-
-#ifdef vax
-#define VAX
-#endif
-
-#include <utypes.h>
-#define Long	Int32_t
-#define ULong	UInt32_t
-
-#ifdef DEBUG
-#include "stdio.h"
-#define Bug(x) {fprintf(stderr, "%s\n", x); exit(1);}
-#endif
-
-#ifdef __cplusplus
-#include "malloc.h"
-#include "memory.h"
-#else
-#ifndef KR_headers
-#include "stdlib.h"
-#include "string.h"
-#include "locale.h"
-#else
-#include "malloc.h"
-#include "memory.h"
-#endif
-#endif
-
-#ifdef MALLOC
-#ifdef KR_headers
-extern char *MALLOC();
-#else
-extern void *MALLOC(size_t);
-#endif
-#else
-#define MALLOC malloc
-#endif
-
-#include "ctype.h"
-#include "errno.h"
-#ifndef	HAVE_ERRNO_DEF
-extern	int	errno;
-#endif
-
-#ifdef Bad_float_h
-#undef __STDC__
-#ifdef IEEE_BIG_ENDIAN
-#define IEEE_ARITHMETIC
-#endif
-#ifdef IEEE_LITTLE_ENDIAN
-#define IEEE_ARITHMETIC
-#endif
-
-#ifdef IEEE_ARITHMETIC
-#define DBL_DIG 15
-#define DBL_MAX_10_EXP 308
-#define DBL_MAX_EXP 1024
-#define FLT_RADIX 2
-#define FLT_ROUNDS 1
-#define DBL_MAX 1.7976931348623157e+308
-#endif
-
-#ifdef IBM
-#define DBL_DIG 16
-#define DBL_MAX_10_EXP 75
-#define DBL_MAX_EXP 63
-#define FLT_RADIX 16
-#define FLT_ROUNDS 0
-#define DBL_MAX 7.2370055773322621e+75
-#endif
-
-#ifdef VAX
-#define DBL_DIG 16
-#define DBL_MAX_10_EXP 38
-#define DBL_MAX_EXP 127
-#define FLT_RADIX 2
-#define FLT_ROUNDS 1
-#define DBL_MAX 1.7014118346046923e+38
-#endif
-
-#ifndef LONG_MAX
-#define LONG_MAX 2147483647
-#endif
-#else
-#include "float.h"
-#endif
-#ifndef __MATH_H__
-#include "math.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef CONST
-#ifdef KR_headers
-#define CONST /* blank */
-#else
-#define CONST const
-#endif
-#endif
-
-#ifdef Unsigned_Shifts
-#define Sign_Extend(a,b) if (b < 0) a |= 0xffff0000;
-#else
-#define Sign_Extend(a,b) /*no-op*/
-#endif
-
-#if defined(IEEE_LITTLE_ENDIAN) + defined(IEEE_BIG_ENDIAN) + defined(VAX) + \
-    defined(IBM) != 1
-Exactly one of IEEE_LITTLE_ENDIAN IEEE_BIG_ENDIAN, VAX, or
-IBM should be defined.
-#endif
-
-#ifdef IEEE_LITTLE_ENDIAN
-#define word0(x) ((ULong *)&x)[1]
-#define word1(x) ((ULong *)&x)[0]
-#else
-#define word0(x) ((ULong *)&x)[0]
-#define word1(x) ((ULong *)&x)[1]
-#endif
-
-/* The following definition of Storeinc is appropriate for MIPS processors.
- * An alternative that might be better on some machines is
- * #define Storeinc(a,b,c) (*a++ = b << 16 | c & 0xffff)
- */
-#if defined(IEEE_LITTLE_ENDIAN) + defined(VAX) + defined(__arm32__)
-#define Storeinc(a,b,c) (((unsigned short *)a)[1] = (unsigned short)b, \
-((unsigned short *)a)[0] = (unsigned short)c, a++)
-#else
-#define Storeinc(a,b,c) (((unsigned short *)a)[0] = (unsigned short)b, \
-((unsigned short *)a)[1] = (unsigned short)c, a++)
-#endif
-
-/* #define P DBL_MANT_DIG */
-/* Ten_pmax = floor(P*log(2)/log(5)) */
-/* Bletch = (highest power of 2 < DBL_MAX_10_EXP) / 16 */
-/* Quick_max = floor((P-1)*log(FLT_RADIX)/log(10) - 1) */
-/* Int_max = floor(P*log(FLT_RADIX)/log(10) - 1) */
-
-#if defined(IEEE_LITTLE_ENDIAN) + defined(IEEE_BIG_ENDIAN)
-#define Exp_shift  20
-#define Exp_shift1 20
-#define Exp_msk1    0x100000
-#define Exp_msk11   0x100000
-#define Exp_mask  0x7ff00000
-#define P 53
-#define Bias 1023
-#define IEEE_Arith
-#define Emin (-1022)
-#define Exp_1  0x3ff00000
-#define Exp_11 0x3ff00000
-#define Ebits 11
-#define Frac_mask  0xfffff
-#define Frac_mask1 0xfffff
-#define Ten_pmax 22
-#define Bletch 0x10
-#define Bndry_mask  0xfffff
-#define Bndry_mask1 0xfffff
-#define LSB 1
-#define Sign_bit 0x80000000
-#define Log2P 1
-#define Tiny0 0
-#define Tiny1 1
-#define Quick_max 14
-#define Int_max 14
-#define Infinite(x) (word0(x) == 0x7ff00000) /* sufficient test for here */
-#else
-#undef  Sudden_Underflow
-#define Sudden_Underflow
-#ifdef IBM
-#define Exp_shift  24
-#define Exp_shift1 24
-#define Exp_msk1   0x1000000
-#define Exp_msk11  0x1000000
-#define Exp_mask  0x7f000000
-#define P 14
-#define Bias 65
-#define Exp_1  0x41000000
-#define Exp_11 0x41000000
-#define Ebits 8	/* exponent has 7 bits, but 8 is the right value in b2d */
-#define Frac_mask  0xffffff
-#define Frac_mask1 0xffffff
-#define Bletch 4
-#define Ten_pmax 22
-#define Bndry_mask  0xefffff
-#define Bndry_mask1 0xffffff
-#define LSB 1
-#define Sign_bit 0x80000000
-#define Log2P 4
-#define Tiny0 0x100000
-#define Tiny1 0
-#define Quick_max 14
-#define Int_max 15
-#else /* VAX */
-#define Exp_shift  23
-#define Exp_shift1 7
-#define Exp_msk1    0x80
-#define Exp_msk11   0x800000
-#define Exp_mask  0x7f80
-#define P 56
-#define Bias 129
-#define Exp_1  0x40800000
-#define Exp_11 0x4080
-#define Ebits 8
-#define Frac_mask  0x7fffff
-#define Frac_mask1 0xffff007f
-#define Ten_pmax 24
-#define Bletch 2
-#define Bndry_mask  0xffff007f
-#define Bndry_mask1 0xffff007f
-#define LSB 0x10000
-#define Sign_bit 0x8000
-#define Log2P 1
-#define Tiny0 0x80
-#define Tiny1 0
-#define Quick_max 15
-#define Int_max 15
-#endif
-#endif
-
-#ifndef IEEE_Arith
-#define ROUND_BIASED
-#endif
-
-#ifdef RND_PRODQUOT
-#define rounded_product(a,b) a = rnd_prod(a, b)
-#define rounded_quotient(a,b) a = rnd_quot(a, b)
-#ifdef KR_headers
-extern double rnd_prod(), rnd_quot();
-#else
-extern double rnd_prod(double, double), rnd_quot(double, double);
-#endif
-#else
-#define rounded_product(a,b) a *= b
-#define rounded_quotient(a,b) a /= b
-#endif
-
-#define Big0 (Frac_mask1 | Exp_msk1*(DBL_MAX_EXP+Bias-1))
-#define Big1 0xffffffff
-
-#ifndef Just_16
-/* When Pack_32 is not defined, we store 16 bits per 32-bit Long.
- * This makes some inner loops simpler and sometimes saves work
- * during multiplications, but it often seems to make things slightly
- * slower.  Hence the default is now to store 32 bits per Long.
- */
-#ifndef Pack_32
-#define Pack_32
-#endif
-#endif
-
-#define Kmax 15
-
- struct
-Bigint {
-	struct Bigint *next;
-	int k, maxwds, sign, wds;
-	ULong x[1];
-	};
-
- typedef struct Bigint Bigint;
-
- static Bigint *freelist[Kmax+1];
-
- static Bigint *
-Balloc
-#ifdef KR_headers
-	(k) int k;
-#else
-	(int k)
-#endif
-{
-	int x;
-	Bigint *rv;
-
-	if (rv = freelist[k]) {
-		freelist[k] = rv->next;
-		}
-	else {
-		x = 1 << k;
-		rv = (Bigint *)MALLOC(sizeof(Bigint) + (x-1)*sizeof(Long));
-		rv->k = k;
-		rv->maxwds = x;
-		}
-	rv->sign = rv->wds = 0;
-	return rv;
-	}
-
- static void
-Bfree
-#ifdef KR_headers
-	(v) Bigint *v;
-#else
-	(Bigint *v)
-#endif
-{
-	if (v) {
-		v->next = freelist[v->k];
-		freelist[v->k] = v;
-		}
-	}
-
-#define Bcopy(x,y) memcpy((char *)&x->sign, (char *)&y->sign, \
-y->wds*sizeof(Long) + 2*sizeof(int))
-
- static Bigint *
-multadd
-#ifdef KR_headers
-	(b, m, a) Bigint *b; int m, a;
-#else
-	(Bigint *b, int m, int a)	/* multiply by m and add a */
-#endif
-{
-	int i, wds;
-	ULong *x, y;
-#ifdef Pack_32
-	ULong xi, z;
-#endif
-	Bigint *b1;
-
-	wds = b->wds;
-	x = b->x;
-	i = 0;
-	do {
-#ifdef Pack_32
-		xi = *x;
-		y = (xi & 0xffff) * m + a;
-		z = (xi >> 16) * m + (y >> 16);
-		a = (int)(z >> 16);
-		*x++ = (z << 16) + (y & 0xffff);
-#else
-		y = *x * m + a;
-		a = (int)(y >> 16);
-		*x++ = y & 0xffff;
-#endif
-		}
-		while(++i < wds);
-	if (a) {
-		if (wds >= b->maxwds) {
-			b1 = Balloc(b->k+1);
-			Bcopy(b1, b);
-			Bfree(b);
-			b = b1;
-			}
-		b->x[wds++] = a;
-		b->wds = wds;
-		}
-	return b;
-	}
-
- static Bigint *
-s2b
-#ifdef KR_headers
-	(s, nd0, nd, y9) CONST char *s; int nd0, nd; ULong y9;
-#else
-	(CONST char *s, int nd0, int nd, ULong y9)
-#endif
-{
-	Bigint *b;
-	int i, k;
-	Long x, y;
-
-	x = (nd + 8) / 9;
-	for(k = 0, y = 1; x > y; y <<= 1, k++) ;
-#ifdef Pack_32
-	b = Balloc(k);
-	b->x[0] = y9;
-	b->wds = 1;
-#else
-	b = Balloc(k+1);
-	b->x[0] = y9 & 0xffff;
-	b->wds = (b->x[1] = y9 >> 16) ? 2 : 1;
-#endif
-
-	i = 9;
-	if (9 < nd0) {
-		s += 9;
-		do b = multadd(b, 10, *s++ - '0');
-			while(++i < nd0);
-		s++;
-		}
-	else
-		s += 10;
-	for(; i < nd; i++)
-		b = multadd(b, 10, *s++ - '0');
-	return b;
-	}
-
- static int
-hi0bits
-#ifdef KR_headers
-	(x) register ULong x;
-#else
-	(register ULong x)
-#endif
-{
-	register int k = 0;
-
-	if (!(x & 0xffff0000)) {
-		k = 16;
-		x <<= 16;
-		}
-	if (!(x & 0xff000000)) {
-		k += 8;
-		x <<= 8;
-		}
-	if (!(x & 0xf0000000)) {
-		k += 4;
-		x <<= 4;
-		}
-	if (!(x & 0xc0000000)) {
-		k += 2;
-		x <<= 2;
-		}
-	if (!(x & 0x80000000)) {
-		k++;
-		if (!(x & 0x40000000))
-			return 32;
-		}
-	return k;
-	}
-
- static int
-lo0bits
-#ifdef KR_headers
-	(y) ULong *y;
-#else
-	(ULong *y)
-#endif
-{
-	register int k;
-	register ULong x = *y;
-
-	if (x & 7) {
-		if (x & 1)
-			return 0;
-		if (x & 2) {
-			*y = x >> 1;
-			return 1;
-			}
-		*y = x >> 2;
-		return 2;
-		}
-	k = 0;
-	if (!(x & 0xffff)) {
-		k = 16;
-		x >>= 16;
-		}
-	if (!(x & 0xff)) {
-		k += 8;
-		x >>= 8;
-		}
-	if (!(x & 0xf)) {
-		k += 4;
-		x >>= 4;
-		}
-	if (!(x & 0x3)) {
-		k += 2;
-		x >>= 2;
-		}
-	if (!(x & 1)) {
-		k++;
-		x >>= 1;
-		if (!x & 1)
-			return 32;
-		}
-	*y = x;
-	return k;
-	}
-
- static Bigint *
-i2b
-#ifdef KR_headers
-	(i) int i;
-#else
-	(int i)
-#endif
-{
-	Bigint *b;
-
-	b = Balloc(1);
-	b->x[0] = i;
-	b->wds = 1;
-	return b;
-	}
-
- static Bigint *
-mult
-#ifdef KR_headers
-	(a, b) Bigint *a, *b;
-#else
-	(Bigint *a, Bigint *b)
-#endif
-{
-	Bigint *c;
-	int k, wa, wb, wc;
-	ULong carry, y, z;
-	ULong *x, *xa, *xae, *xb, *xbe, *xc, *xc0;
-#ifdef Pack_32
-	ULong z2;
-#endif
-
-	if (a->wds < b->wds) {
-		c = a;
-		a = b;
-		b = c;
-		}
-	k = a->k;
-	wa = a->wds;
-	wb = b->wds;
-	wc = wa + wb;
-	if (wc > a->maxwds)
-		k++;
-	c = Balloc(k);
-	for(x = c->x, xa = x + wc; x < xa; x++)
-		*x = 0;
-	xa = a->x;
-	xae = xa + wa;
-	xb = b->x;
-	xbe = xb + wb;
-	xc0 = c->x;
-#ifdef Pack_32
-	for(; xb < xbe; xb++, xc0++) {
-		if (y = *xb & 0xffff) {
-			x = xa;
-			xc = xc0;
-			carry = 0;
-			do {
-				z = (*x & 0xffff) * y + (*xc & 0xffff) + carry;
-				carry = z >> 16;
-				z2 = (*x++ >> 16) * y + (*xc >> 16) + carry;
-				carry = z2 >> 16;
-				Storeinc(xc, z2, z);
-				}
-				while(x < xae);
-			*xc = carry;
-			}
-		if (y = *xb >> 16) {
-			x = xa;
-			xc = xc0;
-			carry = 0;
-			z2 = *xc;
-			do {
-				z = (*x & 0xffff) * y + (*xc >> 16) + carry;
-				carry = z >> 16;
-				Storeinc(xc, z, z2);
-				z2 = (*x++ >> 16) * y + (*xc & 0xffff) + carry;
-				carry = z2 >> 16;
-				}
-				while(x < xae);
-			*xc = z2;
-			}
-		}
-#else
-	for(; xb < xbe; xc0++) {
-		if (y = *xb++) {
-			x = xa;
-			xc = xc0;
-			carry = 0;
-			do {
-				z = *x++ * y + *xc + carry;
-				carry = z >> 16;
-				*xc++ = z & 0xffff;
-				}
-				while(x < xae);
-			*xc = carry;
-			}
-		}
-#endif
-	for(xc0 = c->x, xc = xc0 + wc; wc > 0 && !*--xc; --wc) ;
-	c->wds = wc;
-	return c;
-	}
-
- static Bigint *p5s;
-
- static Bigint *
-pow5mult
-#ifdef KR_headers
-	(b, k) Bigint *b; int k;
-#else
-	(Bigint *b, int k)
-#endif
-{
-	Bigint *b1, *p5, *p51;
-	int i;
-	static int p05[3] = { 5, 25, 125 };
-
-	if (i = k & 3)
-		b = multadd(b, p05[i-1], 0);
-
-	if (!(k >>= 2))
-		return b;
-	if (!(p5 = p5s)) {
-		/* first time */
-		p5 = p5s = i2b(625);
-		p5->next = 0;
-		}
-	for(;;) {
-		if (k & 1) {
-			b1 = mult(b, p5);
-			Bfree(b);
-			b = b1;
-			}
-		if (!(k >>= 1))
-			break;
-		if (!(p51 = p5->next)) {
-			p51 = p5->next = mult(p5,p5);
-			p51->next = 0;
-			}
-		p5 = p51;
-		}
-	return b;
-	}
-
- static Bigint *
-lshift
-#ifdef KR_headers
-	(b, k) Bigint *b; int k;
-#else
-	(Bigint *b, int k)
-#endif
-{
-	int i, k1, n, n1;
-	Bigint *b1;
-	ULong *x, *x1, *xe, z;
-
-#ifdef Pack_32
-	n = k >> 5;
-#else
-	n = k >> 4;
-#endif
-	k1 = b->k;
-	n1 = n + b->wds + 1;
-	for(i = b->maxwds; n1 > i; i <<= 1)
-		k1++;
-	b1 = Balloc(k1);
-	x1 = b1->x;
-	for(i = 0; i < n; i++)
-		*x1++ = 0;
-	x = b->x;
-	xe = x + b->wds;
-#ifdef Pack_32
-	if (k &= 0x1f) {
-		k1 = 32 - k;
-		z = 0;
-		do {
-			*x1++ = *x << k | z;
-			z = *x++ >> k1;
-			}
-			while(x < xe);
-		if (*x1 = z)
-			++n1;
-		}
-#else
-	if (k &= 0xf) {
-		k1 = 16 - k;
-		z = 0;
-		do {
-			*x1++ = *x << k  & 0xffff | z;
-			z = *x++ >> k1;
-			}
-			while(x < xe);
-		if (*x1 = z)
-			++n1;
-		}
-#endif
-	else do
-		*x1++ = *x++;
-		while(x < xe);
-	b1->wds = n1 - 1;
-	Bfree(b);
-	return b1;
-	}
-
- static int
-cmp
-#ifdef KR_headers
-	(a, b) Bigint *a, *b;
-#else
-	(Bigint *a, Bigint *b)
-#endif
-{
-	ULong *xa, *xa0, *xb, *xb0;
-	int i, j;
-
-	i = a->wds;
-	j = b->wds;
-#ifdef DEBUG
-	if (i > 1 && !a->x[i-1])
-		Bug("cmp called with a->x[a->wds-1] == 0");
-	if (j > 1 && !b->x[j-1])
-		Bug("cmp called with b->x[b->wds-1] == 0");
-#endif
-	if (i -= j)
-		return i;
-	xa0 = a->x;
-	xa = xa0 + j;
-	xb0 = b->x;
-	xb = xb0 + j;
-	for(;;) {
-		if (*--xa != *--xb)
-			return *xa < *xb ? -1 : 1;
-		if (xa <= xa0)
-			break;
-		}
-	return 0;
-	}
-
- static Bigint *
-diff
-#ifdef KR_headers
-	(a, b) Bigint *a, *b;
-#else
-	(Bigint *a, Bigint *b)
-#endif
-{
-	Bigint *c;
-	int i, wa, wb;
-	Long borrow, y;	/* We need signed shifts here. */
-	ULong *xa, *xae, *xb, *xbe, *xc;
-#ifdef Pack_32
-	Long z;
-#endif
-
-	i = cmp(a,b);
-	if (!i) {
-		c = Balloc(0);
-		c->wds = 1;
-		c->x[0] = 0;
-		return c;
-		}
-	if (i < 0) {
-		c = a;
-		a = b;
-		b = c;
-		i = 1;
-		}
-	else
-		i = 0;
-	c = Balloc(a->k);
-	c->sign = i;
-	wa = a->wds;
-	xa = a->x;
-	xae = xa + wa;
-	wb = b->wds;
-	xb = b->x;
-	xbe = xb + wb;
-	xc = c->x;
-	borrow = 0;
-#ifdef Pack_32
-	do {
-		y = (*xa & 0xffff) - (*xb & 0xffff) + borrow;
-		borrow = y >> 16;
-		Sign_Extend(borrow, y);
-		z = (*xa++ >> 16) - (*xb++ >> 16) + borrow;
-		borrow = z >> 16;
-		Sign_Extend(borrow, z);
-		Storeinc(xc, z, y);
-		}
-		while(xb < xbe);
-	while(xa < xae) {
-		y = (*xa & 0xffff) + borrow;
-		borrow = y >> 16;
-		Sign_Extend(borrow, y);
-		z = (*xa++ >> 16) + borrow;
-		borrow = z >> 16;
-		Sign_Extend(borrow, z);
-		Storeinc(xc, z, y);
-		}
-#else
-	do {
-		y = *xa++ - *xb++ + borrow;
-		borrow = y >> 16;
-		Sign_Extend(borrow, y);
-		*xc++ = y & 0xffff;
-		}
-		while(xb < xbe);
-	while(xa < xae) {
-		y = *xa++ + borrow;
-		borrow = y >> 16;
-		Sign_Extend(borrow, y);
-		*xc++ = y & 0xffff;
-		}
-#endif
-	while(!*--xc)
-		wa--;
-	c->wds = wa;
-	return c;
-	}
-
- static double
-ulp
-#ifdef KR_headers
-	(x) double x;
-#else
-	(double x)
-#endif
-{
-	register Long L;
-	double a;
-
-	L = (word0(x) & Exp_mask) - (P-1)*Exp_msk1;
-#ifndef Sudden_Underflow
-	if (L > 0) {
-#endif
-#ifdef IBM
-		L |= Exp_msk1 >> 4;
-#endif
-		word0(a) = L;
-		word1(a) = 0;
-#ifndef Sudden_Underflow
-		}
-	else {
-		L = -L >> Exp_shift;
-		if (L < Exp_shift) {
-			word0(a) = 0x80000 >> L;
-			word1(a) = 0;
-			}
-		else {
-			word0(a) = 0;
-			L -= Exp_shift;
-			word1(a) = L >= 31 ? 1 : 1 << 31 - L;
-			}
-		}
-#endif
-	return a;
-	}
-
- static double
-b2d
-#ifdef KR_headers
-	(a, e) Bigint *a; int *e;
-#else
-	(Bigint *a, int *e)
-#endif
-{
-	ULong *xa, *xa0, w, y, z;
-	int k;
-	double d;
-#ifdef VAX
-	ULong d0, d1;
-#else
-#define d0 word0(d)
-#define d1 word1(d)
-#endif
-
-	xa0 = a->x;
-	xa = xa0 + a->wds;
-	y = *--xa;
-#ifdef DEBUG
-	if (!y) Bug("zero y in b2d");
-#endif
-	k = hi0bits(y);
-	*e = 32 - k;
-#ifdef Pack_32
-	if (k < Ebits) {
-		d0 = Exp_1 | y >> Ebits - k;
-		w = xa > xa0 ? *--xa : 0;
-		d1 = y << (32-Ebits) + k | w >> Ebits - k;
-		goto ret_d;
-		}
-	z = xa > xa0 ? *--xa : 0;
-	if (k -= Ebits) {
-		d0 = Exp_1 | y << k | z >> 32 - k;
-		y = xa > xa0 ? *--xa : 0;
-		d1 = z << k | y >> 32 - k;
-		}
-	else {
-		d0 = Exp_1 | y;
-		d1 = z;
-		}
-#else
-	if (k < Ebits + 16) {
-		z = xa > xa0 ? *--xa : 0;
-		d0 = Exp_1 | y << k - Ebits | z >> Ebits + 16 - k;
-		w = xa > xa0 ? *--xa : 0;
-		y = xa > xa0 ? *--xa : 0;
-		d1 = z << k + 16 - Ebits | w << k - Ebits | y >> 16 + Ebits - k;
-		goto ret_d;
-		}
-	z = xa > xa0 ? *--xa : 0;
-	w = xa > xa0 ? *--xa : 0;
-	k -= Ebits + 16;
-	d0 = Exp_1 | y << k + 16 | z << k | w >> 16 - k;
-	y = xa > xa0 ? *--xa : 0;
-	d1 = w << k + 16 | y << k;
-#endif
- ret_d:
-#ifdef VAX
-	word0(d) = d0 >> 16 | d0 << 16;
-	word1(d) = d1 >> 16 | d1 << 16;
-#else
-#undef d0
-#undef d1
-#endif
-	return d;
-	}
-
- static Bigint *
-d2b
-#ifdef KR_headers
-	(d, e, bits) double d; int *e, *bits;
-#else
-	(double d, int *e, int *bits)
-#endif
-{
-	Bigint *b;
-	int de, i, k;
-	ULong *x, y, z;
-#ifdef VAX
-	ULong d0, d1;
-	d0 = word0(d) >> 16 | word0(d) << 16;
-	d1 = word1(d) >> 16 | word1(d) << 16;
-#else
-#define d0 word0(d)
-#define d1 word1(d)
-#endif
-
-#ifdef Pack_32
-	b = Balloc(1);
-#else
-	b = Balloc(2);
-#endif
-	x = b->x;
-
-	z = d0 & Frac_mask;
-	d0 &= 0x7fffffff;	/* clear sign bit, which we ignore */
-#ifdef Sudden_Underflow
-	de = (int)(d0 >> Exp_shift);
-#ifndef IBM
-	z |= Exp_msk11;
-#endif
-#else
-	if (de = (int)(d0 >> Exp_shift))
-		z |= Exp_msk1;
-#endif
-#ifdef Pack_32
-	if (y = d1) {
-		if (k = lo0bits(&y)) {
-			x[0] = y | z << 32 - k;
-			z >>= k;
-			}
-		else
-			x[0] = y;
-		i = b->wds = (x[1] = z) ? 2 : 1;
-		}
-	else {
-#ifdef DEBUG
-		if (!z)
-			Bug("Zero passed to d2b");
-#endif
-		k = lo0bits(&z);
-		x[0] = z;
-		i = b->wds = 1;
-		k += 32;
-		}
-#else
-	if (y = d1) {
-		if (k = lo0bits(&y))
-			if (k >= 16) {
-				x[0] = y | z << 32 - k & 0xffff;
-				x[1] = z >> k - 16 & 0xffff;
-				x[2] = z >> k;
-				i = 2;
-				}
-			else {
-				x[0] = y & 0xffff;
-				x[1] = y >> 16 | z << 16 - k & 0xffff;
-				x[2] = z >> k & 0xffff;
-				x[3] = z >> k+16;
-				i = 3;
-				}
-		else {
-			x[0] = y & 0xffff;
-			x[1] = y >> 16;
-			x[2] = z & 0xffff;
-			x[3] = z >> 16;
-			i = 3;
-			}
-		}
-	else {
-#ifdef DEBUG
-		if (!z)
-			Bug("Zero passed to d2b");
-#endif
-		k = lo0bits(&z);
-		if (k >= 16) {
-			x[0] = z;
-			i = 0;
-			}
-		else {
-			x[0] = z & 0xffff;
-			x[1] = z >> 16;
-			i = 1;
-			}
-		k += 32;
-		}
-	while(!x[i])
-		--i;
-	b->wds = i + 1;
-#endif
-#ifndef Sudden_Underflow
-	if (de) {
-#endif
-#ifdef IBM
-		*e = (de - Bias - (P-1) << 2) + k;
-		*bits = 4*P + 8 - k - hi0bits(word0(d) & Frac_mask);
-#else
-		*e = de - Bias - (P-1) + k;
-		*bits = P - k;
-#endif
-#ifndef Sudden_Underflow
-		}
-	else {
-		*e = de - Bias - (P-1) + 1 + k;
-#ifdef Pack_32
-		*bits = 32*i - hi0bits(x[i-1]);
-#else
-		*bits = (i+2)*16 - hi0bits(x[i]);
-#endif
-		}
-#endif
-	return b;
-	}
-#undef d0
-#undef d1
-
- static double
-ratio
-#ifdef KR_headers
-	(a, b) Bigint *a, *b;
-#else
-	(Bigint *a, Bigint *b)
-#endif
-{
-	double da, db;
-	int k, ka, kb;
-
-	da = b2d(a, &ka);
-	db = b2d(b, &kb);
-#ifdef Pack_32
-	k = ka - kb + 32*(a->wds - b->wds);
-#else
-	k = ka - kb + 16*(a->wds - b->wds);
-#endif
-#ifdef IBM
-	if (k > 0) {
-		word0(da) += (k >> 2)*Exp_msk1;
-		if (k &= 3)
-			da *= 1 << k;
-		}
-	else {
-		k = -k;
-		word0(db) += (k >> 2)*Exp_msk1;
-		if (k &= 3)
-			db *= 1 << k;
-		}
-#else
-	if (k > 0)
-		word0(da) += k*Exp_msk1;
-	else {
-		k = -k;
-		word0(db) += k*Exp_msk1;
-		}
-#endif
-	return da / db;
-	}
-
-static CONST double
-tens[] = {
-		1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9,
-		1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19,
-		1e20, 1e21, 1e22
-#ifdef VAX
-		, 1e23, 1e24
-#endif
-		};
-
-#ifdef IEEE_Arith
-static CONST double bigtens[] = { 1e16, 1e32, 1e64, 1e128, 1e256 };
-static CONST double tinytens[] = { 1e-16, 1e-32, 1e-64, 1e-128, 1e-256 };
-#define n_bigtens 5
-#else
-#ifdef IBM
-static CONST double bigtens[] = { 1e16, 1e32, 1e64 };
-static CONST double tinytens[] = { 1e-16, 1e-32, 1e-64 };
-#define n_bigtens 3
-#else
-static CONST double bigtens[] = { 1e16, 1e32 };
-static CONST double tinytens[] = { 1e-16, 1e-32 };
-#define n_bigtens 2
-#endif
-#endif
-
- double
-strtod
-#ifdef KR_headers
-	(s00, se) CONST char *s00; char **se;
-#else
-	(CONST char *s00, char **se)
-#endif
-{
-	int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign,
-		 e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign;
-	CONST char *s, *s0, *s1;
-	double aadj, aadj1, adj, rv, rv0;
-	Long L;
-	ULong y, z;
-	Bigint *bb, *bb1, *bd, *bd0, *bs, *delta;
-
-#ifndef KR_headers
-	CONST char decimal_point = localeconv()->decimal_point[0];
-#else
-	CONST char decimal_point = '.';
-#endif
-
-	sign = nz0 = nz = 0;
-	rv = 0.;
-
-
-	for(s = s00; isspace((unsigned char) *s); s++)
-		;
-
-	if (*s == '-') {
-		sign = 1;
-		s++;
-	} else if (*s == '+') {
-		s++;
-	}
-
-	if (*s == '\0') {
-		s = s00;
-		goto ret;
-	}
-
-	if (*s == '0') {
-		nz0 = 1;
-		while(*++s == '0') ;
-		if (!*s)
-			goto ret;
-		}
-	s0 = s;
-	y = z = 0;
-	for(nd = nf = 0; (c = *s) >= '0' && c <= '9'; nd++, s++)
-		if (nd < 9)
-			y = 10*y + c - '0';
-		else if (nd < 16)
-			z = 10*z + c - '0';
-	nd0 = nd;
-	if (c == decimal_point) {
-		c = *++s;
-		if (!nd) {
-			for(; c == '0'; c = *++s)
-				nz++;
-			if (c > '0' && c <= '9') {
-				s0 = s;
-				nf += nz;
-				nz = 0;
-				goto have_dig;
-				}
-			goto dig_done;
-			}
-		for(; c >= '0' && c <= '9'; c = *++s) {
- have_dig:
-			nz++;
-			if (c -= '0') {
-				nf += nz;
-				for(i = 1; i < nz; i++)
-					if (nd++ < 9)
-						y *= 10;
-					else if (nd <= DBL_DIG + 1)
-						z *= 10;
-				if (nd++ < 9)
-					y = 10*y + c;
-				else if (nd <= DBL_DIG + 1)
-					z = 10*z + c;
-				nz = 0;
-				}
-			}
-		}
- dig_done:
-	e = 0;
-	if (c == 'e' || c == 'E') {
-		if (!nd && !nz && !nz0) {
-			s = s00;
-			goto ret;
-			}
-		s00 = s;
-		esign = 0;
-		switch(c = *++s) {
-			case '-':
-				esign = 1;
-			case '+':
-				c = *++s;
-			}
-		if (c >= '0' && c <= '9') {
-			while(c == '0')
-				c = *++s;
-			if (c > '0' && c <= '9') {
-				L = c - '0';
-				s1 = s;
-				while((c = *++s) >= '0' && c <= '9')
-					L = 10*L + c - '0';
-				if (s - s1 > 8 || L > 19999)
-					/* Avoid confusion from exponents
-					 * so large that e might overflow.
-					 */
-					e = 19999; /* safe for 16 bit ints */
-				else
-					e = (int)L;
-				if (esign)
-					e = -e;
-				}
-			else
-				e = 0;
-			}
-		else
-			s = s00;
-		}
-	if (!nd) {
-		if (!nz && !nz0)
-			s = s00;
-		goto ret;
-		}
-	e1 = e -= nf;
-
-	/* Now we have nd0 digits, starting at s0, followed by a
-	 * decimal point, followed by nd-nd0 digits.  The number we're
-	 * after is the integer represented by those digits times
-	 * 10**e */
-
-	if (!nd0)
-		nd0 = nd;
-	k = nd < DBL_DIG + 1 ? nd : DBL_DIG + 1;
-	rv = y;
-	if (k > 9)
-		rv = tens[k - 9] * rv + z;
-	bd0 = 0;
-	if (nd <= DBL_DIG
-#ifndef RND_PRODQUOT
-		&& FLT_ROUNDS == 1
-#endif
-			) {
-		if (!e)
-			goto ret;
-		if (e > 0) {
-			if (e <= Ten_pmax) {
-#ifdef VAX
-				goto vax_ovfl_check;
-#else
-				/* rv = */ rounded_product(rv, tens[e]);
-				goto ret;
-#endif
-				}
-			i = DBL_DIG - nd;
-			if (e <= Ten_pmax + i) {
-				/* A fancier test would sometimes let us do
-				 * this for larger i values.
-				 */
-				e -= i;
-				rv *= tens[i];
-#ifdef VAX
-				/* VAX exponent range is so narrow we must
-				 * worry about overflow here...
-				 */
- vax_ovfl_check:
-				word0(rv) -= P*Exp_msk1;
-				/* rv = */ rounded_product(rv, tens[e]);
-				if ((word0(rv) & Exp_mask)
-				 > Exp_msk1*(DBL_MAX_EXP+Bias-1-P))
-					goto ovfl;
-				word0(rv) += P*Exp_msk1;
-#else
-				/* rv = */ rounded_product(rv, tens[e]);
-#endif
-				goto ret;
-				}
-			}
-#ifndef Inaccurate_Divide
-		else if (e >= -Ten_pmax) {
-			/* rv = */ rounded_quotient(rv, tens[-e]);
-			goto ret;
-			}
-#endif
-		}
-	e1 += nd - k;
-
-	/* Get starting approximation = rv * 10**e1 */
-
-	if (e1 > 0) {
-		if (i = e1 & 15)
-			rv *= tens[i];
-		if (e1 &= ~15) {
-			if (e1 > DBL_MAX_10_EXP) {
- ovfl:
-				errno = ERANGE;
-#ifdef __STDC__
-				rv = HUGE_VAL;
-#else
-				/* Can't trust HUGE_VAL */
-#ifdef IEEE_Arith
-				word0(rv) = Exp_mask;
-				word1(rv) = 0;
-#else
-				word0(rv) = Big0;
-				word1(rv) = Big1;
-#endif
-#endif
-				if (bd0)
-					goto retfree;
-				goto ret;
-				}
-			if (e1 >>= 4) {
-				for(j = 0; e1 > 1; j++, e1 >>= 1)
-					if (e1 & 1)
-						rv *= bigtens[j];
-			/* The last multiplication could overflow. */
-				word0(rv) -= P*Exp_msk1;
-				rv *= bigtens[j];
-				if ((z = word0(rv) & Exp_mask)
-				 > Exp_msk1*(DBL_MAX_EXP+Bias-P))
-					goto ovfl;
-				if (z > Exp_msk1*(DBL_MAX_EXP+Bias-1-P)) {
-					/* set to largest number */
-					/* (Can't trust DBL_MAX) */
-					word0(rv) = Big0;
-					word1(rv) = Big1;
-					}
-				else
-					word0(rv) += P*Exp_msk1;
-				}
-
-			}
-		}
-	else if (e1 < 0) {
-		e1 = -e1;
-		if (i = e1 & 15)
-			rv /= tens[i];
-		if (e1 &= ~15) {
-			e1 >>= 4;
-			if (e1 >= 1 << n_bigtens)
-				goto undfl;
-			for(j = 0; e1 > 1; j++, e1 >>= 1)
-				if (e1 & 1)
-					rv *= tinytens[j];
-			/* The last multiplication could underflow. */
-			rv0 = rv;
-			rv *= tinytens[j];
-			if (!rv) {
-				rv = 2.*rv0;
-				rv *= tinytens[j];
-				if (!rv) {
- undfl:
-					rv = 0.;
-					errno = ERANGE;
-					if (bd0)
-						goto retfree;
-					goto ret;
-					}
-				word0(rv) = Tiny0;
-				word1(rv) = Tiny1;
-				/* The refinement below will clean
-				 * this approximation up.
-				 */
-				}
-			}
-		}
-
-	/* Now the hard part -- adjusting rv to the correct value.*/
-
-	/* Put digits into bd: true value = bd * 10^e */
-
-	bd0 = s2b(s0, nd0, nd, y);
-
-	for(;;) {
-		bd = Balloc(bd0->k);
-		Bcopy(bd, bd0);
-		bb = d2b(rv, &bbe, &bbbits);	/* rv = bb * 2^bbe */
-		bs = i2b(1);
-
-		if (e >= 0) {
-			bb2 = bb5 = 0;
-			bd2 = bd5 = e;
-			}
-		else {
-			bb2 = bb5 = -e;
-			bd2 = bd5 = 0;
-			}
-		if (bbe >= 0)
-			bb2 += bbe;
-		else
-			bd2 -= bbe;
-		bs2 = bb2;
-#ifdef Sudden_Underflow
-#ifdef IBM
-		j = 1 + 4*P - 3 - bbbits + ((bbe + bbbits - 1) & 3);
-#else
-		j = P + 1 - bbbits;
-#endif
-#else
-		i = bbe + bbbits - 1;	/* logb(rv) */
-		if (i < Emin)	/* denormal */
-			j = bbe + (P-Emin);
-		else
-			j = P + 1 - bbbits;
-#endif
-		bb2 += j;
-		bd2 += j;
-		i = bb2 < bd2 ? bb2 : bd2;
-		if (i > bs2)
-			i = bs2;
-		if (i > 0) {
-			bb2 -= i;
-			bd2 -= i;
-			bs2 -= i;
-			}
-		if (bb5 > 0) {
-			bs = pow5mult(bs, bb5);
-			bb1 = mult(bs, bb);
-			Bfree(bb);
-			bb = bb1;
-			}
-		if (bb2 > 0)
-			bb = lshift(bb, bb2);
-		if (bd5 > 0)
-			bd = pow5mult(bd, bd5);
-		if (bd2 > 0)
-			bd = lshift(bd, bd2);
-		if (bs2 > 0)
-			bs = lshift(bs, bs2);
-		delta = diff(bb, bd);
-		dsign = delta->sign;
-		delta->sign = 0;
-		i = cmp(delta, bs);
-		if (i < 0) {
-			/* Error is less than half an ulp -- check for
-			 * special case of mantissa a power of two.
-			 */
-			if (dsign || word1(rv) || word0(rv) & Bndry_mask)
-				break;
-			delta = lshift(delta,Log2P);
-			if (cmp(delta, bs) > 0)
-				goto drop_down;
-			break;
-			}
-		if (i == 0) {
-			/* exactly half-way between */
-			if (dsign) {
-				if ((word0(rv) & Bndry_mask1) == Bndry_mask1
-				 &&  word1(rv) == 0xffffffff) {
-					/*boundary case -- increment exponent*/
-					word0(rv) = (word0(rv) & Exp_mask)
-						+ Exp_msk1
-#ifdef IBM
-						| Exp_msk1 >> 4
-#endif
-						;
-					word1(rv) = 0;
-					break;
-					}
-				}
-			else if (!(word0(rv) & Bndry_mask) && !word1(rv)) {
- drop_down:
-				/* boundary case -- decrement exponent */
-#ifdef Sudden_Underflow
-				L = word0(rv) & Exp_mask;
-#ifdef IBM
-				if (L <  Exp_msk1)
-#else
-				if (L <= Exp_msk1)
-#endif
-					goto undfl;
-				L -= Exp_msk1;
-#else
-				L = (word0(rv) & Exp_mask) - Exp_msk1;
-#endif
-				word0(rv) = L | Bndry_mask1;
-				word1(rv) = 0xffffffff;
-#ifdef IBM
-				goto cont;
-#else
-				break;
-#endif
-				}
-#ifndef ROUND_BIASED
-			if (!(word1(rv) & LSB))
-				break;
-#endif
-			if (dsign)
-				rv += ulp(rv);
-#ifndef ROUND_BIASED
-			else {
-				rv -= ulp(rv);
-#ifndef Sudden_Underflow
-				if (!rv)
-					goto undfl;
-#endif
-				}
-#endif
-			break;
-			}
-		if ((aadj = ratio(delta, bs)) <= 2.) {
-			if (dsign)
-				aadj = aadj1 = 1.;
-			else if (word1(rv) || word0(rv) & Bndry_mask) {
-#ifndef Sudden_Underflow
-				if (word1(rv) == Tiny1 && !word0(rv))
-					goto undfl;
-#endif
-				aadj = 1.;
-				aadj1 = -1.;
-				}
-			else {
-				/* special case -- power of FLT_RADIX to be */
-				/* rounded down... */
-
-				if (aadj < 2./FLT_RADIX)
-					aadj = 1./FLT_RADIX;
-				else
-					aadj *= 0.5;
-				aadj1 = -aadj;
-				}
-			}
-		else {
-			aadj *= 0.5;
-			aadj1 = dsign ? aadj : -aadj;
-#ifdef Check_FLT_ROUNDS
-			switch(FLT_ROUNDS) {
-				case 2: /* towards +infinity */
-					aadj1 -= 0.5;
-					break;
-				case 0: /* towards 0 */
-				case 3: /* towards -infinity */
-					aadj1 += 0.5;
-				}
-#else
-			if (FLT_ROUNDS == 0)
-				aadj1 += 0.5;
-#endif
-			}
-		y = word0(rv) & Exp_mask;
-
-		/* Check for overflow */
-
-		if (y == Exp_msk1*(DBL_MAX_EXP+Bias-1)) {
-			rv0 = rv;
-			word0(rv) -= P*Exp_msk1;
-			adj = aadj1 * ulp(rv);
-			rv += adj;
-			if ((word0(rv) & Exp_mask) >=
-					Exp_msk1*(DBL_MAX_EXP+Bias-P)) {
-				if (word0(rv0) == Big0 && word1(rv0) == Big1)
-					goto ovfl;
-				word0(rv) = Big0;
-				word1(rv) = Big1;
-				goto cont;
-				}
-			else
-				word0(rv) += P*Exp_msk1;
-			}
-		else {
-#ifdef Sudden_Underflow
-			if ((word0(rv) & Exp_mask) <= P*Exp_msk1) {
-				rv0 = rv;
-				word0(rv) += P*Exp_msk1;
-				adj = aadj1 * ulp(rv);
-				rv += adj;
-#ifdef IBM
-				if ((word0(rv) & Exp_mask) <  P*Exp_msk1)
-#else
-				if ((word0(rv) & Exp_mask) <= P*Exp_msk1)
-#endif
-					{
-					if (word0(rv0) == Tiny0
-					 && word1(rv0) == Tiny1)
-						goto undfl;
-					word0(rv) = Tiny0;
-					word1(rv) = Tiny1;
-					goto cont;
-					}
-				else
-					word0(rv) -= P*Exp_msk1;
-				}
-			else {
-				adj = aadj1 * ulp(rv);
-				rv += adj;
-				}
-#else
-			/* Compute adj so that the IEEE rounding rules will
-			 * correctly round rv + adj in some half-way cases.
-			 * If rv * ulp(rv) is denormalized (i.e.,
-			 * y <= (P-1)*Exp_msk1), we must adjust aadj to avoid
-			 * trouble from bits lost to denormalization;
-			 * example: 1.2e-307 .
-			 */
-			if (y <= (P-1)*Exp_msk1 && aadj >= 1.) {
-				aadj1 = (double)(int)(aadj + 0.5);
-				if (!dsign)
-					aadj1 = -aadj1;
-				}
-			adj = aadj1 * ulp(rv);
-			rv += adj;
-#endif
-			}
-		z = word0(rv) & Exp_mask;
-		if (y == z) {
-			/* Can we stop now? */
-			L = aadj;
-			aadj -= L;
-			/* The tolerances below are conservative. */
-			if (dsign || word1(rv) || word0(rv) & Bndry_mask) {
-				if (aadj < .4999999 || aadj > .5000001)
-					break;
-				}
-			else if (aadj < .4999999/FLT_RADIX)
-				break;
-			}
- cont:
-		Bfree(bb);
-		Bfree(bd);
-		Bfree(bs);
-		Bfree(delta);
-		}
- retfree:
-	Bfree(bb);
-	Bfree(bd);
-	Bfree(bs);
-	Bfree(bd0);
-	Bfree(delta);
- ret:
-	if (se)
-		*se = (char *)s;
-	return sign ? -rv : rv;
-}
-
- static int
-quorem
-#ifdef KR_headers
-	(b, S) Bigint *b, *S;
-#else
-	(Bigint *b, Bigint *S)
-#endif
-{
-	int n;
-	Long borrow, y;
-	ULong carry, q, ys;
-	ULong *bx, *bxe, *sx, *sxe;
-#ifdef Pack_32
-	Long z;
-	ULong si, zs;
-#endif
-
-	n = S->wds;
-#ifdef DEBUG
-	/*debug*/ if (b->wds > n)
-	/*debug*/	Bug("oversize b in quorem");
-#endif
-	if (b->wds < n)
-		return 0;
-	sx = S->x;
-	sxe = sx + --n;
-	bx = b->x;
-	bxe = bx + n;
-	q = *bxe / (*sxe + 1);	/* ensure q <= true quotient */
-#ifdef DEBUG
-	/*debug*/ if (q > 9)
-	/*debug*/	Bug("oversized quotient in quorem");
-#endif
-	if (q) {
-		borrow = 0;
-		carry = 0;
-		do {
-#ifdef Pack_32
-			si = *sx++;
-			ys = (si & 0xffff) * q + carry;
-			zs = (si >> 16) * q + (ys >> 16);
-			carry = zs >> 16;
-			y = (*bx & 0xffff) - (ys & 0xffff) + borrow;
-			borrow = y >> 16;
-			Sign_Extend(borrow, y);
-			z = (*bx >> 16) - (zs & 0xffff) + borrow;
-			borrow = z >> 16;
-			Sign_Extend(borrow, z);
-			Storeinc(bx, z, y);
-#else
-			ys = *sx++ * q + carry;
-			carry = ys >> 16;
-			y = *bx - (ys & 0xffff) + borrow;
-			borrow = y >> 16;
-			Sign_Extend(borrow, y);
-			*bx++ = y & 0xffff;
-#endif
-			}
-			while(sx <= sxe);
-		if (!*bxe) {
-			bx = b->x;
-			while(--bxe > bx && !*bxe)
-				--n;
-			b->wds = n;
-			}
-		}
-	if (cmp(b, S) >= 0) {
-		q++;
-		borrow = 0;
-		carry = 0;
-		bx = b->x;
-		sx = S->x;
-		do {
-#ifdef Pack_32
-			si = *sx++;
-			ys = (si & 0xffff) + carry;
-			zs = (si >> 16) + (ys >> 16);
-			carry = zs >> 16;
-			y = (*bx & 0xffff) - (ys & 0xffff) + borrow;
-			borrow = y >> 16;
-			Sign_Extend(borrow, y);
-			z = (*bx >> 16) - (zs & 0xffff) + borrow;
-			borrow = z >> 16;
-			Sign_Extend(borrow, z);
-			Storeinc(bx, z, y);
-#else
-			ys = *sx++ + carry;
-			carry = ys >> 16;
-			y = *bx - (ys & 0xffff) + borrow;
-			borrow = y >> 16;
-			Sign_Extend(borrow, y);
-			*bx++ = y & 0xffff;
-#endif
-			}
-			while(sx <= sxe);
-		bx = b->x;
-		bxe = bx + n;
-		if (!*bxe) {
-			while(--bxe > bx && !*bxe)
-				--n;
-			b->wds = n;
-			}
-		}
-	return q;
-}
-
-/* dtoa for IEEE arithmetic (dmg): convert double to ASCII string.
- *
- * Inspired by "How to Print Floating-Point Numbers Accurately" by
- * Guy L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90, pp. 92-101].
- *
- * Modifications:
- *	1. Rather than iterating, we use a simple numeric overestimate
- *	   to determine k = floor(log10(d)).  We scale relevant
- *	   quantities using O(log2(k)) rather than O(k) multiplications.
- *	2. For some modes > 2 (corresponding to ecvt and fcvt), we don't
- *	   try to generate digits strictly left to right.  Instead, we
- *	   compute with fewer bits and propagate the carry if necessary
- *	   when rounding the final digit up.  This is often faster.
- *	3. Under the assumption that input will be rounded nearest,
- *	   mode 0 renders 1e23 as 1e23 rather than 9.999999999999999e22.
- *	   That is, we allow equality in stopping tests when the
- *	   round-nearest rule will give the same floating-point value
- *	   as would satisfaction of the stopping test with strict
- *	   inequality.
- *	4. We remove common factors of powers of 2 from relevant
- *	   quantities.
- *	5. When converting floating-point integers less than 1e16,
- *	   we use floating-point arithmetic rather than resorting
- *	   to multiple-precision integers.
- *	6. When asked to produce fewer than 15 digits, we first try
- *	   to get by with floating-point arithmetic; we resort to
- *	   multiple-precision integer arithmetic only if we cannot
- *	   guarantee that the floating-point calculation has given
- *	   the correctly rounded result.  For k requested digits and
- *	   "uniformly" distributed input, the probability is
- *	   something like 10^(k-15) that we must resort to the Long
- *	   calculation.
- */
-
- char *
-__dtoa
-#ifdef KR_headers
-	(d, mode, ndigits, decpt, sign, rve)
-	double d; int mode, ndigits, *decpt, *sign; char **rve;
-#else
-	(double d, int mode, int ndigits, int *decpt, int *sign, char **rve)
-#endif
-{
- /*	Arguments ndigits, decpt, sign are similar to those
-	of ecvt and fcvt; trailing zeros are suppressed from
-	the returned string.  If not null, *rve is set to point
-	to the end of the return value.  If d is +-Infinity or NaN,
-	then *decpt is set to 9999.
-
-	mode:
-		0 ==> shortest string that yields d when read in
-			and rounded to nearest.
-		1 ==> like 0, but with Steele & White stopping rule;
-			e.g. with IEEE P754 arithmetic , mode 0 gives
-			1e23 whereas mode 1 gives 9.999999999999999e22.
-		2 ==> max(1,ndigits) significant digits.  This gives a
-			return value similar to that of ecvt, except
-			that trailing zeros are suppressed.
-		3 ==> through ndigits past the decimal point.  This
-			gives a return value similar to that from fcvt,
-			except that trailing zeros are suppressed, and
-			ndigits can be negative.
-		4-9 should give the same return values as 2-3, i.e.,
-			4 <= mode <= 9 ==> same return as mode
-			2 + (mode & 1).  These modes are mainly for
-			debugging; often they run slower but sometimes
-			faster than modes 2-3.
-		4,5,8,9 ==> left-to-right digit generation.
-		6-9 ==> don't try fast floating-point estimate
-			(if applicable).
-
-		Values of mode other than 0-9 are treated as mode 0.
-
-		Sufficient space is allocated to the return value
-		to hold the suppressed trailing zeros.
-	*/
-
-	int bbits, b2, b5, be, dig, i, ieps, ilim, ilim0, ilim1,
-		j, j1, k, k0, k_check, leftright, m2, m5, s2, s5,
-		spec_case, try_quick;
-	Long L;
-#ifndef Sudden_Underflow
-	int denorm;
-	ULong x;
-#endif
-	Bigint *b, *b1, *delta, *mlo, *mhi, *S;
-	double d2, ds, eps;
-	char *s, *s0;
-	static Bigint *result;
-	static int result_k;
-
-	if (result) {
-		result->k = result_k;
-		result->maxwds = 1 << result_k;
-		Bfree(result);
-		result = 0;
-		}
-
-	if (word0(d) & Sign_bit) {
-		/* set sign for everything, including 0's and NaNs */
-		*sign = 1;
-		word0(d) &= ~Sign_bit;	/* clear sign bit */
-		}
-	else
-		*sign = 0;
-
-#if defined(IEEE_Arith) + defined(VAX)
-#ifdef IEEE_Arith
-	if ((word0(d) & Exp_mask) == Exp_mask)
-#else
-	if (word0(d)  == 0x8000)
-#endif
-		{
-		/* Infinity or NaN */
-		*decpt = 9999;
-		s =
-#ifdef IEEE_Arith
-			!word1(d) && !(word0(d) & 0xfffff) ? "Infinity" :
-#endif
-				"NaN";
-		if (rve)
-			*rve =
-#ifdef IEEE_Arith
-				s[3] ? s + 8 :
-#endif
-						s + 3;
-		return s;
-		}
-#endif
-#ifdef IBM
-	d += 0; /* normalize */
-#endif
-	if (!d) {
-		*decpt = 1;
-		s = "0";
-		if (rve)
-			*rve = s + 1;
-		return s;
-		}
-
-	b = d2b(d, &be, &bbits);
-#ifdef Sudden_Underflow
-	i = (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1));
-#else
-	if (i = (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1))) {
-#endif
-		d2 = d;
-		word0(d2) &= Frac_mask1;
-		word0(d2) |= Exp_11;
-#ifdef IBM
-		if (j = 11 - hi0bits(word0(d2) & Frac_mask))
-			d2 /= 1 << j;
-#endif
-
-		/* log(x)	~=~ log(1.5) + (x-1.5)/1.5
-		 * log10(x)	 =  log(x) / log(10)
-		 *		~=~ log(1.5)/log(10) + (x-1.5)/(1.5*log(10))
-		 * log10(d) = (i-Bias)*log(2)/log(10) + log10(d2)
-		 *
-		 * This suggests computing an approximation k to log10(d) by
-		 *
-		 * k = (i - Bias)*0.301029995663981
-		 *	+ ( (d2-1.5)*0.289529654602168 + 0.176091259055681 );
-		 *
-		 * We want k to be too large rather than too small.
-		 * The error in the first-order Taylor series approximation
-		 * is in our favor, so we just round up the constant enough
-		 * to compensate for any error in the multiplication of
-		 * (i - Bias) by 0.301029995663981; since |i - Bias| <= 1077,
-		 * and 1077 * 0.30103 * 2^-52 ~=~ 7.2e-14,
-		 * adding 1e-13 to the constant term more than suffices.
-		 * Hence we adjust the constant term to 0.1760912590558.
-		 * (We could get a more accurate k by invoking log10,
-		 *  but this is probably not worthwhile.)
-		 */
-
-		i -= Bias;
-#ifdef IBM
-		i <<= 2;
-		i += j;
-#endif
-#ifndef Sudden_Underflow
-		denorm = 0;
-		}
-	else {
-		/* d is denormalized */
-
-		i = bbits + be + (Bias + (P-1) - 1);
-		x = i > 32  ? word0(d) << 64 - i | word1(d) >> i - 32
-			    : word1(d) << 32 - i;
-		d2 = x;
-		word0(d2) -= 31*Exp_msk1; /* adjust exponent */
-		i -= (Bias + (P-1) - 1) + 1;
-		denorm = 1;
-		}
-#endif
-	ds = (d2-1.5)*0.289529654602168 + 0.1760912590558 + i*0.301029995663981;
-	k = (int)ds;
-	if (ds < 0. && ds != k)
-		k--;	/* want k = floor(ds) */
-	k_check = 1;
-	if (k >= 0 && k <= Ten_pmax) {
-		if (d < tens[k])
-			k--;
-		k_check = 0;
-		}
-	j = bbits - i - 1;
-	if (j >= 0) {
-		b2 = 0;
-		s2 = j;
-		}
-	else {
-		b2 = -j;
-		s2 = 0;
-		}
-	if (k >= 0) {
-		b5 = 0;
-		s5 = k;
-		s2 += k;
-		}
-	else {
-		b2 -= k;
-		b5 = -k;
-		s5 = 0;
-		}
-	if (mode < 0 || mode > 9)
-		mode = 0;
-	try_quick = 1;
-	if (mode > 5) {
-		mode -= 4;
-		try_quick = 0;
-		}
-	leftright = 1;
-	switch(mode) {
-		case 0:
-		case 1:
-			ilim = ilim1 = -1;
-			i = 18;
-			ndigits = 0;
-			break;
-		case 2:
-			leftright = 0;
-			/* no break */
-		case 4:
-			if (ndigits <= 0)
-				ndigits = 1;
-			ilim = ilim1 = i = ndigits;
-			break;
-		case 3:
-			leftright = 0;
-			/* no break */
-		case 5:
-			i = ndigits + k + 1;
-			ilim = i;
-			ilim1 = i - 1;
-			if (i <= 0)
-				i = 1;
-		}
-	j = sizeof(ULong);
-	for(result_k = 0; sizeof(Bigint) - sizeof(ULong) + j <= i;
-		j <<= 1) result_k++;
-	result = Balloc(result_k);
-	s = s0 = (char *)result;
-
-	if (ilim >= 0 && ilim <= Quick_max && try_quick) {
-
-		/* Try to get by with floating-point arithmetic. */
-
-		i = 0;
-		d2 = d;
-		k0 = k;
-		ilim0 = ilim;
-		ieps = 2; /* conservative */
-		if (k > 0) {
-			ds = tens[k&0xf];
-			j = k >> 4;
-			if (j & Bletch) {
-				/* prevent overflows */
-				j &= Bletch - 1;
-				d /= bigtens[n_bigtens-1];
-				ieps++;
-				}
-			for(; j; j >>= 1, i++)
-				if (j & 1) {
-					ieps++;
-					ds *= bigtens[i];
-					}
-			d /= ds;
-			}
-		else if (j1 = -k) {
-			d *= tens[j1 & 0xf];
-			for(j = j1 >> 4; j; j >>= 1, i++)
-				if (j & 1) {
-					ieps++;
-					d *= bigtens[i];
-					}
-			}
-		if (k_check && d < 1. && ilim > 0) {
-			if (ilim1 <= 0)
-				goto fast_failed;
-			ilim = ilim1;
-			k--;
-			d *= 10.;
-			ieps++;
-			}
-		eps = ieps*d + 7.;
-		word0(eps) -= (P-1)*Exp_msk1;
-		if (ilim == 0) {
-			S = mhi = 0;
-			d -= 5.;
-			if (d > eps)
-				goto one_digit;
-			if (d < -eps)
-				goto no_digits;
-			goto fast_failed;
-			}
-#ifndef No_leftright
-		if (leftright) {
-			/* Use Steele & White method of only
-			 * generating digits needed.
-			 */
-			eps = 0.5/tens[ilim-1] - eps;
-			for(i = 0;;) {
-				L = d;
-				d -= L;
-				*s++ = '0' + (int)L;
-				if (d < eps)
-					goto ret1;
-				if (1. - d < eps)
-					goto bump_up;
-				if (++i >= ilim)
-					break;
-				eps *= 10.;
-				d *= 10.;
-				}
-			}
-		else {
-#endif
-			/* Generate ilim digits, then fix them up. */
-			eps *= tens[ilim-1];
-			for(i = 1;; i++, d *= 10.) {
-				L = d;
-				d -= L;
-				*s++ = '0' + (int)L;
-				if (i == ilim) {
-					if (d > 0.5 + eps)
-						goto bump_up;
-					else if (d < 0.5 - eps) {
-						while(*--s == '0');
-						s++;
-						goto ret1;
-						}
-					break;
-					}
-				}
-#ifndef No_leftright
-			}
-#endif
- fast_failed:
-		s = s0;
-		d = d2;
-		k = k0;
-		ilim = ilim0;
-		}
-
-	/* Do we have a "small" integer? */
-
-	if (be >= 0 && k <= Int_max) {
-		/* Yes. */
-		ds = tens[k];
-		if (ndigits < 0 && ilim <= 0) {
-			S = mhi = 0;
-			if (ilim < 0 || d <= 5*ds)
-				goto no_digits;
-			goto one_digit;
-			}
-		for(i = 1;; i++) {
-			L = d / ds;
-			d -= L*ds;
-#ifdef Check_FLT_ROUNDS
-			/* If FLT_ROUNDS == 2, L will usually be high by 1 */
-			if (d < 0) {
-				L--;
-				d += ds;
-				}
-#endif
-			*s++ = '0' + (int)L;
-			if (i == ilim) {
-				d += d;
-				if (d > ds || d == ds && L & 1) {
- bump_up:
-					while(*--s == '9')
-						if (s == s0) {
-							k++;
-							*s = '0';
-							break;
-							}
-					++*s++;
-					}
-				break;
-				}
-			if (!(d *= 10.))
-				break;
-			}
-		goto ret1;
-		}
-
-	m2 = b2;
-	m5 = b5;
-	mhi = mlo = 0;
-	if (leftright) {
-		if (mode < 2) {
-			i =
-#ifndef Sudden_Underflow
-				denorm ? be + (Bias + (P-1) - 1 + 1) :
-#endif
-#ifdef IBM
-				1 + 4*P - 3 - bbits + ((bbits + be - 1) & 3);
-#else
-				1 + P - bbits;
-#endif
-			}
-		else {
-			j = ilim - 1;
-			if (m5 >= j)
-				m5 -= j;
-			else {
-				s5 += j -= m5;
-				b5 += j;
-				m5 = 0;
-				}
-			if ((i = ilim) < 0) {
-				m2 -= i;
-				i = 0;
-				}
-			}
-		b2 += i;
-		s2 += i;
-		mhi = i2b(1);
-		}
-	if (m2 > 0 && s2 > 0) {
-		i = m2 < s2 ? m2 : s2;
-		b2 -= i;
-		m2 -= i;
-		s2 -= i;
-		}
-	if (b5 > 0) {
-		if (leftright) {
-			if (m5 > 0) {
-				mhi = pow5mult(mhi, m5);
-				b1 = mult(mhi, b);
-				Bfree(b);
-				b = b1;
-				}
-			if (j = b5 - m5)
-				b = pow5mult(b, j);
-			}
-		else
-			b = pow5mult(b, b5);
-		}
-	S = i2b(1);
-	if (s5 > 0)
-		S = pow5mult(S, s5);
-
-	/* Check for special case that d is a normalized power of 2. */
-
-	if (mode < 2) {
-		if (!word1(d) && !(word0(d) & Bndry_mask)
-#ifndef Sudden_Underflow
-		 && word0(d) & Exp_mask
-#endif
-				) {
-			/* The special case */
-			b2 += Log2P;
-			s2 += Log2P;
-			spec_case = 1;
-			}
-		else
-			spec_case = 0;
-		}
-
-	/* Arrange for convenient computation of quotients:
-	 * shift left if necessary so divisor has 4 leading 0 bits.
-	 *
-	 * Perhaps we should just compute leading 28 bits of S once
-	 * and for all and pass them and a shift to quorem, so it
-	 * can do shifts and ors to compute the numerator for q.
-	 */
-#ifdef Pack_32
-	if (i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0x1f)
-		i = 32 - i;
-#else
-	if (i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0xf)
-		i = 16 - i;
-#endif
-	if (i > 4) {
-		i -= 4;
-		b2 += i;
-		m2 += i;
-		s2 += i;
-		}
-	else if (i < 4) {
-		i += 28;
-		b2 += i;
-		m2 += i;
-		s2 += i;
-		}
-	if (b2 > 0)
-		b = lshift(b, b2);
-	if (s2 > 0)
-		S = lshift(S, s2);
-	if (k_check) {
-		if (cmp(b,S) < 0) {
-			k--;
-			b = multadd(b, 10, 0);	/* we botched the k estimate */
-			if (leftright)
-				mhi = multadd(mhi, 10, 0);
-			ilim = ilim1;
-			}
-		}
-	if (ilim <= 0 && mode > 2) {
-		if (ilim < 0 || cmp(b,S = multadd(S,5,0)) <= 0) {
-			/* no digits, fcvt style */
- no_digits:
-			k = -1 - ndigits;
-			goto ret;
-			}
- one_digit:
-		*s++ = '1';
-		k++;
-		goto ret;
-		}
-	if (leftright) {
-		if (m2 > 0)
-			mhi = lshift(mhi, m2);
-
-		/* Compute mlo -- check for special case
-		 * that d is a normalized power of 2.
-		 */
-
-		mlo = mhi;
-		if (spec_case) {
-			mhi = Balloc(mhi->k);
-			Bcopy(mhi, mlo);
-			mhi = lshift(mhi, Log2P);
-			}
-
-		for(i = 1;;i++) {
-			dig = quorem(b,S) + '0';
-			/* Do we yet have the shortest decimal string
-			 * that will round to d?
-			 */
-			j = cmp(b, mlo);
-			delta = diff(S, mhi);
-			j1 = delta->sign ? 1 : cmp(b, delta);
-			Bfree(delta);
-#ifndef ROUND_BIASED
-			if (j1 == 0 && !mode && !(word1(d) & 1)) {
-				if (dig == '9')
-					goto round_9_up;
-				if (j > 0)
-					dig++;
-				*s++ = dig;
-				goto ret;
-				}
-#endif
-			if (j < 0 || j == 0 && !mode
-#ifndef ROUND_BIASED
-							&& !(word1(d) & 1)
-#endif
-					) {
-				if (j1 > 0) {
-					b = lshift(b, 1);
-					j1 = cmp(b, S);
-					if ((j1 > 0 || j1 == 0 && dig & 1)
-					&& dig++ == '9')
-						goto round_9_up;
-					}
-				*s++ = dig;
-				goto ret;
-				}
-			if (j1 > 0) {
-				if (dig == '9') { /* possible if i == 1 */
- round_9_up:
-					*s++ = '9';
-					goto roundoff;
-					}
-				*s++ = dig + 1;
-				goto ret;
-				}
-			*s++ = dig;
-			if (i == ilim)
-				break;
-			b = multadd(b, 10, 0);
-			if (mlo == mhi)
-				mlo = mhi = multadd(mhi, 10, 0);
-			else {
-				mlo = multadd(mlo, 10, 0);
-				mhi = multadd(mhi, 10, 0);
-				}
-			}
-		}
-	else
-		for(i = 1;; i++) {
-			*s++ = dig = quorem(b,S) + '0';
-			if (i >= ilim)
-				break;
-			b = multadd(b, 10, 0);
-			}
-
-	/* Round off last digit */
-
-	b = lshift(b, 1);
-	j = cmp(b, S);
-	if (j > 0 || j == 0 && dig & 1) {
- roundoff:
-		while(*--s == '9')
-			if (s == s0) {
-				k++;
-				*s++ = '1';
-				goto ret;
-				}
-		++*s++;
-		}
-	else {
-		while(*--s == '0');
-		s++;
-		}
- ret:
-	Bfree(S);
-	if (mhi) {
-		if (mlo && mlo != mhi)
-			Bfree(mlo);
-		Bfree(mhi);
-		}
- ret1:
-	Bfree(b);
-	if (s == s0) {				/* don't return empty string */
-		*s++ = '0';
-		k = 0;
-	}
-	*s = 0;
-	*decpt = k + 1;
-	if (rve)
-		*rve = s;
-	return s0;
-	}
-#ifdef __cplusplus
-}
-#endif

Modified: cdrkit/trunk/libusal/scsi-aix.c
===================================================================
--- cdrkit/trunk/libusal/scsi-aix.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libusal/scsi-aix.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -120,7 +120,7 @@
 	if (busno >= MAX_SCG || tgt >= MAX_TGT || tlun >= MAX_LUN) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Illegal value for busno, target or lun '%d,%d,%d'",
 				busno, tgt, tlun);
 		return (-1);
@@ -144,11 +144,11 @@
 
 	if (busno >= 0 && tgt >= 0 && tlun >= 0) {
 
-		js_snprintf(devname, sizeof (devname), "/dev/rcd%d", tgt);
+		snprintf(devname, sizeof (devname), "/dev/rcd%d", tgt);
 		f = openx(devname, 0, 0, SC_DIAGNOSTIC);
 		if (f < 0) {
 			if (usalp->errstr)
-				js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+				snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 					"Cannot open '%s'. Specify device number (1 for cd1) as target (1,0)",
 					devname);
 			return (0);
@@ -157,7 +157,7 @@
 		return (1);
 	} else {
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Unable to scan on AIX");
 		return (0);
 	}
@@ -166,7 +166,7 @@
 		f = openx(device, 0, 0, SC_DIAGNOSTIC);
 		if (f < 0) {
 			if (usalp->errstr)
-				js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+				snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 					"Cannot open '%s'",
 					devname);
 			return (0);
@@ -225,7 +225,7 @@
 #endif
 
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 				"usalo_getbuf: %ld bytes\n", amt);
 	}
 	/*
@@ -334,16 +334,16 @@
 	ret = ioctl(usalp->fd, DKIOCMD, &req);
 
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile, "ret: %d errno: %d (%s)\n", ret, errno, errmsgstr(errno));
-		js_fprintf((FILE *)usalp->errfile, "data_length:     %d\n", req.data_length);
-		js_fprintf((FILE *)usalp->errfile, "buffer:          0x%X\n", req.buffer);
-		js_fprintf((FILE *)usalp->errfile, "timeout_value:   %d\n", req.timeout_value);
-		js_fprintf((FILE *)usalp->errfile, "status_validity: %d\n", req.status_validity);
-		js_fprintf((FILE *)usalp->errfile, "scsi_bus_status: 0x%X\n", req.scsi_bus_status);
-		js_fprintf((FILE *)usalp->errfile, "adapter_status:  0x%X\n", req.adapter_status);
-		js_fprintf((FILE *)usalp->errfile, "adap_q_status:   0x%X\n", req.adap_q_status);
-		js_fprintf((FILE *)usalp->errfile, "q_tag_msg:       0x%X\n", req.q_tag_msg);
-		js_fprintf((FILE *)usalp->errfile, "flags:           0X%X\n", req.flags);
+		fprintf((FILE *)usalp->errfile, "ret: %d errno: %d (%s)\n", ret, errno, errmsgstr(errno));
+		fprintf((FILE *)usalp->errfile, "data_length:     %d\n", req.data_length);
+		fprintf((FILE *)usalp->errfile, "buffer:          0x%X\n", req.buffer);
+		fprintf((FILE *)usalp->errfile, "timeout_value:   %d\n", req.timeout_value);
+		fprintf((FILE *)usalp->errfile, "status_validity: %d\n", req.status_validity);
+		fprintf((FILE *)usalp->errfile, "scsi_bus_status: 0x%X\n", req.scsi_bus_status);
+		fprintf((FILE *)usalp->errfile, "adapter_status:  0x%X\n", req.adapter_status);
+		fprintf((FILE *)usalp->errfile, "adap_q_status:   0x%X\n", req.adap_q_status);
+		fprintf((FILE *)usalp->errfile, "q_tag_msg:       0x%X\n", req.q_tag_msg);
+		fprintf((FILE *)usalp->errfile, "flags:           0X%X\n", req.flags);
 	}
 	if (ret < 0) {
 		sp->ux_errno = geterrno();

Modified: cdrkit/trunk/libusal/scsi-amigaos.c
===================================================================
--- cdrkit/trunk/libusal/scsi-amigaos.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libusal/scsi-amigaos.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -163,7 +163,7 @@
 	if (busno >= MAX_SCG || tgt >= MAX_TGT || tlun >= MAX_LUN) {
 		errno = EINVAL;
 		if (usalp->errstr) {
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Illegal value for busno, target or lun '%d,%d,%d'",
 				busno, tgt, tlun);
 		}
@@ -186,7 +186,7 @@
 	if (device == NULL || *device == '\0') {
 
 		if (last_bus == -1) {
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"No scsi device found");
 			return (-1);
 		}
@@ -226,7 +226,7 @@
 					}
 				}
 			} else {
-				js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+				snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 					"Scsi device %s not found", device);
 			}
 		} else {
@@ -243,7 +243,7 @@
 					nopen++;
 				}
 			} else {
-				js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+				snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 					"Scsi device %s not found", device);
 			}
 		}
@@ -284,7 +284,7 @@
 usalo_getbuf(SCSI *usalp, long amt)
 {
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"usalo_getbuf: %ld bytes\n", amt);
 	}
 	usalp->bufbase = valloc((size_t)(amt));
@@ -619,7 +619,7 @@
 
 	if (dev == NULL) {
 		if (usalp->errstr) {
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"No scsi device found at bus %ld\n", bus);
 		}
 		return (-1);
@@ -639,7 +639,7 @@
 				printf("trying %s, unit %ld\n", dev, unit);
 			if (OpenDevice(dev, unit, (struct IORequest *)request[fd].ioReq, 0L)) {
 				if (usalp->errstr) {
-					js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+					snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 						"Cannot open %s\n",	dev);
 				}
 				if (request[fd].ref_count == 0) {
@@ -654,13 +654,13 @@
 			}
 		} else {
 			if (usalp->errstr) {
-				js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+				snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 					"Cannot create IOReq");
 			}
 		}
 	} else {
 		if (usalp->errstr) {
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Cannot open Message Port");
 		}
 	}

Modified: cdrkit/trunk/libusal/scsi-apollo.c
===================================================================
--- cdrkit/trunk/libusal/scsi-apollo.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libusal/scsi-apollo.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -115,14 +115,14 @@
 			return (0);
 	}
 	if (device == NULL || *device == '\0') {
-		js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE, "Must give device name");
+		snprintf(usalp->errstr, SCSI_ERRSTR_SIZE, "Must give device name");
 		return (0);
 	}
 
 	scsi_$acquire(device, strlen(device), &usallocal(usalp)->handle, &status);
 	if (status.all) {
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE, "Cannot open '%s', status %08x", device, status.all);
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE, "Cannot open '%s', status %08x", device, status.all);
 		return (0);
 	}
 	/*

Modified: cdrkit/trunk/libusal/scsi-beos.c
===================================================================
--- cdrkit/trunk/libusal/scsi-beos.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libusal/scsi-beos.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -202,7 +202,7 @@
 	if (busno >= MAX_SCG || tgt >= MAX_TGT || tlun >= MAX_LUN) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Illegal value for busno, target or lun '%d,%d,%d'",
 				busno, tgt, tlun);
 		return (-1);
@@ -212,7 +212,7 @@
 	if ((device != NULL && *device != '\0') || (busno == -2 && tgt == -2)) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Open by 'devname' not supported on this OS");
 		return (-1);
 	}
@@ -245,7 +245,7 @@
 usalo_getbuf(SCSI *usalp, long amt)
 {
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"usalo_getbuf: %ld bytes\n", amt);
 	}
 	usalp->bufbase = malloc((size_t)(amt));
@@ -267,9 +267,9 @@
 	char		buf[128];
 
 	if (busno < 8)
-		js_snprintf(buf, sizeof (buf), "/dev/bus/scsi/%d", busno);
+		snprintf(buf, sizeof (buf), "/dev/bus/scsi/%d", busno);
 	else
-		js_snprintf(buf, sizeof (buf), "/dev/disk/ide/atapi/%d", busno-8);
+		snprintf(buf, sizeof (buf), "/dev/disk/ide/atapi/%d", busno-8);
 	if (stat(buf, &sb))
 		return (FALSE);
 	return (TRUE);
@@ -287,12 +287,12 @@
 			return (f->fd);
 	}
 	if (busno < 8) {
-		js_snprintf(buf, sizeof (buf),
+		snprintf(buf, sizeof (buf),
 					"/dev/bus/scsi/%d/%d/%d/raw",
 					busno, tgt, tlun);
 	} else {
 		char *tgtstr = (tgt == 0) ? "master" : (tgt == 1) ? "slave" : "dummy";
-		js_snprintf(buf, sizeof (buf),
+		snprintf(buf, sizeof (buf),
 					"/dev/disk/ide/atapi/%d/%s/%d/raw",
 					busno-8, tgtstr, tlun);
 	}

Modified: cdrkit/trunk/libusal/scsi-bsd-os.c
===================================================================
--- cdrkit/trunk/libusal/scsi-bsd-os.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libusal/scsi-bsd-os.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -131,7 +131,7 @@
 	if (busno >= MAX_SCG || tgt >= MAX_TGT || tlun >= MAX_LUN) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Illegal value for busno, target or lun '%d,%d,%d'",
 				busno, tgt, tlun);
 		return (-1);
@@ -155,7 +155,7 @@
 
 	if (busno >= 0 && tgt >= 0 && tlun >= 0) {
 
-		js_snprintf(devname, sizeof (devname),
+		snprintf(devname, sizeof (devname),
 					"/dev/su%d-%d-%d", busno, tgt, tlun);
 		f = open(devname, O_RDWR|O_NONBLOCK);
 		if (f < 0) {
@@ -167,7 +167,7 @@
 	} else for (b = 0; b < MAX_SCG; b++) {
 		for (t = 0; t < MAX_TGT; t++) {
 			for (l = 0; l < MAX_LUN; l++) {
-				js_snprintf(devname, sizeof (devname),
+				snprintf(devname, sizeof (devname),
 						"/dev/su%d-%d-%d", b, t, l);
 				f = open(devname, O_RDWR|O_NONBLOCK);
 /*				fprintf(stderr, "open (%s) = %d\n", devname, f);*/
@@ -177,7 +177,7 @@
 					    errno != ENXIO &&
 					    errno != ENODEV) {
 						if (usalp->errstr)
-							js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+							snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 								"Cannot open '%s'",
 								devname);
 						return (0);
@@ -200,7 +200,7 @@
 		f = open(device, O_RDWR|O_NONBLOCK);
 		if (f < 0) {
 			if (usalp->errstr)
-				js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+				snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 					"Cannot open '%s'",
 					device);
 			return (0);
@@ -263,7 +263,7 @@
 	Lun	= tlun;
 
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"Bus: %d Target: %d Lun: %d\n", Bus, Target, Lun);
 	}
 
@@ -298,7 +298,7 @@
 usalo_getbuf(SCSI *usalp, long amt)
 {
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"usalo_getbuf: %ld bytes\n", amt);
 	}
 	usalp->bufbase = malloc((size_t)(amt));
@@ -376,7 +376,7 @@
 	scsi_user_cdb_t	suc;
 	int		ret = 0;
 
-/*	js_fprintf((FILE *)usalp->errfile, "f: %d\n", f);*/
+/*	fprintf((FILE *)usalp->errfile, "f: %d\n", f);*/
 	if (usalp->fd < 0) {
 		sp->error = SCG_FATAL;
 		return (0);

Modified: cdrkit/trunk/libusal/scsi-bsd.c
===================================================================
--- cdrkit/trunk/libusal/scsi-bsd.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libusal/scsi-bsd.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -149,7 +149,7 @@
 	if (busno >= MAX_SCG || tgt >= MAX_TGT || tlun >= MAX_LUN) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Illegal value for busno, target or lun '%d,%d,%d'",
 				busno, tgt, tlun);
 		return (-1);
@@ -173,7 +173,7 @@
 
 	if (busno >= 0 && tgt >= 0 && tlun >= 0) {
 
-		js_snprintf(devname, sizeof (devname),
+		snprintf(devname, sizeof (devname),
 				"/dev/su%d-%d-%d", busno, tgt, tlun);
 		f = open(devname, O_RDWR);
 		if (f < 0) {
@@ -185,7 +185,7 @@
 	} else for (b = 0; b < MAX_SCG; b++) {
 		for (t = 0; t < MAX_TGT; t++) {
 			for (l = 0; l < MAX_LUN; l++) {
-				js_snprintf(devname, sizeof (devname),
+				snprintf(devname, sizeof (devname),
 							"/dev/su%d-%d-%d", b, t, l);
 				f = open(devname, O_RDWR);
 /*				fprintf(stderr, "open (%s) = %d\n", devname, f);*/
@@ -195,7 +195,7 @@
 					    errno != ENXIO &&
 					    errno != ENODEV) {
 						if (usalp->errstr)
-							js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+							snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 								"Cannot open '%s'",
 								devname);
 						return (0);
@@ -220,7 +220,7 @@
 		f = open(device, O_RDWR);
 		if (f < 0) {
 			if (usalp->errstr)
-				js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+				snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 					"Cannot open '%s'",
 					device);
 			return (0);
@@ -293,7 +293,7 @@
 	Lun	= SADDR_LUN(saddr);
 
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"Bus: %d Target: %d Lun: %d\n", Bus, Target, Lun);
 	}
 
@@ -328,7 +328,7 @@
 usalo_getbuf(SCSI *usalp, long amt)
 {
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"usalo_getbuf: %ld bytes\n", amt);
 	}
 	usalp->bufbase = valloc((size_t)(amt));
@@ -422,7 +422,7 @@
 	register long	*lp2;
 	int		ret = 0;
 
-/*	js_fprintf((FILE *)usalp->errfile, "fd: %d\n", usalp->fd);*/
+/*	fprintf((FILE *)usalp->errfile, "fd: %d\n", usalp->fd);*/
 	if (usalp->fd < 0) {
 		sp->error = SCG_FATAL;
 		return (0);
@@ -605,7 +605,7 @@
 	if ((device != NULL && *device != '\0') || (busno == -2 && tgt == -2)) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Open by 'devname' not supported on this OS");
 		return (-1);
 	}
@@ -639,7 +639,7 @@
 
 	if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) {
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Open of %s failed", XPT_DEVICE);
 		return (-1);
 	}
@@ -659,7 +659,7 @@
 	ccb.cdm.matches = (struct dev_match_result *)malloc(bufsize);
 	if (ccb.cdm.matches == NULL) {
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Couldn't malloc match buffer");
 		close(fd);
 		return (-1);
@@ -676,7 +676,7 @@
 		sizeof (struct dev_match_pattern));
 	if (ccb.cdm.patterns == NULL) {
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Couldn't malloc pattern buffer");
 		close(fd);
 		free(ccb.cdm.matches);
@@ -684,13 +684,13 @@
 	}
 	ccb.cdm.patterns[0].type = DEV_MATCH_PERIPH;
 	match_pat = &ccb.cdm.patterns[0].pattern.periph_pattern;
-	js_snprintf(match_pat->periph_name, sizeof (match_pat->periph_name),
+	snprintf(match_pat->periph_name, sizeof (match_pat->periph_name),
 								"pass");
 	match_pat->flags = PERIPH_MATCH_NAME;
 
 	if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) {
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"CAMIOCOMMAND ioctl failed");
 		close(fd);
 		free(ccb.cdm.matches);
@@ -703,7 +703,7 @@
 	    (ccb.cdm.status != CAM_DEV_MATCH_MORE))) {
 /*		errmsgno(EX_BAD, "Got CAM error 0x%X, CDM error %d.\n",*/
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Got CAM error 0x%X, CDM error %d",
 			ccb.ccb_h.status, ccb.cdm.status);
 		close(fd);
@@ -726,7 +726,7 @@
 		if (ccb.cdm.matches[unit].type != DEV_MATCH_PERIPH) {
 /*			errmsgno(EX_BAD, "Kernel error! got periph match type %d!!\n",*/
 			if (usalp->errstr)
-				js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+				snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 					"Kernel error! got periph match type %d!!",
 					ccb.cdm.matches[unit].type);
 			free(ccb.cdm.matches);
@@ -734,7 +734,7 @@
 		}
 		periph_result = &ccb.cdm.matches[unit].result.periph_result;
 
-		js_snprintf(name, sizeof (name),
+		snprintf(name, sizeof (name),
 				"/dev/%s%d", periph_result->periph_name,
 			periph_result->unit_number);
 
@@ -758,7 +758,7 @@
 			errmsgno(EX_BAD, "%s\n", cam_errbuf);
 #endif
 			if (usalp->errstr)
-				js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+				snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 					"Error opening /dev/%s%d Cam error '%s'",
 					periph_result->periph_name,
 					periph_result->unit_number,
@@ -802,7 +802,7 @@
 usalo_getbuf(SCSI *usalp, long amt)
 {
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"usalo_getbuf: %ld bytes\n", amt);
 	}
 	usalp->bufbase = valloc((size_t)(amt));
@@ -889,7 +889,7 @@
 
 	if (usalp->fd < 0) {
 #if 0
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"attempt to reference invalid unit %d\n", usalp->fd);
 #endif
 		sp->error = SCG_FATAL;

Modified: cdrkit/trunk/libusal/scsi-dos.c
===================================================================
--- cdrkit/trunk/libusal/scsi-dos.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libusal/scsi-dos.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -123,7 +123,7 @@
 	if (busno >= MAX_SCG || tgt >= MAX_TGT || tlun >= MAX_LUN) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Illegal value for busno, target or lun '%d,%d,%d'",
 				busno, tgt, tlun);
 		return (-1);
@@ -132,7 +132,7 @@
 	if ((device != NULL && *device != '\0') || (busno == -2 && tgt == -2)) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Open by 'devname' not supported on this OS");
 		return (-1);
 	}
@@ -197,7 +197,7 @@
 usalo_getbuf(SCSI *usalp, long amt)
 {
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 				"usalo_getbuf: %ld bytes\n", amt);
 	}
 	usalp->bufbase = malloc((size_t)(amt));
@@ -301,7 +301,7 @@
 	default:
 		sp->error = SCG_FATAL;
 		sp->ux_errno = EINVAL;
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"Unsupported sp->cdb_len: %u. Fatal error in usalo_send, exiting...\n", sp->cdb_len);
 		return (-1);
 	}
@@ -354,7 +354,7 @@
 
 	if (Srb.Status == SS_PENDING) {	/* Check if we got a timeout*/
 		if (usalp->debug > 0) {
-			js_fprintf((FILE *)usalp->errfile,
+			fprintf((FILE *)usalp->errfile,
 					"Timeout....\n");
 		}
 			sp->error = SCG_TIMEOUT;
@@ -367,7 +367,7 @@
 	if (Srb.Status != SS_COMP) {
 
 		if (usalp->debug > 0) {
-			js_fprintf((FILE *)usalp->errfile,
+			fprintf((FILE *)usalp->errfile,
 				"Error in usalo_send: Srb.Status is 0x%x\n", Srb.Status);
 		}
 
@@ -425,7 +425,7 @@
 		sp->u_scb.cmd_scb[0] = Srb.Type.ExecSCSICmd.TargStat;
 
 		if (usalp->debug > 0) {
-			js_fprintf((FILE *)usalp->errfile,
+			fprintf((FILE *)usalp->errfile,
 				"Mapped to: error %d errno: %d\n", sp->error, sp->ux_errno);
 		}
 		return (1);
@@ -477,14 +477,14 @@
 		/* Allocate real mode callback */
 		_callback_info.pm_offset = (unsigned long)&SCSIMgrCallBack;
 		if (_go32_dpmi_allocate_real_mode_callback_retf(&_callback_info, &_callback_regs) == -1) {
-			js_fprintf((FILE *)usalp->errfile, "Cannot allocate callback address!\n");
+			fprintf((FILE *)usalp->errfile, "Cannot allocate callback address!\n");
 			SCSIMgrEntry = 0;
 		}
 	}
 
 	/* SCSIMgr entry point founded? */
 	if (!SCSIMgrEntry) {
-		js_fprintf((FILE *)usalp->errfile, "Cannot open ASPI manager! Try to get one from http://bootcd.narod.ru/\n");
+		fprintf((FILE *)usalp->errfile, "Cannot open ASPI manager! Try to get one from http://bootcd.narod.ru/\n");
 		return (FALSE);
 	}
 
@@ -494,11 +494,11 @@
 	SCSIMgrSendSRB(&Srb, 10);
 
 	if (usalp->debug) {
-		js_fprintf((FILE *)usalp->errfile, "Status : %ld\n", Srb.Status);
-		js_fprintf((FILE *)usalp->errfile, "hacount: %d\n", Srb.Type.HAInquiry.Count);
-		js_fprintf((FILE *)usalp->errfile, "SCSI id: %d\n", Srb.Type.HAInquiry.SCSI_ID);
-		js_fprintf((FILE *)usalp->errfile, "Manager: '%.16s'\n", Srb.Type.HAInquiry.ManagerId);
-		js_fprintf((FILE *)usalp->errfile, "Identif: '%.16s'\n", Srb.Type.HAInquiry.Identifier);
+		fprintf((FILE *)usalp->errfile, "Status : %ld\n", Srb.Status);
+		fprintf((FILE *)usalp->errfile, "hacount: %d\n", Srb.Type.HAInquiry.Count);
+		fprintf((FILE *)usalp->errfile, "SCSI id: %d\n", Srb.Type.HAInquiry.SCSI_ID);
+		fprintf((FILE *)usalp->errfile, "Manager: '%.16s'\n", Srb.Type.HAInquiry.ManagerId);
+		fprintf((FILE *)usalp->errfile, "Identif: '%.16s'\n", Srb.Type.HAInquiry.Identifier);
 		usal_prbytes("Unique:", Srb.Type.HAInquiry.Unique, 16);
 	}
 

Modified: cdrkit/trunk/libusal/scsi-hpux.c
===================================================================
--- cdrkit/trunk/libusal/scsi-hpux.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libusal/scsi-hpux.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -119,7 +119,7 @@
 	if (busno >= MAX_SCG || tgt >= MAX_TGT || tlun >= MAX_LUN) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Illegal value for busno, target or lun '%d,%d,%d'",
 				busno, tgt, tlun);
 		return (-1);
@@ -128,7 +128,7 @@
 	if ((device != NULL && *device != '\0') || (busno == -2 && tgt == -2)) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Open by 'devname' not supported on this OS");
 		return (-1);
 	}
@@ -148,7 +148,7 @@
 
 	if (busno >= 0 && tgt >= 0 && tlun >= 0) {
 
-		js_snprintf(devname, sizeof (devname),
+		snprintf(devname, sizeof (devname),
 				"/dev/rscsi/c%xt%xl%x", busno, tgt, tlun);
 		f = open(devname, O_RDWR);
 		if (f < 0)
@@ -160,7 +160,7 @@
 			for (t = 0; t < MAX_TGT; t++) {
 /*				for (l = 0; l < MAX_LUN; l++) {*/
 				for (l = 0; l < 1; l++) {
-					js_snprintf(devname, sizeof (devname),
+					snprintf(devname, sizeof (devname),
 							"/dev/rscsi/c%xt%xl%x", b, t, l);
 /*fprintf(stderr, "name: '%s'\n", devname);*/
 					f = open(devname, O_RDWR);
@@ -211,7 +211,7 @@
 usalo_getbuf(SCSI *usalp, long amt)
 {
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"usalo_getbuf: %ld bytes\n", amt);
 	}
 	usalp->bufbase = valloc((size_t)(amt));

Modified: cdrkit/trunk/libusal/scsi-linux-ata.c
===================================================================
--- cdrkit/trunk/libusal/scsi-linux-ata.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libusal/scsi-linux-ata.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -202,7 +202,7 @@
 	if (bus >= MAX_SCHILLY_HOSTS || target >= MAX_TGT || lun >= MAX_LUN) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Illegal value for bus, target or lun '%d,%d,%d'",
 				bus, target, lun);
 
@@ -244,7 +244,7 @@
 atascan:
 	if (scan_internal(usalp, &nopen)) {
 		if (usalp->errstr)
-			js_printf(usalp->errstr, "INFO: scan_internal(...) failed");
+			printf(usalp->errstr, "INFO: scan_internal(...) failed");
 		return (-1);
 	}
 	return (nopen);
@@ -253,7 +253,7 @@
 	if (device != NULL && strncmp(device, "ATAPI:", 6) == 0)
 		device += 6;
 	if (usalp->debug > 3) {
-		js_fprintf((FILE *) usalp->errfile, "INFO: do usalo_open openbydev");
+		fprintf((FILE *) usalp->errfile, "INFO: do usalo_open openbydev");
 	}
 	if (device != NULL && *device != '\0') {
 		int	schilly_bus,
@@ -264,7 +264,7 @@
 
 		if (f < 0) {
 			if (usalp->errstr)
-				js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+				snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 					"Cannot open '%s'", device);
 			return (0);
 		}
@@ -299,19 +299,19 @@
 			if ((f = open(device, O_RDONLY | O_NONBLOCK)) < 0) {
 				if (errno != ENOENT && errno != ENXIO && errno != ENODEV && errno != EACCES) {
 					if (usalp->debug > 4) {
-						js_fprintf((FILE *) usalp->errfile,
+						fprintf((FILE *) usalp->errfile,
 						"try open(%s) return %i, errno %i, cancel\n", device, f, errno);
 					}
 					return (-2);
 				} else if (errno == ENOENT || errno == ENODEV) {
 					if (usalp->debug > 4) {
-						js_fprintf((FILE *) usalp->errfile,
+						fprintf((FILE *) usalp->errfile,
 						"try open(%s) return %i, errno %i\n", device, f, errno);
 					}
 					if (0 == i) {
 						DEVFS = FALSE;
 						if (usalp->debug > 4) {
-							js_fprintf((FILE *) usalp->errfile,
+							fprintf((FILE *) usalp->errfile,
 							"DEVFS not detected, continuing with old dev\n");
 						}
 					}
@@ -319,17 +319,17 @@
 				}
 				if (usalp->debug > 4) {
 					if (errno == EACCES) {
-						js_fprintf((FILE *) usalp->errfile,
+						fprintf((FILE *) usalp->errfile,
 						"errno (EACCESS), you don't have the needed rights for %s\n",
 						device);
 					}
-					js_fprintf((FILE *) usalp->errfile,
+					fprintf((FILE *) usalp->errfile,
 					"try open(%s) return %i, errno %i, trying next cdrom\n",
 					device, f, errno);
 				}
 			} else {
 				if (usalp->debug > 4) {
-					js_fprintf((FILE *) usalp->errfile,
+					fprintf((FILE *) usalp->errfile,
 					"try open(%s) return %i errno %i calling sg_mapdev(...)\n",
 					device, f, errno);
 				}
@@ -348,7 +348,7 @@
 			if ((f = open(device, O_RDONLY | O_NONBLOCK)) < 0) {
 				if (errno != ENOENT && errno != ENXIO && errno != ENODEV && errno != EACCES) {
 					if (usalp->debug > 4) {
-						js_fprintf((FILE *) usalp->errfile,
+						fprintf((FILE *) usalp->errfile,
 						"try open(%s) return %i, errno %i, cancel\n",
 						device, f, errno);
 					}
@@ -371,7 +371,7 @@
 			if ((f = open(device, O_RDONLY | O_NONBLOCK)) < 0) {
 				if (errno != ENOENT && errno != ENXIO && errno != EACCES) {
 					if (usalp->debug > 4) {
-						js_fprintf((FILE *) usalp->errfile,
+						fprintf((FILE *) usalp->errfile,
 						"try open(%s) return %i, errno %i, cancel\n",
 						device, f, errno);
 					}
@@ -383,7 +383,7 @@
 				/* ugly hack, make better, when you can. Alex */
 				if (0 > ioctl(f, CDROM_DRIVE_STATUS, CDSL_CURRENT)) {
 					if (usalp->debug > 4) {
-						js_fprintf((FILE *) usalp->errfile,
+						fprintf((FILE *) usalp->errfile,
 						"%s is not a cdrom, skipping\n",
 						device);
 					}
@@ -691,7 +691,7 @@
 		strncpy(tmp, device, sizeof (tmp));
 	}
 	if (usalp->debug > 3) {
-		js_fprintf((FILE *) usalp->errfile, "INFO: %s -> %s\n", device, tmp);
+		fprintf((FILE *) usalp->errfile, "INFO: %s -> %s\n", device, tmp);
 	}
 	memset(token, 0x00, sizeof (token));
 	i = 0;
@@ -793,7 +793,7 @@
 				if (Bus == -1) {
 					Bus = n;
 					if (usalp->debug > 0) {
-						js_fprintf((FILE *)usalp->errfile,
+						fprintf((FILE *)usalp->errfile,
 							"SCSI Bus: %d (mapped from %d)\n",
 							Bus, Ino);
 					}
@@ -816,7 +816,7 @@
 	}
 
 	if (usalp->verbose)
-		js_printf(usalp->errstr, "INFO: subsystem %s: h %i, b %i, t %i, l %i",
+		printf(usalp->errstr, "INFO: subsystem %s: h %i, b %i, t %i, l %i",
 			token[ID_TOKEN_SUBSYSTEM], h, b, t, l);
 
 	first_free_schilly_bus = usalo_aget_first_free_shillybus(usalp, subsystem, h, b);
@@ -837,7 +837,7 @@
 		*lun = l;
 
 		if (usalp->debug > 1) {
-			js_fprintf((FILE *) usalp->errfile,
+			fprintf((FILE *) usalp->errfile,
 				"INFO: /dev/%s, (host%d/bus%d/target%d/lun%d) will be mapped on the schilly bus No %d (%d,%d,%d)\n",
 				token[ID_TOKEN_SUBSYSTEM], h, b, t, l,
 				first_free_schilly_bus, first_free_schilly_bus, t, l);
@@ -864,7 +864,7 @@
 		return (FALSE);
 
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *) usalp->errfile,
+		fprintf((FILE *) usalp->errfile,
 			"INFO: l1: 0x%lX l2: 0x%lX\n", sg_id.l1, sg_id.l2);
 	}
 	if (ioctl(f, SCSI_IOCTL_GET_BUS_NUMBER, &Bus) < 0) {
@@ -875,7 +875,7 @@
 	Chan = (sg_id.l1 >> 16) & 0xFF;
 	Ino = (sg_id.l1 >> 24) & 0xFF;
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *) usalp->errfile,
+		fprintf((FILE *) usalp->errfile,
 			"INFO: Bus: %d Target: %d Lun: %d Chan: %d Ino: %d\n",
 			Bus, Target, Lun, Chan, Ino);
 	}
@@ -936,7 +936,7 @@
 static int
 usalo_ainitiator_id(SCSI *usalp)
 {
-	js_printf(usalp->errstr, "NOT IMPELEMENTED: usalo_initiator_id");
+	printf(usalp->errstr, "NOT IMPELEMENTED: usalo_initiator_id");
 	return (-1);
 }
 
@@ -1057,7 +1057,7 @@
 		sp->ux_errno = geterrno();
 
 	if (ret < 0 && usalp->debug > 4) {
-		js_fprintf((FILE *) usalp->errfile,
+		fprintf((FILE *) usalp->errfile,
 			"ioctl(CDROM_SEND_PACKET) ret: %d\n", ret);
 	}
 	/*

Modified: cdrkit/trunk/libusal/scsi-linux-pg.c
===================================================================
--- cdrkit/trunk/libusal/scsi-linux-pg.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libusal/scsi-linux-pg.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -155,7 +155,7 @@
 	if (busno >= MAX_SCG || tgt >= MAX_TGT || tlun >= MAX_LUN) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Illegal value for busno, target or lun '%d,%d,%d'",
 				busno, tgt, tlun);
 		return (-1);
@@ -180,7 +180,7 @@
 		}
 	}
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"PP Bus: %d\n", usallocal(usalp)->pgbus);
 	}
 #else
@@ -211,11 +211,11 @@
 		if (usallocal(usalp)->pgbus != busno)
 			return (0);
 #endif
-		js_snprintf(devname, sizeof (devname), "/dev/pg%d", tgt);
+		snprintf(devname, sizeof (devname), "/dev/pg%d", tgt);
 		f = sg_open_excl(devname, O_RDWR | O_NONBLOCK);
 		if (f < 0) {
 			if (usalp->errstr)
-				js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+				snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 						"Cannot open '%s'", devname);
 			return (0);
 		}
@@ -224,7 +224,7 @@
 	} else {
 		tlun = 0;
 		for (tgt = 0; tgt < MAX_TGT; tgt++) {
-			js_snprintf(devname, sizeof (devname), "/dev/pg%d", tgt);
+			snprintf(devname, sizeof (devname), "/dev/pg%d", tgt);
 			f = sg_open_excl(devname, O_RDWR | O_NONBLOCK);
 			if (f < 0) {
 				/*
@@ -232,11 +232,11 @@
 				 * if at least one open succeeded.
 				 */
 				if (usalp->errstr)
-					js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+					snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 							"Cannot open '/dev/pg*'");
 				if (errno != ENOENT && errno != ENXIO && errno != ENODEV) {
 					if (usalp->errstr)
-						js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+						snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 							"Cannot open '%s'", devname);
 					return (0);
 				}
@@ -259,7 +259,7 @@
 /*		if (f < 0 && errno == ENOENT) {*/
 		if (f < 0) {
 			if (usalp->errstr)
-				js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+				snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 					"Cannot open '%s'",
 					device);
 			return (0);
@@ -317,7 +317,7 @@
 	char    *ret;
 
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"usalo_getbuf: %ld bytes\n", amt);
 	}
 	ret = valloc((size_t)(amt+getpagesize()));

Modified: cdrkit/trunk/libusal/scsi-linux-sg.c
===================================================================
--- cdrkit/trunk/libusal/scsi-linux-sg.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libusal/scsi-linux-sg.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -302,7 +302,7 @@
 
 				if (usallocal(usalp)->drvers >= 0) {
 					n = usallocal(usalp)->drvers;
-					js_snprintf(kv, sizeof (kv),
+					snprintf(kv, sizeof (kv),
 					"%d.%d.%d",
 					n/10000, (n%10000)/100, n%100);
 
@@ -348,7 +348,7 @@
 	if (busno >= MAX_SCG || tgt >= MAX_TGT || tlun >= MAX_LUN) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Illegal value for busno, target or lun '%d,%d,%d'",
 				busno, tgt, tlun);
 		return (-1);
@@ -361,36 +361,8 @@
 		}
 #endif
 		if (strcmp(device, "ATA") == 0) {
-			/*
-			 * Sending generic SCSI commands via /dev/hd* is a
-			 * really bad idea when there also is a generic
-			 * SCSI driver interface - it breaks the protocol
-			 * layering model. A better idea would be to
-			 * have a SCSI host bus adapter driver that sends
-			 * the SCSI commands via the ATA hardware. This way,
-			 * the layering model would be honored.
-			 *
-			 * People like Jens Axboe should finally fix the DMA
-			 * bugs in the ide-scsi hostadaptor emulation module
-			 * from Linux instead of publishing childish patches
-			 * to the comment above.
-			 */
 			use_ata = TRUE;
 			device = NULL;
-#if 0 // WTF, stop spamming
-			if (usalp->overbose) {
-				/*
-				 * I strongly encourage people who believe that
-				 * they need to patch this message away to read
-				 * the messages in the Solaris USCSI libusal
-				 * layer instead of wetting their tissues while
-				 * being unwilling to look besides their
-				 * own belly button.
-				 */
-				js_fprintf((FILE *)usalp->errfile,
-				"#########################################################################################\n#\n#  Warning: Using ATAPI via /dev/hd* interface. Use dev=ATA:X,Y,Z or dev=/dev/hdX\n\#\n#########################################################################################\n");
-			}
-#endif
 		}
 	}
 
@@ -438,7 +410,7 @@
 /* If a device was specified with ATA:x,y,z try to open this device instead of
  * uselessly opening all of them until we reach the specified one */
 	if (use_ata) for (i=2*busno+tgt >= 0 ? 2*busno+tgt:0; i <= 25; i++) {
-		js_snprintf(devname, sizeof (devname), "/dev/hd%c", i+'a');
+		snprintf(devname, sizeof (devname), "/dev/hd%c", i+'a');
 					/* O_NONBLOCK is dangerous */
 		f = sg_open_excl(devname, O_RDWR | O_NONBLOCK);
 		if (f < 0) {
@@ -447,11 +419,11 @@
 			 * if at least one open succeeded.
 			 */
 			if (usalp->errstr)
-				js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+				snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 							"Cannot open '/dev/hd*'");
 			if (errno != ENOENT && errno != ENXIO && errno != ENODEV) {
 				if (usalp->errstr)
-					js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+					snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 							"Cannot open '%s'", devname);
 				/* return (0); */
             continue;
@@ -461,7 +433,7 @@
 
 			if (ioctl(f, SG_GET_TIMEOUT, &iparm) < 0) {
 				if (usalp->errstr)
-					js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+					snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 							"SCSI unsupported with '/dev/hd*'");
 				close(f);
 				continue;
@@ -479,7 +451,7 @@
 		usalp->errstr[0] = '\0';
 
 	if (nopen == 0) for (i = 0; i < 32; i++) {
-		js_snprintf(devname, sizeof (devname), "/dev/sg%d", i);
+		snprintf(devname, sizeof (devname), "/dev/sg%d", i);
 					/* O_NONBLOCK is dangerous */
 		f = sg_open_excl(devname, O_RDWR | O_NONBLOCK);
 		if (f < 0) {
@@ -488,13 +460,13 @@
 			 * if at least one open succeeded.
 			 */
 			if (usalp->errstr)
-				js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+				snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 							"Cannot open '/dev/sg*'");
 			if(errno == EACCES || errno==EPERM)
 				continue;
 			if (errno != ENOENT && errno != ENXIO && errno != ENODEV) {
 				if (usalp->errstr)
-					js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+					snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 							"Cannot open '%s'", devname);
 				return (0);
 			}
@@ -510,7 +482,7 @@
 		usalp->errstr[0] = '\0';
 
 	if (nopen == 0) for (i = 0; i <= 25; i++) {
-		js_snprintf(devname, sizeof (devname), "/dev/sg%c", i+'a');
+		snprintf(devname, sizeof (devname), "/dev/sg%c", i+'a');
 					/* O_NONBLOCK is dangerous */
 		f = sg_open_excl(devname, O_RDWR | O_NONBLOCK);
 		if (f < 0) {
@@ -519,13 +491,13 @@
 			 * if at least one open succeeded.
 			 */
 			if (usalp->errstr)
-				js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+				snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 							"Cannot open '/dev/sg*'");
 			if(errno == EACCES || errno==EPERM)
 				continue;
 			if (errno != ENOENT && errno != ENXIO && errno != ENODEV) {
 				if (usalp->errstr)
-					js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+					snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 							"Cannot open '%s'", devname);
 				return (0);
 			}
@@ -560,7 +532,7 @@
 			 * makes no sense to try the /dev/pg* driver.
 			 */
 			if (usalp->errstr)
-				js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+				snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 					"Cannot open '%s'",
 					device);
 			return (0);
@@ -593,13 +565,13 @@
 	nopen += pg_open(usalp, device);
 #endif
 	if (usalp->debug > 0) for (b = 0; b < MAX_SCG; b++) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"Bus: %d cookie: %X\n",
 			b, usallocal(usalp)->buscookies[b]);
 		for (t = 0; t < MAX_TGT; t++) {
 			for (l = 0; l < MAX_LUN; l++) {
 				if (usallocal(usalp)->usalfiles[b][t][l] != (short)-1) {
-					js_fprintf((FILE *)usalp->errfile,
+					fprintf((FILE *)usalp->errfile,
 						"file (%d,%d,%d): %d\n",
 						b, t, l, usallocal(usalp)->usalfiles[b][t][l]);
 				}
@@ -679,7 +651,7 @@
 		if (ioctl(f, SG_GET_VERSION_NUM, &n) >= 0) {
 			usallocal(usalp)->drvers = n;
 			if (usalp->overbose) {
-				js_fprintf((FILE *)usalp->errfile,
+				fprintf((FILE *)usalp->errfile,
 					"Linux sg driver version: %d.%d.%d\n",
 					n/10000, (n%10000)/100, n%100);
 			}
@@ -699,7 +671,7 @@
 	if (Bus == -1) {
 		Bus = n;
 		if (usalp->debug > 0) {
-			js_fprintf((FILE *)usalp->errfile,
+			fprintf((FILE *)usalp->errfile,
 				"SCSI Bus: %d (mapped from %d)\n", Bus, Ino);
 		}
 	}
@@ -852,7 +824,7 @@
 	if (ioctl(f, SCSI_IOCTL_GET_IDLUN, &sg_id))
 		return (FALSE);
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"l1: 0x%lX l2: 0x%lX\n", sg_id.l1, sg_id.l2);
 	}
 	if (ioctl(f, SCSI_IOCTL_GET_BUS_NUMBER, &Bus) < 0) {
@@ -864,7 +836,7 @@
 	Chan	= (sg_id.l1 >> 16) & 0xFF;
 	Ino	= (sg_id.l1 >> 24) & 0xFF;
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"Bus: %d Target: %d Lun: %d Chan: %d Ino: %d\n",
 			Bus, Target, Lun, Chan, Ino);
 	}
@@ -954,7 +926,7 @@
 				if (ioctl(f, SG_GET_RESERVED_SIZE, &val) < 0)
 					continue;
 				if (usalp->debug > 0) {
-					js_fprintf((FILE *)usalp->errfile,
+					fprintf((FILE *)usalp->errfile,
 						"Target (%d,%d,%d): DMA max %d old max: %ld\n",
 						b, t, l, val, newmax);
 				}
@@ -1013,7 +985,7 @@
 	char	*ret;
 
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 				"usalo_getbuf: %ld bytes\n", amt);
 	}
 	/*
@@ -1235,7 +1207,7 @@
 
 	ret = ioctl(usalp->fd, SG_IO, &sg_io);
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 				"ioctl ret: %d\n", ret);
 	}
 
@@ -1262,7 +1234,7 @@
 	sp->sense_count = sg_io.sb_len_wr;
 
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 				"host_status: %02X driver_status: %02X\n",
 				sg_io.host_status, sg_io.driver_status);
 	}
@@ -1397,7 +1369,7 @@
 			(usallocal(usalp)->SCSIbuf - (sizeof (struct sg_header)));
 	} else {
 		if (usalp->debug > 0) {
-			js_fprintf((FILE *)usalp->errfile,
+			fprintf((FILE *)usalp->errfile,
 				"DMA addr: 0x%8.8lX size: %d - using copy buffer\n",
 				(long)sp->addr, sp->size);
 		}
@@ -1410,7 +1382,7 @@
 						SCG_MAX_CMD +
 						sizeof (struct sg_header));
 				if (usalp->debug > 0) {
-					js_fprintf((FILE *)usalp->errfile,
+					fprintf((FILE *)usalp->errfile,
 						"Allocated DMA copy buffer, addr: 0x%8.8lX size: %ld\n",
 						(long)usallocal(usalp)->xbuf,
 						usalp->maxbuf);
@@ -1628,7 +1600,7 @@
 
 	if (usalp->verbose > 0 && usalp->debug > 0) {
 #ifdef	SG_GET_BUFSIZE
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 				"status: 0x%08X pack_len: %d, reply_len: %d pack_id: %d result: %d wn: %d gn: %d cdb_len: %d sense_len: %d sense[0]: %02X\n",
 				GETINT(sgp->hd.sg_cmd_status),
 				GETINT(sgp->hd.pack_len),
@@ -1641,7 +1613,7 @@
 				sgp->hd.sense_len,
 				sgp->hd.sense_buffer[0]);
 #else
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 				"pack_len: %d, reply_len: %d pack_id: %d result: %d sense[0]: %02X\n",
 				GETINT(sgp->hd.pack_len),
 				GETINT(sgp->hd.reply_len),
@@ -1650,10 +1622,10 @@
 				sgp->hd.sense_buffer[0]);
 #endif
 #ifdef	DEBUG
-		js_fprintf((FILE *)usalp->errfile, "sense: ");
+		fprintf((FILE *)usalp->errfile, "sense: ");
 		for (i = 0; i < 16; i++)
-			js_fprintf((FILE *)usalp->errfile, "%02X ", sgp->hd.sense_buffer[i]);
-		js_fprintf((FILE *)usalp->errfile, "\n");
+			fprintf((FILE *)usalp->errfile, "%02X ", sgp->hd.sense_buffer[i]);
+		fprintf((FILE *)usalp->errfile, "\n");
 #endif
 	}
 

Modified: cdrkit/trunk/libusal/scsi-mac-iokit.c
===================================================================
--- cdrkit/trunk/libusal/scsi-mac-iokit.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libusal/scsi-mac-iokit.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -145,7 +145,7 @@
 	int driveidx = 1, idx = 1;
 
 	if (device == NULL) {
-		js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+		snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 		"Please specify a device name (e.g. IOCompactDiscServices/0)");
 		goto out;
 	}
@@ -166,7 +166,7 @@
 	ioReturnValue = IOMasterPort(bootstrap_port, &masterPort);
 
 	if (ioReturnValue != kIOReturnSuccess) {
-		js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+		snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 			    "Couldn't get a master IOKit port. Error %d",
 			    ioReturnValue);
 		goto out;
@@ -174,7 +174,7 @@
 
 	dict = IOServiceMatching(realdevice);
 	if (dict == NULL) {
-		js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+		snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 			    "Couldn't create dictionary for searching");
 		goto out;
 	}
@@ -185,7 +185,7 @@
 
 	if (scsiObjectIterator == NULL ||
 	    (ioReturnValue != kIOReturnSuccess)) {
-		js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+		snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 			    "No matching device %s found.", device);
 		goto out;
 	}
@@ -203,7 +203,7 @@
 	}
 
 	if (scsiDevice == NULL) {
-		js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+		snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 			    "No matching device found. Iterator failed.");
 		goto out;
 	}
@@ -221,7 +221,7 @@
 				(LPVOID)&mmcDeviceInterface);
 
 	if (plugInResult != KERN_SUCCESS) {
-		js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+		snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 			    "Unable to get MMC Interface: 0x%lX",
 			    (long)plugInResult);
 
@@ -232,7 +232,7 @@
 		(*mmcDeviceInterface)->GetSCSITaskDeviceInterface(mmcDeviceInterface);
 
 	if (scsiTaskDeviceInterface == NULL) {
-		js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+		snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 			    "Failed to get taskDeviceInterface");
 		goto out;
 	}
@@ -245,7 +245,7 @@
 					kIOCFPlugInInterfaceID,
 					&plugInInterface, &score);
 	if (ioReturnValue != kIOReturnSuccess) {
-		js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+		snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 			    "Unable to get plugin Interface: %x",
 			    ioReturnValue);
 		goto out;
@@ -256,7 +256,7 @@
 					(LPVOID)&scsiTaskDeviceInterface);
 
 	if (plugInResult != KERN_SUCCESS) {
-		js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+		snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 			    "Unable to get generic Interface: 0x%lX",
 			    (long)plugInResult);
 
@@ -268,7 +268,7 @@
 		(*scsiTaskDeviceInterface)->ObtainExclusiveAccess(scsiTaskDeviceInterface);
 
 	if (ioReturnValue != kIOReturnSuccess) {
-		js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+		snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 			    "Unable to get exclusive access to device");
 		goto out;
 	}
@@ -357,7 +357,7 @@
 	if (ioctl(usallocal(usalp)->usalfile, SGIOCMAXDMA, &m) >= 0) {
 		maxdma = m;
 		if (usalp->debug > 0) {
-			js_fprintf((FILE *)usalp->errfile,
+			fprintf((FILE *)usalp->errfile,
 				"maxdma: %d\n", maxdma);
 		}
 	}
@@ -369,7 +369,7 @@
 usalo_getbuf(SCSI *usalp, long amt)
 {
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"usalo_getbuf: %ld bytes\n", amt);
 	}
 	usalp->bufbase = malloc((size_t)(amt));
@@ -445,7 +445,7 @@
 
 	cmd = (*sc)->CreateSCSITask(sc);
 	if (cmd == NULL) {
-		js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+		snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 			    "Failed to create SCSI task");
 		ret = -1;
 
@@ -462,7 +462,7 @@
 						sp->cdb.cmd_cdb, sp->cdb_len);
 
 	if (ioReturnValue != kIOReturnSuccess) {
-		js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+		snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 			    "SetCommandDescriptorBlock failed with status %x",
 			    ioReturnValue);
 		ret = -1;
@@ -474,7 +474,7 @@
 				kSCSIDataTransfer_FromTargetToInitiator :
 				kSCSIDataTransfer_FromInitiatorToTarget);
 	if (ioReturnValue != kIOReturnSuccess) {
-		js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+		snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 			    "SetScatterGatherEntries failed with status %x",
 			    ioReturnValue);
 		ret = -1;
@@ -483,7 +483,7 @@
 
 	ioReturnValue = (*cmd)->SetTimeoutDuration(cmd, sp->timeout * 1000);
 	if (ioReturnValue != kIOReturnSuccess) {
-		js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+		snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 			    "SetTimeoutDuration failed with status %x",
 			    ioReturnValue);
 		ret = -1;
@@ -501,7 +501,7 @@
 	sp->ux_errno = geterrno();
 
 	if (ioReturnValue != kIOReturnSuccess) {
-		js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+		snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 			    "Command execution failed with status %x",
 			    ioReturnValue);
 		sp->error = SCG_RETRYABLE;

Modified: cdrkit/trunk/libusal/scsi-next.c
===================================================================
--- cdrkit/trunk/libusal/scsi-next.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libusal/scsi-next.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -122,7 +122,7 @@
 	if (busno >= MAX_SCG || tgt >= MAX_TGT || tlun >= MAX_LUN) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Illegal value for busno, target or lun '%d,%d,%d'",
 				busno, tgt, tlun);
 		return (-1);
@@ -131,7 +131,7 @@
 	if ((device != NULL && *device != '\0') || (busno == -2 && tgt == -2)) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Open by 'devname' not supported on this OS");
 		return (-1);
 	}
@@ -149,7 +149,7 @@
 	}
 
 	for (i = 0; i < 4; i++) {
-		js_snprintf(devname, sizeof (devname), "/dev/sg%d", i);
+		snprintf(devname, sizeof (devname), "/dev/sg%d", i);
 		f = open(devname, O_RDWR);
 		if (usalp->debug > 0)
 			errmsg("open(devname: '%s') : %d\n", devname, f);
@@ -168,7 +168,7 @@
 			usallocal(usalp)->max_scsibus = i;
 		}
 		if (usalp->debug > 0) {
-			js_fprintf((FILE *)usalp->errfile,
+			fprintf((FILE *)usalp->errfile,
 				"maxbus: %d\n", usallocal(usalp)->max_scsibus);
 		}
 		if (usallocal(usalp)->max_scsibus <= 0) {
@@ -182,7 +182,7 @@
 		return (1);
 	}
 	if (usalp->errstr)
-		js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+		snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 			"Cannot open '/dev/sg*'");
 	return (0);
 }
@@ -208,12 +208,12 @@
 	sadr.sa_lun = tlun;
 
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"usal_setup curbus %d -> %d\n", usallocal(usalp)->cur_scsibus, busno);
 	}
 
 	if (usalp->debug > 0 && ((usallocal(usalp)->cur_scsibus < 0 || usallocal(usalp)->cur_scsibus != busno)))
-		js_fprintf((FILE *)usalp->errfile, "setting SCSI bus to: %d\n", busno);
+		fprintf((FILE *)usalp->errfile, "setting SCSI bus to: %d\n", busno);
 	if ((usallocal(usalp)->cur_scsibus < 0 || usallocal(usalp)->cur_scsibus != busno) &&
 				ioctl(usallocal(usalp)->usalfile, SGIOCCNTR, &busno) < 0) {
 
@@ -226,7 +226,7 @@
 	usallocal(usalp)->cur_scsibus	= busno;
 
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"setting target/lun to: %d/%d\n", tgt, tlun);
 	}
 	if (ioctl(usallocal(usalp)->usalfile, SGIOCSTL, &sadr) < 0) {
@@ -250,7 +250,7 @@
 	if (ioctl(usallocal(usalp)->usalfile, SGIOCMAXDMA, &m) >= 0) {
 		maxdma = m;
 		if (usalp->debug > 0) {
-			js_fprintf((FILE *)usalp->errfile,
+			fprintf((FILE *)usalp->errfile,
 				"maxdma: %d\n", maxdma);
 		}
 	}
@@ -271,7 +271,7 @@
 usalo_getbuf(SCSI *usalp, long amt)
 {
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"usalo_getbuf: %ld bytes\n", amt);
 	}
 	usalp->bufbase = valloc((size_t)(amt));
@@ -378,12 +378,12 @@
 		sp->ux_errno = 0;
 	}
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile, "dma_dir:     %X\n", req.sr_dma_dir);
-		js_fprintf((FILE *)usalp->errfile, "dma_addr:    %X\n", req.sr_addr);
-		js_fprintf((FILE *)usalp->errfile, "io_time:     %d\n", req.sr_ioto);
-		js_fprintf((FILE *)usalp->errfile, "io_status:   %d\n", req.sr_io_status);
-		js_fprintf((FILE *)usalp->errfile, "scsi_status: %X\n", req.sr_scsi_status);
-		js_fprintf((FILE *)usalp->errfile, "dma_xfer:    %d\n", req.sr_dma_xfr);
+		fprintf((FILE *)usalp->errfile, "dma_dir:     %X\n", req.sr_dma_dir);
+		fprintf((FILE *)usalp->errfile, "dma_addr:    %X\n", req.sr_addr);
+		fprintf((FILE *)usalp->errfile, "io_time:     %d\n", req.sr_ioto);
+		fprintf((FILE *)usalp->errfile, "io_status:   %d\n", req.sr_io_status);
+		fprintf((FILE *)usalp->errfile, "scsi_status: %X\n", req.sr_scsi_status);
+		fprintf((FILE *)usalp->errfile, "dma_xfer:    %d\n", req.sr_dma_xfr);
 	}
 	sp->u_scb.cmd_scb[0] = req.sr_scsi_status;
 	sp->sense_count = sizeof (esense_reply_t);

Modified: cdrkit/trunk/libusal/scsi-openserver.c
===================================================================
--- cdrkit/trunk/libusal/scsi-openserver.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libusal/scsi-openserver.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -373,7 +373,7 @@
 	environ = 0;
 	if ((cmd = popen(SCSI_CFG, "r")) == NULL) {
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Error popen() for \"%s\"",
 				SCSI_CFG);
 		environ = evsave;
@@ -384,7 +384,7 @@
 	if (fgets(lines, MAXLINE, cmd) == NULL) {
 		errno = EIO;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Error reading popen() for \"%s\"",
 				SCSI_CFG);
 		return (-1);
@@ -392,14 +392,14 @@
 		nlm = atoi(lines);
 
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile, "-------------------- \n");
-		js_fprintf((FILE *)usalp->errfile, "mscsi lines = %d\n", nlm);
-		js_fprintf((FILE *)usalp->errfile, "-------------------- \n");
+		fprintf((FILE *)usalp->errfile, "-------------------- \n");
+		fprintf((FILE *)usalp->errfile, "mscsi lines = %d\n", nlm);
+		fprintf((FILE *)usalp->errfile, "-------------------- \n");
 	}
 
 	if (pclose(cmd) == -1) {
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Error pclose() for \"%s\"",
 				SCSI_CFG);
 		return (-1);
@@ -423,14 +423,14 @@
 		/* the order the lines will be received in will determine */
 		/* the device name we can use to open the device	  */
 
-		js_snprintf(sconf, sizeof (sconf),
+		snprintf(sconf, sizeof (sconf),
 			SCSI_DEV, l + 1); /* enumeration starts with 1 */
 
 		evsave = environ;
 		environ = 0;
 		if ((cmd = popen(sconf, "r")) == NULL) {
 			if (usalp->errstr)
-				js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+				snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 					"Error popen() for \"%s\"",
 					sconf);
 			environ = evsave;
@@ -443,7 +443,7 @@
 
 		if (pclose(cmd) == -1) {
 			if (usalp->errstr)
-				js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+				snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 					"Error pclose() for \"%s\"",
 					sconf);
 			return (-1);
@@ -457,27 +457,27 @@
 					&cmtbl[l].lun);
 
 		if (strstr(cmtbl[l].typ, T_DISK) != NULL) {
-			js_snprintf(cmtbl[l].dev,  sizeof (cmtbl[l].dev),
+			snprintf(cmtbl[l].dev,  sizeof (cmtbl[l].dev),
 					DEV_SDSK, ++nSdsk);
 		}
 
 		if (strstr(cmtbl[l].typ, T_CDROM) != NULL) {
-			js_snprintf(cmtbl[l].dev,  sizeof (cmtbl[l].dev),
+			snprintf(cmtbl[l].dev,  sizeof (cmtbl[l].dev),
 					DEV_SROM, ++nSrom);
 		}
 
 		if (strstr(cmtbl[l].typ, T_TAPE) != NULL) {
-			js_snprintf(cmtbl[l].dev, sizeof (cmtbl[l].dev),
+			snprintf(cmtbl[l].dev, sizeof (cmtbl[l].dev),
 					DEV_STP, ++nStp);
 		}
 
 		if (strstr(cmtbl[l].typ, T_FLOPPY) != NULL) {
-			js_snprintf(cmtbl[l].dev, sizeof (cmtbl[l].dev),
+			snprintf(cmtbl[l].dev, sizeof (cmtbl[l].dev),
 					DEV_SFLP, ++nSflp);
 		}
 
 		if (usalp->debug > 0) {
-			js_fprintf((FILE *)usalp->errfile,
+			fprintf((FILE *)usalp->errfile,
 				"%-4s = %5s(%d,%d,%d,%d) -> %s\n",
 				cmtbl[l].typ,
 				cmtbl[l].drv,
@@ -491,12 +491,12 @@
 	}
 
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile, "-------------------- \n");
-		js_fprintf((FILE *)usalp->errfile, "%2d DISK  \n", nSdsk + 1);
-		js_fprintf((FILE *)usalp->errfile, "%2d CD-ROM\n", nSrom + 1);
-		js_fprintf((FILE *)usalp->errfile, "%2d TAPE  \n", nStp  + 1);
-		js_fprintf((FILE *)usalp->errfile, "%2d FLOPPY\n", nSflp + 1);
-		js_fprintf((FILE *)usalp->errfile, "-------------------- \n");
+		fprintf((FILE *)usalp->errfile, "-------------------- \n");
+		fprintf((FILE *)usalp->errfile, "%2d DISK  \n", nSdsk + 1);
+		fprintf((FILE *)usalp->errfile, "%2d CD-ROM\n", nSrom + 1);
+		fprintf((FILE *)usalp->errfile, "%2d TAPE  \n", nStp  + 1);
+		fprintf((FILE *)usalp->errfile, "%2d FLOPPY\n", nSflp + 1);
+		fprintf((FILE *)usalp->errfile, "-------------------- \n");
 	}
 
 	/* ok, now let's sort this array of scsi devices	*/
@@ -505,7 +505,7 @@
 
 	if (usalp->debug > 0) {
 		for (l = 0; l < nlm; l++)
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"%-4s = %5s(%d,%d,%d,%d) -> %s\n",
 			cmtbl[l].typ,
 			cmtbl[l].drv,
@@ -514,7 +514,7 @@
 			cmtbl[l].tgt,
 			cmtbl[l].lun,
 			cmtbl[l].dev);
-		js_fprintf((FILE *)usalp->errfile, "-------------------- \n");
+		fprintf((FILE *)usalp->errfile, "-------------------- \n");
 	}
 
 	/* find root disk controller to make it usal 0		*/
@@ -543,7 +543,7 @@
 	}
 
 	if (!(ide_rootdisk) && (usalp->debug > 0)) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"root = %5s(%d,%d,%d,%d) -> %s\n",
 			cmtbl[t].drv,
 			cmtbl[t].hba,
@@ -551,7 +551,7 @@
 			cmtbl[t].tgt,
 			cmtbl[t].lun,
 			cmtbl[t].dev);
-		js_fprintf((FILE *)usalp->errfile, "-------------------- \n");
+		fprintf((FILE *)usalp->errfile, "-------------------- \n");
 	}
 
 	/* calculate usal from drv, hba and bus 			*/
@@ -629,7 +629,7 @@
 				if ((fd = open(dname, (O_RDONLY | O_NONBLOCK))) < 0) {
 					sdidevs[s][t][l].valid = 0;
 					if (usalp->debug > 0) {
-						js_fprintf((FILE *)usalp->errfile,
+						fprintf((FILE *)usalp->errfile,
 							"%5s(%d,%d,%d,%d) -> %s open() failed: errno = %d (%s)\n",
 							cmtbl[mscsi].drv,
 							cmtbl[mscsi].hba,
@@ -644,7 +644,7 @@
 				}
 
 				if (usalp->debug > 0) {
-					js_fprintf((FILE *)usalp->errfile,
+					fprintf((FILE *)usalp->errfile,
 						"%d,%d,%d => %5s(%d,%d,%d,%d) -> %d : %s \n",
 						s, t, l,
 						cmtbl[mscsi].drv,
@@ -665,9 +665,9 @@
 	}
 
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile, "-------------------- \n");
-		js_fprintf((FILE *)usalp->errfile, "nopen = %d devices   \n", nopen);
-		js_fprintf((FILE *)usalp->errfile, "-------------------- \n");
+		fprintf((FILE *)usalp->errfile, "-------------------- \n");
+		fprintf((FILE *)usalp->errfile, "nopen = %d devices   \n", nopen);
+		fprintf((FILE *)usalp->errfile, "-------------------- \n");
 	}
 
 	return (nopen);
@@ -687,7 +687,7 @@
 	if (busno >= MAX_SCG || tgt >= MAX_TGT || tlun >= MAX_LUN) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Illegal value for busno, target or lun '%d,%d,%d'",
 				busno, tgt, tlun);
 		return (-1);
@@ -709,7 +709,7 @@
 	if (*device != '\0') {		/* we don't allow old dev usage */
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 			"Open by 'devname' no longer supported on this OS");
 		return (-1);
 	}
@@ -759,7 +759,7 @@
 usalo_getbuf(SCSI *usalp, long amt)
 {
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"usalo_getbuf: %ld bytes\n", amt);
 	}
 	usalp->bufbase = valloc((size_t)(amt));
@@ -912,12 +912,12 @@
 
 		if (scsiusercmd) {	/* Use SCSIUSERCMD ioctl() */
 			if (usalp->debug > 1) {
-				js_fprintf((FILE *)usalp->errfile, "calling SCSIUSERCMD ioctl()\n");
+				fprintf((FILE *)usalp->errfile, "calling SCSIUSERCMD ioctl()\n");
 			}
 
 			if ((ioctlStatus = ioctl(usalp->fd, SCSIUSERCMD, &(scsi_cmd.cmd))) < 0) {
 				if (usalp->debug > 1) {
-					js_fprintf((FILE *)usalp->errfile, "returning from SCSIUSERCMD ioctl()\n");
+					fprintf((FILE *)usalp->errfile, "returning from SCSIUSERCMD ioctl()\n");
 				}
 				if (errno == EINTR)
 					continue;
@@ -932,7 +932,7 @@
 			}
 
 			if (usalp->debug > 1) {
-				js_fprintf((FILE *)usalp->errfile, "returning from SCSIUSERCMD ioctl()\n");
+				fprintf((FILE *)usalp->errfile, "returning from SCSIUSERCMD ioctl()\n");
 			}
 			cp_sco2usal(&scsi_cmd, sp);
 			sp->ux_errno = errno;
@@ -963,20 +963,20 @@
 
 			if (usalp->debug > 0) {
 				if (errno != 0)
-					js_fprintf((FILE *)usalp->errfile, "ux_errno: %d (%s) \n", sp->ux_errno, strerror(sp->ux_errno));
+					fprintf((FILE *)usalp->errfile, "ux_errno: %d (%s) \n", sp->ux_errno, strerror(sp->ux_errno));
 				if (sp->u_scb.cmd_scb[0] != 0)
-					js_fprintf((FILE *)usalp->errfile, "tgt_stat: %d \n", sp->u_scb.cmd_scb[0]);
+					fprintf((FILE *)usalp->errfile, "tgt_stat: %d \n", sp->u_scb.cmd_scb[0]);
 			}
 			break;
 
 		} else {		/* Use SCSIUSERCMD2 ioctl() */
 			if (usalp->debug > 1) {
-				js_fprintf((FILE *)usalp->errfile, "calling SCSIUSERCMD2 ioctl()\n");
+				fprintf((FILE *)usalp->errfile, "calling SCSIUSERCMD2 ioctl()\n");
 			}
 
 			if ((ioctlStatus = ioctl(usalp->fd, SCSIUSERCMD2, &scsi_cmd)) < 0) {
 				if (usalp->debug > 1) {
-					js_fprintf((FILE *)usalp->errfile, "returning from SCSIUSERCMD2 ioctl()\n");
+					fprintf((FILE *)usalp->errfile, "returning from SCSIUSERCMD2 ioctl()\n");
 				}
 				if (errno == EINTR)
 					continue;
@@ -990,7 +990,7 @@
 				return (0);
 			}
 			if (usalp->debug > 1) {
-				js_fprintf((FILE *)usalp->errfile, "returning from SCSIUSERCMD2 ioctl()\n");
+				fprintf((FILE *)usalp->errfile, "returning from SCSIUSERCMD2 ioctl()\n");
 			}
 
 			cp_sco2usal(&scsi_cmd, sp);
@@ -1004,9 +1004,9 @@
 
 			if (usalp->debug > 0) {
 				if (errno != 0)
-					js_fprintf((FILE *)usalp->errfile, "ux_errno: %d (%s) \n", sp->ux_errno, strerror(sp->ux_errno));
+					fprintf((FILE *)usalp->errfile, "ux_errno: %d (%s) \n", sp->ux_errno, strerror(sp->ux_errno));
 				if (sp->u_scb.cmd_scb[0] != 0)
-					js_fprintf((FILE *)usalp->errfile, "tgt_stat: %d \n", sp->u_scb.cmd_scb[0]);
+					fprintf((FILE *)usalp->errfile, "tgt_stat: %d \n", sp->u_scb.cmd_scb[0]);
 			}
 			break;
 

Modified: cdrkit/trunk/libusal/scsi-os2.c
===================================================================
--- cdrkit/trunk/libusal/scsi-os2.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libusal/scsi-os2.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -107,7 +107,7 @@
 exit_func()
 {
 	if (!close_driver())
-		js_fprintf(stderr, "Cannot close OS/2-ASPI-Router!\n");
+		fprintf(stderr, "Cannot close OS/2-ASPI-Router!\n");
 }
 
 /*
@@ -154,7 +154,7 @@
 	if (busno >= MAX_SCG || tgt >= MAX_TGT || tlun >= MAX_LUN) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Illegal value for busno, target or lun '%d,%d,%d'",
 				busno, tgt, tlun);
 		return (-1);
@@ -163,7 +163,7 @@
 	if ((device != NULL && *device != '\0') || (busno == -2 && tgt == -2)) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Open by 'devname' not supported on this OS");
 		return (-1);
 	}
@@ -204,25 +204,25 @@
 	ULONG rc;
 
 #ifdef DEBUG
-	js_fprintf((FILE *)usalp->errfile, "usalo_getbuf: %ld bytes\n", amt);
+	fprintf((FILE *)usalp->errfile, "usalo_getbuf: %ld bytes\n", amt);
 #endif
 	rc = DosAllocMem(&buffer, amt, OBJ_TILE | PAG_READ | PAG_WRITE | PAG_COMMIT);
 
 	if (rc) {
-		js_fprintf((FILE *)usalp->errfile, "Cannot allocate buffer.\n");
+		fprintf((FILE *)usalp->errfile, "Cannot allocate buffer.\n");
 		return ((void *)0);
 	}
 	usalp->bufbase = buffer;
 
 #ifdef DEBUG
-	js_fprintf((FILE *)usalp->errfile, "Buffer allocated at: 0x%x\n", usalp->bufbase);
+	fprintf((FILE *)usalp->errfile, "Buffer allocated at: 0x%x\n", usalp->bufbase);
 #endif
 
 	/* Lock memory */
 	if (init_buffer(usalp->bufbase))
 		return (usalp->bufbase);
 
-	js_fprintf((FILE *)usalp->errfile, "Cannot lock memory buffer.\n");
+	fprintf((FILE *)usalp->errfile, "Cannot lock memory buffer.\n");
 	return ((void *)0); /* Error */
 }
 
@@ -230,7 +230,7 @@
 usalo_freebuf(SCSI *usalp)
 {
 	if (usalp->bufbase && DosFreeMem(usalp->bufbase)) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 		"Cannot free buffer memory for ASPI-Router!\n"); /* Free our memory buffer if not already done */
 	}
 	if (buffer == usalp->bufbase)
@@ -305,7 +305,7 @@
 	rc = DosDevIOCtl(driver_handle, 0x92, 0x02, (void*) &SRBlock, sizeof (SRB), &cbParam,
 			(void*) &SRBlock, sizeof (SRB), &cbreturn);
 	if (rc) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 				"DosDevIOCtl() failed in resetDevice.\n");
 		return (1);			/* DosDevIOCtl failed */
 	} else {
@@ -316,9 +316,9 @@
 	if (SRBlock.status != SRB_Done)
 		return (3);
 #ifdef DEBUG
-	js_fprintf((FILE *)usalp->errfile,
+	fprintf((FILE *)usalp->errfile,
 		"resetDevice of host: %d target: %d lun: %d successful.\n", usal_scsibus(usalp), usal_target(usalp), usal_lun(usalp));
-	js_fprintf((FILE *)usalp->errfile,
+	fprintf((FILE *)usalp->errfile,
 		"SRBlock.ha_status: 0x%x, SRBlock.target_status: 0x%x, SRBlock.satus: 0x%x\n",
 				SRBlock.u.cmd.ha_status, SRBlock.u.cmd.target_status, SRBlock.status);
 #endif
@@ -371,7 +371,7 @@
 	if (sp->cdb_len > sizeof (SRBlock.u.cmd.cdb_st)) { /* commandsize too big */
 		sp->error = SCG_FATAL;
 		sp->ux_errno = EINVAL;
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"sp->cdb_len > SRBlock.u.cmd.cdb_st. Fatal error in usalo_send, exiting...\n");
 		return (-1);
 	}
@@ -420,7 +420,7 @@
 			(void*) &SRBlock, sizeof (SRB), &cbreturn);
 
 	if (rc) {		/* An error occured */
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 				"DosDevIOCtl() in sendCommand failed.\n");
 		sp->error = SCG_FATAL;
 		sp->ux_errno = EIO;	/* Später vielleicht errno einsetzen */
@@ -433,13 +433,13 @@
 				/* Timeout */
 				sp->error = SCG_TIMEOUT;
 				sp->ux_errno = EIO;
-				js_fprintf((FILE *)usalp->errfile,
+				fprintf((FILE *)usalp->errfile,
 						"Timeout during SCSI-Command.\n");
 				return (1);
 			}
 			sp->error = SCG_FATAL;
 			sp->ux_errno = EIO;
-			js_fprintf((FILE *)usalp->errfile,
+			fprintf((FILE *)usalp->errfile,
 					"Fatal Error during DosWaitEventSem().\n");
 			return (1);
 		}
@@ -447,7 +447,7 @@
 		/* The command is processed */
 		if (SRBlock.status == SRB_Done) {	/* succesful completion */
 #ifdef DEBUG
-			js_fprintf((FILE *)usalp->errfile,
+			fprintf((FILE *)usalp->errfile,
 				"Command successful finished. SRBlock.status=0x%x\n\n", SRBlock.status);
 #endif
 			sp->sense_count = 0;
@@ -540,7 +540,7 @@
 			OPEN_SHARE_DENYREADWRITE | OPEN_ACCESS_READWRITE,
 			NULL);
 	if (rc) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 				"Cannot open ASPI-Router!\n");
 
 		return (FALSE);		/* opening failed -> return false*/
@@ -550,7 +550,7 @@
 	if (DosCreateEventSem(NULL, &postSema,	/* create event semaphore */
 				DC_SEM_SHARED, 0)) {
 		DosClose(driver_handle);
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 				"Cannot create event semaphore!\n");
 
 		return (FALSE);
@@ -591,9 +591,9 @@
 			return (FALSE);		/* closing failed -> return false */
 		driver_handle = 0;
 		if (DosCloseEventSem(postSema))
-			js_fprintf(stderr, "Cannot close event semaphore!\n");
+			fprintf(stderr, "Cannot close event semaphore!\n");
 		if (buffer && DosFreeMem(buffer)) {
-			js_fprintf(stderr,
+			fprintf(stderr,
 			"Cannot free buffer memory for ASPI-Router!\n"); /* Free our memory buffer if not already done */
 		}
 		buffer = NULL;

Modified: cdrkit/trunk/libusal/scsi-osf.c
===================================================================
--- cdrkit/trunk/libusal/scsi-osf.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libusal/scsi-osf.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -127,7 +127,7 @@
 	if (busno >= MAX_SCG || tgt >= MAX_TGT || tlun >= MAX_LUN) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Illegal value for busno, target or lun '%d,%d,%d'",
 				busno, tgt, tlun);
 		return (-1);
@@ -136,7 +136,7 @@
 	if ((device != NULL && *device != '\0') || (busno == -2 && tgt == -2)) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Open by 'devname' not supported on this OS");
 		return (-1);
 	}
@@ -160,7 +160,7 @@
 
 	if ((usallocal(usalp)->usalfile = open("/dev/cam", O_RDWR, 0)) < 0) {
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Cannot open '/dev/cam'");
 		return (-1);
 	}
@@ -257,7 +257,7 @@
 usalo_getbuf(SCSI *usalp, long amt)
 {
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"usalo_getbuf: %ld bytes\n", amt);
 	}
 	usalp->bufbase = valloc((size_t)(amt));

Modified: cdrkit/trunk/libusal/scsi-qnx.c
===================================================================
--- cdrkit/trunk/libusal/scsi-qnx.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libusal/scsi-qnx.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -115,7 +115,7 @@
 	if (device == NULL || *device == '\0') {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"'devname' must be specified on this OS");
 		return (-1);
 	}
@@ -132,7 +132,7 @@
 
 	if ((usallocal(usalp)->fd = open(device, O_RDONLY, 0)) < 0) {
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Cannot open '%s'", device);
 		return (-1);
 	}
@@ -168,7 +168,7 @@
 	void	*addr;
 
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile, "usalo_getbuf: %ld bytes\n", amt);
+		fprintf((FILE *)usalp->errfile, "usalo_getbuf: %ld bytes\n", amt);
 	}
 
 	if ((addr = mmap(NULL, amt, PROT_READ | PROT_WRITE | PROT_NOCACHE,

Modified: cdrkit/trunk/libusal/scsi-remote.c
===================================================================
--- cdrkit/trunk/libusal/scsi-remote.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libusal/scsi-remote.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -291,7 +291,7 @@
 	if (busno >= MAX_SCG || tgt >= MAX_TGT || tlun >= MAX_LUN) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 			"Illegal value for busno, target or lun '%d,%d,%d'",
 			busno, tgt, tlun);
 
@@ -315,7 +315,7 @@
 	if (device == NULL || (strncmp(device, "REMOTE", 6) != 0) ||
 				(device = strchr(device, ':')) == NULL) {
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Illegal remote device syntax");
 		return (-1);
 	}
@@ -323,7 +323,7 @@
 	/*
 	 * Save non user at host:device
 	 */
-	js_snprintf(devname, sizeof (devname), "%s", device);
+	snprintf(devname, sizeof (devname), "%s", device);
 
 	if ((p = strchr(devname, ':')) != NULL)
 		*p++ = '\0';
@@ -331,7 +331,7 @@
 	f = rscsigetconn(usalp, devname);
 	if (f < 0) {
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Cannot get connection to remote host");
 		return (-1);
 	}
@@ -557,7 +557,7 @@
 
 		if (d > sizeof (rscsiuser))
 			d = sizeof (rscsiuser);
-		js_snprintf(rscsiuser, sizeof (rscsiuser), "%.*s", (int)d, host);
+		snprintf(rscsiuser, sizeof (rscsiuser), "%.*s", (int)d, host);
 		name = rscsiuser;
 		host = &p[1];
 	} else {
@@ -599,7 +599,7 @@
 	char	*p;
 	int	ret;
 
-	js_snprintf(cbuf, sizeof (cbuf), "V%d\n", what);
+	snprintf(cbuf, sizeof (cbuf), "V%d\n", what);
 	ret = rscsicmd(usalp, fd, "version", cbuf);
 	p = malloc(ret);
 	if (p == NULL)
@@ -621,7 +621,7 @@
 	int	tgt;
 	int	lun;
 
-	js_snprintf(cbuf, sizeof (cbuf), "O%s\n", fname?fname:"");
+	snprintf(cbuf, sizeof (cbuf), "O%s\n", fname?fname:"");
 	ret = rscsicmd(usalp, fd, "open", cbuf);
 	if (ret < 0)
 		return (ret);
@@ -651,7 +651,7 @@
 {
 	char	cbuf[CMD_SIZE];
 
-	js_snprintf(cbuf, sizeof (cbuf), "D%ld\n", amt);
+	snprintf(cbuf, sizeof (cbuf), "D%ld\n", amt);
 	return (rscsicmd(usalp, fd, "maxdma", cbuf));
 }
 
@@ -665,7 +665,7 @@
 	int	size;
 	int	ret;
 
-	js_snprintf(cbuf, sizeof (cbuf), "M%ld\n", amt);
+	snprintf(cbuf, sizeof (cbuf), "M%ld\n", amt);
 	ret = rscsicmd(usalp, fd, "getbuf", cbuf);
 	if (ret < 0)
 		return (ret);
@@ -715,7 +715,7 @@
 {
 	char	cbuf[2*CMD_SIZE];
 
-	js_snprintf(cbuf, sizeof (cbuf), "B%d\n%d\n",
+	snprintf(cbuf, sizeof (cbuf), "B%d\n%d\n",
 		busno,
 		0);
 	return (rscsicmd(usalp, fd, "havebus", cbuf));
@@ -731,7 +731,7 @@
 {
 	char	cbuf[3*CMD_SIZE];
 
-	js_snprintf(cbuf, sizeof (cbuf), "T%d\n%d\n%d\n%d\n",
+	snprintf(cbuf, sizeof (cbuf), "T%d\n%d\n%d\n%d\n",
 		busno,
 		0,
 		tgt,
@@ -763,7 +763,7 @@
 {
 	char	cbuf[CMD_SIZE];
 
-	js_snprintf(cbuf, sizeof (cbuf), "R%d\n", what);
+	snprintf(cbuf, sizeof (cbuf), "R%d\n", what);
 	return (rscsicmd(usalp, fd, "reset", cbuf));
 }
 
@@ -778,7 +778,7 @@
 	int	amt = 0;
 	int	voidsize = 0;
 
-	ret = js_snprintf(cbuf, sizeof (cbuf), "S%d\n%d\n%d\n%d\n%d\n",
+	ret = snprintf(cbuf, sizeof (cbuf), "S%d\n%d\n%d\n%d\n%d\n",
 		sp->size, sp->flags,
 		sp->cdb_len, sp->sense_len,
 		sp->timeout);

Modified: cdrkit/trunk/libusal/scsi-sgi.c
===================================================================
--- cdrkit/trunk/libusal/scsi-sgi.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libusal/scsi-sgi.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -134,7 +134,7 @@
 	if (busno >= MAX_SCG || tgt >= MAX_TGT || tlun >= MAX_LUN) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Illegal value for busno, target or lun '%d,%d,%d'",
 				busno, tgt, tlun);
 		return (-1);
@@ -143,7 +143,7 @@
 	if ((device != NULL && *device != '\0') || (busno == -2 && tgt == -2)) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Open by 'devname' not supported on this OS");
 		return (-1);
 	}
@@ -163,7 +163,7 @@
 
 	if (busno >= 0 && tgt >= 0 && tlun >= 0) {
 
-		js_snprintf(devname, sizeof (devname),
+		snprintf(devname, sizeof (devname),
 				"/dev/scsi/sc%dd%dl%d", busno, tgt, tlun);
 #ifdef	USE_DSLIB
 		dsp = dsopen(devname, O_RDWR);
@@ -173,7 +173,7 @@
 		f = open(devname, O_RDWR);
 		if (f < 0) {
 			if (usalp->errstr)
-				js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+				snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 					"Cannot open '%s'",
 					devname);
 			return (-1);
@@ -189,7 +189,7 @@
 			for (t = 0; t < MAX_TGT; t++) {
 /*				for (l = 0; l < MAX_LUN; l++) {*/
 				for (l = 0; l < 1; l++) {
-					js_snprintf(devname, sizeof (devname),
+					snprintf(devname, sizeof (devname),
 							"/dev/scsi/sc%dd%dl%d", b, t, l);
 					f = open(devname, O_RDWR);
 					if (f >= 0) {
@@ -242,7 +242,7 @@
 usalo_getbuf(SCSI *usalp, long amt)
 {
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 				"usalo_getbuf: %ld bytes\n", amt);
 	}
 	usalp->bufbase = valloc((size_t)(amt));

Modified: cdrkit/trunk/libusal/scsi-sun.c
===================================================================
--- cdrkit/trunk/libusal/scsi-sun.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libusal/scsi-sun.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -206,7 +206,7 @@
 	if (busno >= MAX_SCG) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Illegal value for busno '%d'", busno);
 		return (-1);
 	}
@@ -218,7 +218,7 @@
 #else
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Open by 'devname' not supported on this OS");
 		return (-1);
 #endif
@@ -228,7 +228,7 @@
 		usalp->local = malloc(sizeof (struct usal_local));
 		if (usalp->local == NULL) {
 			if (usalp->errstr)
-				js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE, "No memory for usal_local");
+				snprintf(usalp->errstr, SCSI_ERRSTR_SIZE, "No memory for usal_local");
 			return (0);
 		}
 
@@ -244,12 +244,12 @@
 		 */
 		if (busno >= 0 && busno != i)
 			continue;
-		js_snprintf(devname, sizeof (devname), "/dev/usal%d", i);
+		snprintf(devname, sizeof (devname), "/dev/usal%d", i);
 		f = open(devname, O_RDWR);
 		if (f < 0) {
 			if (errno != ENOENT && errno != ENXIO) {
 				if (usalp->errstr)
-					js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+					snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 						"Cannot open '%s'", devname);
 				return (-1);
 			}
@@ -463,7 +463,7 @@
 		have_volmgt = volmgt_running();
 
 	if (usalp->overbose) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 				"Warning: Using USCSI interface.\n");
 	}
 #ifndef	SEEK_HOLE
@@ -473,7 +473,7 @@
 	 * seems to be the best guess.
 	 */
 	if (usalp->overbose > 0 && have_volmgt) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 		"Warning: Volume management is running, medialess managed drives are invisible.\n");
 	}
 #endif
@@ -481,7 +481,7 @@
 	if (busno >= MAX_SCG || tgt >= MAX_TGT || tlun >= MAX_LUN) {
 		errno = EINVAL;
 		if (usalp->errstr) {
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Illegal value for busno, target or lun '%d,%d,%d'",
 					busno, tgt, tlun);
 		}
@@ -491,7 +491,7 @@
 		usalp->local = malloc(sizeof (struct usal_local));
 		if (usalp->local == NULL) {
 			if (usalp->errstr)
-				js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE, "No memory for usal_local");
+				snprintf(usalp->errstr, SCSI_ERRSTR_SIZE, "No memory for usal_local");
 			return (0);
 		}
 
@@ -515,13 +515,13 @@
 		if (busno >= MAX_SCG || tgt >= MAX_TGT || tlun >= MAX_LUN)
 			return (-1);
 
-		js_snprintf(devname, sizeof (devname), "/dev/rdsk/c%dt%dd%ds2",
+		snprintf(devname, sizeof (devname), "/dev/rdsk/c%dt%dd%ds2",
 			busno, tgt, tlun);
 		f = open(devname, O_RDONLY | O_NDELAY);
 		if (f < 0 && geterrno() == EBUSY)
 			f = usalo_volopen(usalp, devname);
 		if (f < 0) {
-			js_snprintf(usalp->errstr,
+			snprintf(usalp->errstr,
 				    SCSI_ERRSTR_SIZE,
 				"Cannot open '%s'", devname);
 			return (0);
@@ -533,7 +533,7 @@
 		for (b = 0; b < MAX_SCG; b++) {
 			for (t = 0; t < MAX_TGT; t++) {
 				for (l = 0; l < MAX_LUN; l++) {
-					js_snprintf(devname, sizeof (devname),
+					snprintf(devname, sizeof (devname),
 						"/dev/rdsk/c%dt%dd%ds2",
 						b, t, l);
 					f = open(devname, O_RDONLY | O_NDELAY);
@@ -551,7 +551,7 @@
 						    errno != ENXIO &&
 						    errno != ENODEV) {
 						if (usalp->errstr)
-							js_snprintf(usalp->errstr,
+							snprintf(usalp->errstr,
 							    SCSI_ERRSTR_SIZE,
 							    "Cannot open '%s'", devname);
 					}
@@ -582,7 +582,7 @@
 		if (f < 0)
 			f = usalo_volopen(usalp, device);
 		if (f < 0) {
-			js_snprintf(usalp->errstr,
+			snprintf(usalp->errstr,
 				    SCSI_ERRSTR_SIZE,
 				"Cannot open '%s'", device);
 			return (0);
@@ -632,7 +632,7 @@
 	usalp->debug++;
 #endif
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"usalo_volopen(%s)\n", devname);
 	}
 
@@ -645,7 +645,7 @@
 	if (symdev)
 		name = volmgt_symname(symdev);
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"volmgt_symdev(%s)=%s -> %s\n", devname, symdev, name);
 	}
 
@@ -660,7 +660,7 @@
 			symdev = volmgt_symdev(name);
 	}
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"volmgt_symdev(%s)=%s -> %s\n", devname, symdev, name);
 	}
 
@@ -672,7 +672,7 @@
 	if (name)
 		mname = media_findname(name);
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"symdev %s name %s mname %s\n", symdev, name, mname);
 	}
 
@@ -680,7 +680,7 @@
 	 * Das scheint nur mit dem normierten /dev/rdsk/ *s2 Namen zu gehen.
 	 */
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"volmgt_inuse(%s) %d\n", symdev, volmgt_inuse(symdev));
 	}
 	if (mname)
@@ -728,7 +728,7 @@
 			/*
 			 * First check partition '2', the whole disk.
 			 */
-			js_snprintf(name, sizeof (name), "%s/s2", mname);
+			snprintf(name, sizeof (name), "%s/s2", mname);
 			f = open(name, O_RDONLY | O_NDELAY);
 			if (f >= 0)
 				return (f);
@@ -738,7 +738,7 @@
 			for (i = 0; i < 16; i++) {
 				if (i == 2)
 					continue;
-				js_snprintf(name, sizeof (name),
+				snprintf(name, sizeof (name),
 							"%s/s%d", mname, i);
 				if (stat(name, &sb) >= 0)
 					break;
@@ -790,23 +790,23 @@
 	if (debug <= 0)
 		return (0);
 
-	js_fprintf(stderr, "cname:		'%s'\n", cp->dki_cname);
-	js_fprintf(stderr, "ctype:		0x%04hX %hd\n", cp->dki_ctype, cp->dki_ctype);
-	js_fprintf(stderr, "cflags:		0x%04hX\n", cp->dki_flags);
-	js_fprintf(stderr, "cnum:		%hd\n", cp->dki_cnum);
+	fprintf(stderr, "cname:		'%s'\n", cp->dki_cname);
+	fprintf(stderr, "ctype:		0x%04hX %hd\n", cp->dki_ctype, cp->dki_ctype);
+	fprintf(stderr, "cflags:		0x%04hX\n", cp->dki_flags);
+	fprintf(stderr, "cnum:		%hd\n", cp->dki_cnum);
 #ifdef	__EVER__
-	js_fprintf(stderr, "addr:		%d\n", cp->dki_addr);
-	js_fprintf(stderr, "space:		%d\n", cp->dki_space);
-	js_fprintf(stderr, "prio:		%d\n", cp->dki_prio);
-	js_fprintf(stderr, "vec:		%d\n", cp->dki_vec);
+	fprintf(stderr, "addr:		%d\n", cp->dki_addr);
+	fprintf(stderr, "space:		%d\n", cp->dki_space);
+	fprintf(stderr, "prio:		%d\n", cp->dki_prio);
+	fprintf(stderr, "vec:		%d\n", cp->dki_vec);
 #endif
-	js_fprintf(stderr, "dname:		'%s'\n", cp->dki_dname);
-	js_fprintf(stderr, "unit:		%d\n", cp->dki_unit);
-	js_fprintf(stderr, "slave:		%d %04o Tgt: %d Lun: %d\n",
+	fprintf(stderr, "dname:		'%s'\n", cp->dki_dname);
+	fprintf(stderr, "unit:		%d\n", cp->dki_unit);
+	fprintf(stderr, "slave:		%d %04o Tgt: %d Lun: %d\n",
 				cp->dki_slave, cp->dki_slave,
 				TARGET(cp->dki_slave), LUN(cp->dki_slave));
-	js_fprintf(stderr, "partition:	%hd\n", cp->dki_partition);
-	js_fprintf(stderr, "maxtransfer:	%d (%d)\n",
+	fprintf(stderr, "partition:	%hd\n", cp->dki_partition);
+	fprintf(stderr, "maxtransfer:	%d (%d)\n",
 				cp->dki_maxtransfer,
 				cp->dki_maxtransfer * DEV_BSIZE);
 	return (0);
@@ -917,7 +917,7 @@
 
 	for (b = 0; b < 5; b++) {
 		for (t = 0; t < 2; t++) {
-			js_snprintf(buf, sizeof (buf),
+			snprintf(buf, sizeof (buf),
 				"/dev/rdsk/c%dd%dp0", b, t);
 			if ((f = open(buf, O_RDONLY | O_NDELAY)) >= 0)
 				goto out;
@@ -974,7 +974,7 @@
 	if (ioctl(usalp->fd, DKIOCINFO, &ci) < 0)
 		return (-1);
 
-	js_snprintf(devname, sizeof (devname), "/dev/rdsk/c%dt%dd%ds2",
+	snprintf(devname, sizeof (devname), "/dev/rdsk/c%dt%dd%ds2",
 		usal_scsibus(usalp), usal_target(usalp), usal_lun(usalp));
 
 	symlinkname[0] = '\0';
@@ -1055,32 +1055,32 @@
 		seteuid(cureuid);
 
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile, "ret: %d errno: %d (%s)\n", ret, errno, errmsgstr(errno));
-		js_fprintf((FILE *)usalp->errfile, "uscsi_flags:     0x%x\n", req.uscsi_flags);
-		js_fprintf((FILE *)usalp->errfile, "uscsi_status:    0x%x\n", req.uscsi_status);
-		js_fprintf((FILE *)usalp->errfile, "uscsi_timeout:   %d\n", req.uscsi_timeout);
-		js_fprintf((FILE *)usalp->errfile, "uscsi_bufaddr:   0x%lx\n", (long)req.uscsi_bufaddr);
+		fprintf((FILE *)usalp->errfile, "ret: %d errno: %d (%s)\n", ret, errno, errmsgstr(errno));
+		fprintf((FILE *)usalp->errfile, "uscsi_flags:     0x%x\n", req.uscsi_flags);
+		fprintf((FILE *)usalp->errfile, "uscsi_status:    0x%x\n", req.uscsi_status);
+		fprintf((FILE *)usalp->errfile, "uscsi_timeout:   %d\n", req.uscsi_timeout);
+		fprintf((FILE *)usalp->errfile, "uscsi_bufaddr:   0x%lx\n", (long)req.uscsi_bufaddr);
 								/*
 								 * Cast auf int OK solange sp->size
 								 * auch ein int bleibt.
 								 */
-		js_fprintf((FILE *)usalp->errfile, "uscsi_buflen:    %d\n", (int)req.uscsi_buflen);
-		js_fprintf((FILE *)usalp->errfile, "uscsi_resid:     %d\n", (int)req.uscsi_resid);
-		js_fprintf((FILE *)usalp->errfile, "uscsi_rqlen:     %d\n", req.uscsi_rqlen);
-		js_fprintf((FILE *)usalp->errfile, "uscsi_rqstatus:  0x%x\n", req.uscsi_rqstatus);
-		js_fprintf((FILE *)usalp->errfile, "uscsi_rqresid:   %d\n", req.uscsi_rqresid);
-		js_fprintf((FILE *)usalp->errfile, "uscsi_rqbuf ptr: 0x%lx\n", (long)req.uscsi_rqbuf);
-		js_fprintf((FILE *)usalp->errfile, "uscsi_rqbuf:     ");
+		fprintf((FILE *)usalp->errfile, "uscsi_buflen:    %d\n", (int)req.uscsi_buflen);
+		fprintf((FILE *)usalp->errfile, "uscsi_resid:     %d\n", (int)req.uscsi_resid);
+		fprintf((FILE *)usalp->errfile, "uscsi_rqlen:     %d\n", req.uscsi_rqlen);
+		fprintf((FILE *)usalp->errfile, "uscsi_rqstatus:  0x%x\n", req.uscsi_rqstatus);
+		fprintf((FILE *)usalp->errfile, "uscsi_rqresid:   %d\n", req.uscsi_rqresid);
+		fprintf((FILE *)usalp->errfile, "uscsi_rqbuf ptr: 0x%lx\n", (long)req.uscsi_rqbuf);
+		fprintf((FILE *)usalp->errfile, "uscsi_rqbuf:     ");
 		if (req.uscsi_rqbuf != NULL && req.uscsi_rqlen > req.uscsi_rqresid) {
 			int	i;
 			int	len = req.uscsi_rqlen - req.uscsi_rqresid;
 
 			for (i = 0; i < len; i++) {
-				js_fprintf((FILE *)usalp->errfile, "0x%02X ", ((char *)req.uscsi_rqbuf)[i]);
+				fprintf((FILE *)usalp->errfile, "0x%02X ", ((char *)req.uscsi_rqbuf)[i]);
 			}
-			js_fprintf((FILE *)usalp->errfile, "\n");
+			fprintf((FILE *)usalp->errfile, "\n");
 		} else {
-			js_fprintf((FILE *)usalp->errfile, "<data not available>\n");
+			fprintf((FILE *)usalp->errfile, "<data not available>\n");
 		}
 	}
 	if (ret < 0) {
@@ -1090,7 +1090,7 @@
 		 */
 		if (sp->ux_errno == ENOTTY && usalo_uisatapi(usalp) == TRUE) {
 			if (usalp->debug > 0) {
-				js_fprintf((FILE *)usalp->errfile,
+				fprintf((FILE *)usalp->errfile,
 					"ENOTTY atapi: %d\n", usalo_uisatapi(usalp));
 			}
 			sp->error = SCG_FATAL;

Modified: cdrkit/trunk/libusal/scsi-unixware.c
===================================================================
--- cdrkit/trunk/libusal/scsi-unixware.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libusal/scsi-unixware.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -212,7 +212,7 @@
 
 	if (stat(PRIM_HBA, &stbuf) < 0) {
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Can not stat() primary hba (%s)",
 				PRIM_HBA);
 		return (-1);
@@ -220,7 +220,7 @@
 
 	if (!S_ISCHR(stbuf.st_mode)) {
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Primary hba (%s) not a character device",
 				PRIM_HBA);
 		return (-1);
@@ -243,7 +243,7 @@
 	environ = 0;
 	if ((cmd = xpopen(SCSI_CFG, "r")) == NULL) {
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Error popen() for \"%s\"",
 				SCSI_CFG);
 		environ = evsave;
@@ -278,7 +278,7 @@
 		strncpy(ident, &lines[pos], len);
 
 		if (usalp->debug > 0) {
-			js_fprintf((FILE *)usalp->errfile,
+			fprintf((FILE *)usalp->errfile,
 				"SDI -> %d:%d,%d,%d: %-7s : %s\n",
 				hba, bus, tgt, lun, class, ident);
 		}
@@ -340,11 +340,11 @@
 		strcpy(sdidevs[usal][tgt][lun].type, class);
 		strcpy(sdidevs[usal][tgt][lun].vend, ident);
 
-		js_snprintf(sdidevs[usal][tgt][lun].devn,
+		snprintf(sdidevs[usal][tgt][lun].devn,
 				sizeof (sdidevs[usal][tgt][lun].devn),
 				DEV_NAME, usal, tgt, lun);
 #endif
-		js_snprintf(devnm, sizeof (devnm),
+		snprintf(devnm, sizeof (devnm),
 				DEV_NAME, usal, tgt, lun);
 
 		minor = SDI_MINOR(hba, tgt, lun, bus);
@@ -356,7 +356,7 @@
 
 		if (usalp->debug > 0) {
 
-			js_fprintf((FILE *)usalp->errfile,
+			fprintf((FILE *)usalp->errfile,
 			"h = %d; b = %d, s = %d, t = %d, l = %d, a = %d, ma = %d, mi = %2d, dev = '%s', id = '%s'\n",
 			hba, bus, usal, tgt, lun,
 			(sdidevs[usal][tgt][lun].flags & SDI_ATAPI) != 0,
@@ -371,7 +371,7 @@
 
 	if (xpclose(cmd) == -1) {
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Error pclose() for \"%s\"",
 				SCSI_CFG);
 		return (-1);
@@ -395,11 +395,11 @@
 
 				/* Make pass-through interface device node */
 
-				js_snprintf(devnm,
+				snprintf(devnm,
 					sizeof (devnm),
 					DEV_NAME, s, t, l);
 
-				js_snprintf(dname, sizeof (dname),
+				snprintf(dname, sizeof (dname),
 					"%s/%s", DEV_DIR, devnm);
 
 				ptdev = sdidevs[s][t][l].node;
@@ -410,13 +410,13 @@
 
 						if (mknod(dname, S_IFCHR | 0700, ptdev) < 0) {
 							if (usalp->errstr)
-								js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+								snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 									"mknod() error for \"%s\"", dname);
 							return (-1);
 						}
 					} else {
 						if (usalp->errstr)
-							js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+							snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 								"mknod() error for \"%s\"", dname);
 						return (-1);
 					}
@@ -433,7 +433,7 @@
 						fd = sdidevs[s][t][l].fd;
 					} else {
 						if (usalp->errstr)
-							js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+							snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 								"can not open pass-through %s", dname);
 						return (-1);
 					}
@@ -451,7 +451,7 @@
 
 				if (usalp->debug > 0) {
 
-					js_fprintf((FILE *)usalp->errfile,
+					fprintf((FILE *)usalp->errfile,
 						"s = %d, t = %d, l = %d, dev = %s, fd = %d\n",
 						s, t, l,
 						devnm,
@@ -477,7 +477,7 @@
 	if (busno >= MAX_SCG || tgt >= MAX_TGT || tlun >= MAX_LUN) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Illegal value for busno, target or lun '%d,%d,%d'",
 				busno, tgt, tlun);
 		return (-1);
@@ -514,7 +514,7 @@
 	if (*device != '\0') {		/* we don't allow old dev usage */
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 			"Open by 'devname' no longer supported on this OS");
 		return (-1);
 	} else {			/* this is the new stuff	 */
@@ -574,7 +574,7 @@
 usalo_getbuf(SCSI *usalp, long amt)
 {
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"usalo_getbuf: %ld bytes\n", amt);
 	}
 	usalp->bufbase = (void *) valloc((size_t)(amt));
@@ -640,7 +640,7 @@
 		for (l = 0; l < MAX_LUN; l++)
 			if ((sdidevs[busno][t][l].flags & SDI_INITIATOR) != 0) {
 				if (usalp->debug > 0) {
-					js_fprintf((FILE *)usalp->errfile,
+					fprintf((FILE *)usalp->errfile,
 						"usalo_initiator_id: id = %d\n", t);
 				}
 				return (t);

Modified: cdrkit/trunk/libusal/scsi-vms.c
===================================================================
--- cdrkit/trunk/libusal/scsi-vms.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libusal/scsi-vms.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -220,7 +220,7 @@
 	if (busno >= MAX_SCG || tgt >= MAX_TGT || tlun >= MAX_LUN) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Illegal value for busno, target or lun '%d,%d,%d'",
 				busno, tgt, tlun);
 		return (-1);
@@ -229,7 +229,7 @@
 	if ((device != NULL && *device != '\0') || (busno == -2 && tgt == -2)) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Open by 'devname' not supported on this OS");
 		return (-1);
 	}
@@ -239,7 +239,7 @@
 		 * but for now it is not possible.
 		 */
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Unable to scan on VMS");
 		return (0);
 	}
@@ -264,13 +264,13 @@
 	buschar1 = vmschar1[range];			/* get 2nd device char*/
 	buschar2 = vmschar2[range_offset];		/* get controller char*/
 
-	js_snprintf(devname, sizeof (devname), "%c%c%c%d0%d:",
+	snprintf(devname, sizeof (devname), "%c%c%c%d0%d:",
 					buschar, buschar1, buschar2,
 					tgt, tlun);
 	strcpy(gk_device, devname);
 	status = sys$assign(&gk_device_desc, &gk_chan, 0, 0);
 	if (!(status & 1)) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"Unable to access scsi-device \"%s\"\n", &gk_device[0]);
 		return (-1);
 	}
@@ -349,7 +349,7 @@
 usalo_getbuf(SCSI *usalp, long amt)
 {
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 				"usalo_getbuf: %ld bytes\n", amt);
 	}
 	usalp->bufbase = malloc((size_t)(amt));	/* XXX JS XXX valloc() ??? */
@@ -407,30 +407,30 @@
 	gk_desc.SCSI$L_RES_5 = 0;	/* Reserved */
 	gk_desc.SCSI$L_RES_6 = 0;	/* Reserved */
 	if (usalp->debug > 0) {
-		js_fprintf(fp, "***********************************************************\n");
-		js_fprintf(fp, "SCSI VMS-I/O parameters\n");
-		js_fprintf(fp, "OPCODE: %d", gk_desc.SCSI$L_OPCODE);
-		js_fprintf(fp, " FLAGS: %d\n", gk_desc.SCSI$L_FLAGS);
-		js_fprintf(fp, "CMD:");
+		fprintf(fp, "***********************************************************\n");
+		fprintf(fp, "SCSI VMS-I/O parameters\n");
+		fprintf(fp, "OPCODE: %d", gk_desc.SCSI$L_OPCODE);
+		fprintf(fp, " FLAGS: %d\n", gk_desc.SCSI$L_FLAGS);
+		fprintf(fp, "CMD:");
 		for (i = 0; i < gk_desc.SCSI$L_CMD_LEN; i++) {
-			js_fprintf(fp, "%x ", sp->cdb.cmd_cdb[i]);
+			fprintf(fp, "%x ", sp->cdb.cmd_cdb[i]);
 		}
-		js_fprintf(fp, "\n");
-		js_fprintf(fp, "DATA_LEN: %d\n", gk_desc.SCSI$L_DATA_LEN);
-		js_fprintf(fp, "PH_CH_TMOUT: %d", gk_desc.SCSI$L_PH_CH_TMOUT);
-		js_fprintf(fp, " DISCON_TMOUT: %d\n", gk_desc.SCSI$L_DISCON_TMOUT);
+		fprintf(fp, "\n");
+		fprintf(fp, "DATA_LEN: %d\n", gk_desc.SCSI$L_DATA_LEN);
+		fprintf(fp, "PH_CH_TMOUT: %d", gk_desc.SCSI$L_PH_CH_TMOUT);
+		fprintf(fp, " DISCON_TMOUT: %d\n", gk_desc.SCSI$L_DISCON_TMOUT);
 	}
 	status = sys$qiow(GK_EFN, gk_chan, IO$_DIAGNOSE, &gk_iosb, 0, 0,
 			&gk_desc, sizeof (gk_desc), 0, 0, 0, 0);
 
 
 	if (usalp->debug > 0) {
-		js_fprintf(fp, "qiow-status: %i\n", status);
-		js_fprintf(fp, "VMS status code %i\n", gk_iosb.SCSI$W_VMS_STAT);
-		js_fprintf(fp, "Actual #bytes transferred %i\n", gk_iosb.SCSI$L_IOSB_TFR_CNT);
-		js_fprintf(fp, "SCSI device status %i\n", gk_iosb.SCSI$B_IOSB_STS);
+		fprintf(fp, "qiow-status: %i\n", status);
+		fprintf(fp, "VMS status code %i\n", gk_iosb.SCSI$W_VMS_STAT);
+		fprintf(fp, "Actual #bytes transferred %i\n", gk_iosb.SCSI$L_IOSB_TFR_CNT);
+		fprintf(fp, "SCSI device status %i\n", gk_iosb.SCSI$B_IOSB_STS);
 		if (gk_iosb.SCSI$L_IOSB_TFR_CNT != gk_desc.SCSI$L_DATA_LEN) {
-			js_fprintf(fp, "#bytes transferred != DATA_LEN\n");
+			fprintf(fp, "#bytes transferred != DATA_LEN\n");
 		}
 	}
 
@@ -458,10 +458,10 @@
 	if (gk_iosb.SCSI$W_VMS_STAT == SS$_NORMAL && scsi_sts == 0) {
 		sp->error = SCG_NO_ERROR;
 		if (usalp->debug > 0) {
-			js_fprintf(fp, "scsi_sts == 0\n");
-			js_fprintf(fp, "gk_iosb.SCSI$B_IOSB_STS == 0\n");
-			js_fprintf(fp, "sp->error %i\n", sp->error);
-			js_fprintf(fp, "sp->resid %i\n", sp->resid);
+			fprintf(fp, "scsi_sts == 0\n");
+			fprintf(fp, "gk_iosb.SCSI$B_IOSB_STS == 0\n");
+			fprintf(fp, "sp->error %i\n", sp->error);
+			fprintf(fp, "sp->resid %i\n", sp->resid);
 		}
 		return (0);
 	}
@@ -471,30 +471,30 @@
 	if (severity == 4) {
 		sp->error = SCG_FATAL;
 		if (usalp->debug > 0) {
-			js_fprintf(fp, "scsi_sts & 2\n");
-			js_fprintf(fp, "gk_iosb.SCSI$B_IOSB_STS & 2\n");
-			js_fprintf(fp, "gk_iosb.SCSI$W_VMS_STAT & 0x7 == SS$_FATAL\n");
-			js_fprintf(fp, "sp->error %i\n", sp->error);
+			fprintf(fp, "scsi_sts & 2\n");
+			fprintf(fp, "gk_iosb.SCSI$B_IOSB_STS & 2\n");
+			fprintf(fp, "gk_iosb.SCSI$W_VMS_STAT & 0x7 == SS$_FATAL\n");
+			fprintf(fp, "sp->error %i\n", sp->error);
 		}
 		return (0);
 	}
 	if (gk_iosb.SCSI$W_VMS_STAT == SS$_TIMEOUT) {
 		sp->error = SCG_TIMEOUT;
 		if (usalp->debug > 0) {
-			js_fprintf(fp, "scsi_sts & 2\n");
-			js_fprintf(fp, "gk_iosb.SCSI$B_IOSB_STS & 2\n");
-			js_fprintf(fp, "gk_iosb.SCSI$W_VMS_STAT == SS$_TIMEOUT\n");
-			js_fprintf(fp, "sp->error %i\n", sp->error);
+			fprintf(fp, "scsi_sts & 2\n");
+			fprintf(fp, "gk_iosb.SCSI$B_IOSB_STS & 2\n");
+			fprintf(fp, "gk_iosb.SCSI$W_VMS_STAT == SS$_TIMEOUT\n");
+			fprintf(fp, "sp->error %i\n", sp->error);
 		}
 		return (0);
 	}
 	sp->error = SCG_RETRYABLE;
 	sp->u_scb.cmd_scb[0] = scsi_sts;
 	if (usalp->debug > 0) {
-		js_fprintf(fp, "scsi_sts & 2\n");
-		js_fprintf(fp, "gk_iosb.SCSI$B_IOSB_STS & 2\n");
-		js_fprintf(fp, "gk_iosb.SCSI$W_VMS_STAT != 0\n");
-		js_fprintf(fp, "sp->error %i\n", sp->error);
+		fprintf(fp, "scsi_sts & 2\n");
+		fprintf(fp, "gk_iosb.SCSI$B_IOSB_STS & 2\n");
+		fprintf(fp, "gk_iosb.SCSI$W_VMS_STAT != 0\n");
+		fprintf(fp, "sp->error %i\n", sp->error);
 	}
 	return (0);
 }

Modified: cdrkit/trunk/libusal/scsi-wnt.c
===================================================================
--- cdrkit/trunk/libusal/scsi-wnt.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libusal/scsi-wnt.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -227,7 +227,7 @@
 	sptihamax = 0;
 	i = 0;
 	do {
-		js_snprintf(adapter_name, sizeof (adapter_name), "\\\\.\\SCSI%d:", i);
+		snprintf(adapter_name, sizeof (adapter_name), "\\\\.\\SCSI%d:", i);
 		fh = CreateFile(adapter_name, GENERIC_READ | GENERIC_WRITE,
 						FILE_SHARE_READ | FILE_SHARE_WRITE,
 						NULL,
@@ -259,7 +259,7 @@
 		sptiglobal.drive[i].hDevice = INVALID_HANDLE_VALUE;
 
 	for (i = NUM_FLOPPY_DRIVES; i < NUM_MAX_NTSCSI_DRIVES; i++) {
-		js_snprintf(buf, sizeof (buf), "%c:\\", (char)('A'+i));
+		snprintf(buf, sizeof (buf), "%c:\\", (char)('A'+i));
 		uDriveType = GetDriveType(buf);
 #ifdef	CDROM_ONLY
 		if (uDriveType == DRIVE_CDROM) {
@@ -438,10 +438,10 @@
 		dwFlags |= GENERIC_WRITE;
 		dwAccessMode |= FILE_SHARE_WRITE;
 #ifdef _DEBUG_SCSIPT
-		js_fprintf(usalp_errfile, "SPTI: GetFileHandle(): Setting for Win2K\n");
+		fprintf(usalp_errfile, "SPTI: GetFileHandle(): Setting for Win2K\n");
 #endif
 	}
-	js_snprintf(buf, sizeof (buf), "\\\\.\\%c:", (char)('A'+i));
+	snprintf(buf, sizeof (buf), "\\\\.\\%c:", (char)('A'+i));
 #ifdef CREATE_NONSHARED
 	if (openshared) {
 		fh = CreateFile(buf, dwFlags, dwAccessMode, NULL,
@@ -476,9 +476,9 @@
 	}
 #ifdef _DEBUG_SCSIPT
 	if (fh == INVALID_HANDLE_VALUE)
-		js_fprintf(usalp_errfile, "SPTI: CreateFile() failed! -> %d\n", GetLastError());
+		fprintf(usalp_errfile, "SPTI: CreateFile() failed! -> %d\n", GetLastError());
 	else
-		js_fprintf(usalp_errfile, "SPTI: CreateFile() returned %d\n", GetLastError());
+		fprintf(usalp_errfile, "SPTI: CreateFile() returned %d\n", GetLastError());
 #endif
 
 	return (fh);
@@ -501,20 +501,20 @@
 	BYTE		inqData[NTSCSI_HA_INQUIRY_SIZE];
 
 #ifdef _DEBUG_SCSIPT
-	js_fprintf(usalp_errfile, "SPTI: Checking drive %c:", 'A'+i);
+	fprintf(usalp_errfile, "SPTI: Checking drive %c:", 'A'+i);
 #endif
 
 	fh = GetFileHandle(i, TRUE);	/* No NONSHARED Create for inquiry */
 
 	if (fh == INVALID_HANDLE_VALUE) {
 #ifdef _DEBUG_SCSIPT
-		js_fprintf(usalp_errfile, "       : fh == INVALID_HANDLE_VALUE\n");
+		fprintf(usalp_errfile, "       : fh == INVALID_HANDLE_VALUE\n");
 #endif
 		return;
 	}
 
 #ifdef _DEBUG_SCSIPT
-	js_fprintf(usalp_errfile, "       : Index %d: fh == %08X\n", i, fh);
+	fprintf(usalp_errfile, "       : Index %d: fh == %08X\n", i, fh);
 #endif
 
 
@@ -547,7 +547,7 @@
 	if (!status) {
 		CloseHandle(fh);
 #ifdef _DEBUG_SCSIPT
-		js_fprintf(usalp_errfile, "SPTI: Error DeviceIoControl() -> %d\n", GetLastError());
+		fprintf(usalp_errfile, "SPTI: Error DeviceIoControl() -> %d\n", GetLastError());
 #endif
 		return;
 	}
@@ -563,7 +563,7 @@
 			&scsiAddr, sizeof (SCSI_ADDRESS), &returned,
 			NULL)) {
 #ifdef _DEBUG_SCSIPT
-		js_fprintf(usalp_errfile, "Device %c: Port=%d, PathId=%d, TargetId=%d, Lun=%d\n",
+		fprintf(usalp_errfile, "Device %c: Port=%d, PathId=%d, TargetId=%d, Lun=%d\n",
 			(char)i+'A', scsiAddr.PortNumber, scsiAddr.PathId,
 			scsiAddr.TargetId, scsiAddr.Lun);
 #endif
@@ -586,18 +586,18 @@
 		pDrive->driveLetter = i;
 		pDrive->hDevice = INVALID_HANDLE_VALUE;
 #ifdef _DEBUG_SCSIPT
-		js_fprintf(usalp_errfile, "USB/Firewire Device %c: Port=%d, TargetId=%d, Lun=%d\n", (char)i+'A', i, 0, 0);
+		fprintf(usalp_errfile, "USB/Firewire Device %c: Port=%d, TargetId=%d, Lun=%d\n", (char)i+'A', i, 0, 0);
 #endif
 	} else {
 		pDrive->bUsed	= FALSE;
 #ifdef _DEBUG_SCSIPT
-		js_fprintf(usalp_errfile, "SPTI: Device %s: Error DeviceIoControl(): %d\n", (char)i+'A', GetLastError());
+		fprintf(usalp_errfile, "SPTI: Device %s: Error DeviceIoControl(): %d\n", (char)i+'A', GetLastError());
 #endif
 		CloseHandle(fh);
 		return;
 	}
 #ifdef _DEBUG_SCSIPT
-	js_fprintf(usalp_errfile,  "SPTI: Adding drive %c: (%d:%d:%d)\n", 'A'+i,
+	fprintf(usalp_errfile,  "SPTI: Adding drive %c: (%d:%d:%d)\n", 'A'+i,
 					pDrive->ha, pDrive->tgt, pDrive->lun);
 #endif
 	CloseHandle(fh);
@@ -637,7 +637,7 @@
 	BYTE	i;
 
 #ifdef _DEBUG_SCSIPT
-	js_fprintf(usalp_errfile,  "SPTI: SPTIGetDeviceIndex\n");
+	fprintf(usalp_errfile,  "SPTI: SPTIGetDeviceIndex\n");
 #endif
 
 	for (i = NUM_FLOPPY_DRIVES; i < NUM_MAX_NTSCSI_DRIVES; i++) {
@@ -701,8 +701,8 @@
 	length = sizeof (swb);
 
 #ifdef _DEBUG_SCSIPT
-	js_fprintf(usalp_errfile, "SPTI: SPTIExecSCSICmd: calling DeviceIoControl()");
-	js_fprintf(usalp_errfile, "       : cmd == 0x%02X", swb.spt.Cdb[0]);
+	fprintf(usalp_errfile, "SPTI: SPTIExecSCSICmd: calling DeviceIoControl()");
+	fprintf(usalp_errfile, "       : cmd == 0x%02X", swb.spt.Cdb[0]);
 #endif
 	status = DeviceIoControl(sptiglobal.drive[idx].hDevice,
 			    IOCTL_SCSI_PASS_THROUGH_DIRECT,
@@ -718,7 +718,7 @@
 	if (status && swb.spt.ScsiStatus == 0) {
 		lpsrb->SRB_Status = SS_COMP;
 #ifdef _DEBUG_SCSIPT
-		js_fprintf(usalp_errfile, "       : SRB_Status == SS_COMP\n");
+		fprintf(usalp_errfile, "       : SRB_Status == SS_COMP\n");
 #endif
 	} else {
 		DWORD	dwErrCode;
@@ -729,7 +729,7 @@
 
 		dwErrCode = GetLastError();
 #ifdef _DEBUG_SCSIPT
-		js_fprintf(usalp_errfile, "       : error == %d   handle == %08X\n", dwErrCode, sptiglobal.drive[idx].hDevice);
+		fprintf(usalp_errfile, "       : error == %d   handle == %08X\n", dwErrCode, sptiglobal.drive[idx].hDevice);
 #endif
 		/*
 		 * KLUDGE ALERT! KLUDGE ALERT! KLUDGE ALERT!
@@ -753,7 +753,7 @@
 				}
 			}
 #ifdef _DEBUG_SCSIPT
-			js_fprintf(usalp_errfile, "SPTI: SPTIExecSCSICommand: Retrying after ERROR_MEDIA_CHANGED\n");
+			fprintf(usalp_errfile, "SPTI: SPTIExecSCSICommand: Retrying after ERROR_MEDIA_CHANGED\n");
 #endif
 			return (SPTIExecSCSICommand(lpsrb, sptTimeOutValue, TRUE));
 		}
@@ -818,7 +818,7 @@
 	if (busno >= MAX_SCG || tgt >= MAX_TGT || tlun >= MAX_LUN) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Illegal value for busno, target or lun '%d,%d,%d'",
 				busno, tgt, tlun);
 		return (-1);
@@ -831,7 +831,7 @@
 	if ((device != NULL && *device != '\0') || (busno == -2 && tgt == -2)) {
 		errno = EINVAL;
 		if (usalp->errstr)
-			js_snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+			snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
 				"Open by 'devname' not supported on this OS");
 		return (-1);
 	}
@@ -847,7 +847,7 @@
 			bUsingSCSIPT = FALSE;
 
 		if (usalp->debug > 0) {
-			js_fprintf((FILE *)usalp->errfile,
+			fprintf((FILE *)usalp->errfile,
 				"usalo_open: Prefered SCSI transport: %s\n",
 					bUsingSCSIPT ? "SPTI":"ASPI");
 		}
@@ -859,7 +859,7 @@
 			bForceAccess = TRUE;
 		}
 		if (device != NULL && usalp->debug > 0) {
-			js_fprintf((FILE *)usalp->errfile,
+			fprintf((FILE *)usalp->errfile,
 				"usalo_open: Selected SCSI transport: %s\n",
 					bUsingSCSIPT ? "SPTI":"ASPI");
 		}
@@ -931,7 +931,7 @@
 usalo_getbuf(SCSI *usalp, long amt)
 {
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 				"usalo_getbuf: %ld bytes\n", amt);
 	}
 	usalp->bufbase = malloc((size_t)(amt));
@@ -1010,7 +1010,7 @@
 		return (-1);
 	}
 	if (bUsingSCSIPT) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 					"Reset SCSI device not implemented with SPTI\n");
 		return (-1);
 	}
@@ -1019,7 +1019,7 @@
 	 * XXX Does this reset TGT or BUS ???
 	 */
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 				"Attempting to reset SCSI device\n");
 	}
 
@@ -1027,7 +1027,7 @@
 	 * Check if ASPI library is loaded
 	 */
 	if (AspiLoaded <= 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 				"error in usalo_reset: ASPI driver not loaded !\n");
 		return (-1);
 	}
@@ -1082,7 +1082,7 @@
 	 * Check condition
 	 */
 	if (s.SRB_Status != SS_COMP) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 					"ERROR! 0x%08X\n", s.SRB_Status);
 
 		/*
@@ -1092,7 +1092,7 @@
 	}
 
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 					"Reset SCSI device completed\n");
 	}
 
@@ -1109,34 +1109,34 @@
 {
 	int i;
 
-	js_fprintf((FILE *)usalp->errfile, "\n\nDebugScsiSend\n");
-	js_fprintf((FILE *)usalp->errfile, "s->SRB_Cmd          = 0x%02x\n", s->SRB_Cmd);
-	js_fprintf((FILE *)usalp->errfile, "s->SRB_HaId         = 0x%02x\n", s->SRB_HaId);
-	js_fprintf((FILE *)usalp->errfile, "s->SRB_Flags        = 0x%02x\n", s->SRB_Flags);
-	js_fprintf((FILE *)usalp->errfile, "s->SRB_Target       = 0x%02x\n", s->SRB_Target);
-	js_fprintf((FILE *)usalp->errfile, "s->SRB_Lun          = 0x%02x\n", s->SRB_Lun);
-	js_fprintf((FILE *)usalp->errfile, "s->SRB_BufLen       = 0x%02x\n", s->SRB_BufLen);
-	js_fprintf((FILE *)usalp->errfile, "s->SRB_BufPointer   = %x\n",	   s->SRB_BufPointer);
-	js_fprintf((FILE *)usalp->errfile, "s->SRB_CDBLen       = 0x%02x\n", s->SRB_CDBLen);
-	js_fprintf((FILE *)usalp->errfile, "s->SRB_SenseLen     = 0x%02x\n", s->SRB_SenseLen);
-	js_fprintf((FILE *)usalp->errfile, "s->CDBByte          =");
+	fprintf((FILE *)usalp->errfile, "\n\nDebugScsiSend\n");
+	fprintf((FILE *)usalp->errfile, "s->SRB_Cmd          = 0x%02x\n", s->SRB_Cmd);
+	fprintf((FILE *)usalp->errfile, "s->SRB_HaId         = 0x%02x\n", s->SRB_HaId);
+	fprintf((FILE *)usalp->errfile, "s->SRB_Flags        = 0x%02x\n", s->SRB_Flags);
+	fprintf((FILE *)usalp->errfile, "s->SRB_Target       = 0x%02x\n", s->SRB_Target);
+	fprintf((FILE *)usalp->errfile, "s->SRB_Lun          = 0x%02x\n", s->SRB_Lun);
+	fprintf((FILE *)usalp->errfile, "s->SRB_BufLen       = 0x%02x\n", s->SRB_BufLen);
+	fprintf((FILE *)usalp->errfile, "s->SRB_BufPointer   = %x\n",	   s->SRB_BufPointer);
+	fprintf((FILE *)usalp->errfile, "s->SRB_CDBLen       = 0x%02x\n", s->SRB_CDBLen);
+	fprintf((FILE *)usalp->errfile, "s->SRB_SenseLen     = 0x%02x\n", s->SRB_SenseLen);
+	fprintf((FILE *)usalp->errfile, "s->CDBByte          =");
 	for (i = 0; i < min(s->SRB_CDBLen, 16); i++) {
-		js_fprintf((FILE *)usalp->errfile, " %02X ", s->CDBByte[i]);
+		fprintf((FILE *)usalp->errfile, " %02X ", s->CDBByte[i]);
 	}
-	js_fprintf((FILE *)usalp->errfile, "\n");
+	fprintf((FILE *)usalp->errfile, "\n");
 
 	/*
 	if (bDisplayBuffer != 0 && s->SRB_BufLen >= 8) {
 
-		js_fprintf((FILE *)usalp->errfile, "s->SRB_BufPointer   =");
+		fprintf((FILE *)usalp->errfile, "s->SRB_BufPointer   =");
 		for (i = 0; i < 8; i++) {
-			js_fprintf((FILE *)usalp->errfile,
+			fprintf((FILE *)usalp->errfile,
 					" %02X ", ((char *)s->SRB_BufPointer)[i]);
 		}
-		js_fprintf((FILE *)usalp->errfile, "\n");
+		fprintf((FILE *)usalp->errfile, "\n");
 	}
 */
-	js_fprintf((FILE *)usalp->errfile, "Debug done\n");
+	fprintf((FILE *)usalp->errfile, "Debug done\n");
 }
 #endif
 
@@ -1283,7 +1283,7 @@
 	if (sp->cdb_len > 16) {
 		sp->error = SCG_FATAL;
 		sp->ux_errno = EINVAL;
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"sp->cdb_len > sizeof (SRB_ExecSCSICmd.CDBByte). Fatal error in usalo_send, exiting...\n");
 		return (-1);
 	}
@@ -1358,7 +1358,7 @@
 
 		if (s->SRB_Status == SS_PENDING) { /* Check if we got a timeout */
 			if (usalp->debug > 0) {
-				js_fprintf((FILE *)usalp->errfile,
+				fprintf((FILE *)usalp->errfile,
 						"Timeout....\n");
 			}
 			scsiabort(usalp, s);
@@ -1376,7 +1376,7 @@
 	 */
 	if (s->SRB_Status != SS_COMP) {
 		if (usalp->debug > 0) {
-			js_fprintf((FILE *)usalp->errfile,
+			fprintf((FILE *)usalp->errfile,
 				"Error in usalo_send: s->SRB_Status is 0x%x\n", s->SRB_Status);
 		}
 
@@ -1384,7 +1384,7 @@
 		copy_sensedata(s, sp);		/* Copy sense and status    */
 
 		if (usalp->debug > 0) {
-			js_fprintf((FILE *)usalp->errfile,
+			fprintf((FILE *)usalp->errfile,
 				"Mapped to: error %d errno: %d\n", sp->error, sp->ux_errno);
 		}
 		return (1);
@@ -1417,7 +1417,7 @@
 	int	i;
 
 #ifdef DEBUG_WNTASPI
-	js_fprintf((FILE *)usalp->errfile, "enter open_driver\n");
+	fprintf((FILE *)usalp->errfile, "enter open_driver\n");
 #endif
 
 	/*
@@ -1460,14 +1460,14 @@
 			if (errno == 0)
 				errno = ENOSYS;
 		}
-		js_fprintf((FILE *)usalp->errfile, "Can not load %s driver! ",
+		fprintf((FILE *)usalp->errfile, "Can not load %s driver! ",
 						bUsingSCSIPT ? "SPTI":"ASPI");
 		return (FALSE);
 	}
 
 	if (bUsingSCSIPT) {
 		if (usalp->debug > 0)
-			js_fprintf((FILE *)usalp->errfile, "using SPTI Transport\n");
+			fprintf((FILE *)usalp->errfile, "using SPTI Transport\n");
 
 		if (!sptiglobal.numAdapters)
 			astatus = (DWORD)(MAKEWORD(0, SS_NO_ADAPTERS));
@@ -1481,20 +1481,20 @@
 	HACount    = LOBYTE(LOWORD(astatus));
 
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 			"open_driver %lX HostASPIStatus=0x%x HACount=0x%x\n", astatus, ASPIStatus, HACount);
 	}
 
 	if (ASPIStatus != SS_COMP && ASPIStatus != SS_NO_ADAPTERS) {
-		js_fprintf((FILE *)usalp->errfile, "Could not find any host adapters\n");
-		js_fprintf((FILE *)usalp->errfile, "ASPIStatus == 0x%02X", ASPIStatus);
+		fprintf((FILE *)usalp->errfile, "Could not find any host adapters\n");
+		fprintf((FILE *)usalp->errfile, "ASPIStatus == 0x%02X", ASPIStatus);
 		return (FALSE);
 	}
 	busses = HACount;
 
 #ifdef DEBUG_WNTASPI
-	js_fprintf((FILE *)usalp->errfile, "open_driver HostASPIStatus=0x%x HACount=0x%x\n", ASPIStatus, HACount);
-	js_fprintf((FILE *)usalp->errfile, "leaving open_driver\n");
+	fprintf((FILE *)usalp->errfile, "open_driver HostASPIStatus=0x%x HACount=0x%x\n", ASPIStatus, HACount);
+	fprintf((FILE *)usalp->errfile, "leaving open_driver\n");
 #endif
 
 	for (i = 0; i < busses; i++) {
@@ -1522,7 +1522,7 @@
 	 */
 	if (hAspiLib == NULL) {
 #ifdef	not_done_later
-		js_fprintf((FILE *)usalp->errfile, "Can not load ASPI driver! ");
+		fprintf((FILE *)usalp->errfile, "Can not load ASPI driver! ");
 #endif
 		return (FALSE);
 	}
@@ -1540,7 +1540,7 @@
 #endif
 
 	if ((pfnGetASPI32SupportInfo == NULL) || (pfnSendASPI32Command == NULL)) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 				"ASPI function not found in library! ");
 		return (FALSE);
 	}
@@ -1626,11 +1626,11 @@
 		Status = pfnSendASPI32Command((LPSRB)ip);
 
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile, "Status : %ld\n",	Status);
-		js_fprintf((FILE *)usalp->errfile, "hacount: %d\n", ip->HA_Count);
-		js_fprintf((FILE *)usalp->errfile, "SCSI id: %d\n", ip->HA_SCSI_ID);
-		js_fprintf((FILE *)usalp->errfile, "Manager: '%.16s'\n", ip->HA_ManagerId);
-		js_fprintf((FILE *)usalp->errfile, "Identif: '%.16s'\n", ip->HA_Identifier);
+		fprintf((FILE *)usalp->errfile, "Status : %ld\n",	Status);
+		fprintf((FILE *)usalp->errfile, "hacount: %d\n", ip->HA_Count);
+		fprintf((FILE *)usalp->errfile, "SCSI id: %d\n", ip->HA_SCSI_ID);
+		fprintf((FILE *)usalp->errfile, "Manager: '%.16s'\n", ip->HA_ManagerId);
+		fprintf((FILE *)usalp->errfile, "Identif: '%.16s'\n", ip->HA_Identifier);
 		usal_prbytes("Unique:", ip->HA_Unique, 16);
 	}
 	if (ip->SRB_Status != SS_COMP)
@@ -1647,12 +1647,12 @@
 	SRB_BusDeviceReset	s;
 
 	if (bUsingSCSIPT) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 					"Reset SCSI bus not implemented with SPTI\n");
 		return (FALSE);
 	}
 
-	js_fprintf((FILE *)usalp->errfile, "Attempting to reset SCSI bus\n");
+	fprintf((FILE *)usalp->errfile, "Attempting to reset SCSI bus\n");
 
 	Event = CreateEvent(NULL, TRUE, FALSE, NULL);
 
@@ -1693,7 +1693,7 @@
 	 * Check condition
 	 */
 	if (s.SRB_Status != SS_COMP) {
-		js_fprintf((FILE *)usalp->errfile, "ERROR  0x%08X\n", s.SRB_Status);
+		fprintf((FILE *)usalp->errfile, "ERROR  0x%08X\n", s.SRB_Status);
 
 		/*
 		 * Indicate that error has occured
@@ -1715,13 +1715,13 @@
 	SRB_Abort		s;
 
 	if (bUsingSCSIPT) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 					"Abort SCSI not implemented with SPTI\n");
 		return (FALSE);
 	}
 
 	if (usalp->debug > 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 				"Attempting to abort SCSI command\n");
 	}
 
@@ -1729,7 +1729,7 @@
 	 * Check if ASPI library is loaded
 	 */
 	if (AspiLoaded <= 0) {
-		js_fprintf((FILE *)usalp->errfile,
+		fprintf((FILE *)usalp->errfile,
 				"error in scsiabort: ASPI driver not loaded !\n");
 		return (FALSE);
 	}
@@ -1751,7 +1751,7 @@
 	 * Check condition
 	 */
 	if (s.SRB_Status != SS_COMP) {
-		js_fprintf((FILE *)usalp->errfile, "Abort ERROR! 0x%08X\n", s.SRB_Status);
+		fprintf((FILE *)usalp->errfile, "Abort ERROR! 0x%08X\n", s.SRB_Status);
 
 		/*
 		 * Indicate that error has occured
@@ -1760,7 +1760,7 @@
 	}
 
 	if (usalp->debug > 0)
-		js_fprintf((FILE *)usalp->errfile, "Abort SCSI command completed\n");
+		fprintf((FILE *)usalp->errfile, "Abort SCSI command completed\n");
 
 	/*
 	 * Everything went OK

Modified: cdrkit/trunk/libusal/scsierrs.c
===================================================================
--- cdrkit/trunk/libusal/scsierrs.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libusal/scsierrs.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -739,18 +739,18 @@
 			vec = sd_ccs_error_str;
 	}
 	if (code == 0x40) {
-		js_snprintf(sbuf, maxcnt,
+		snprintf(sbuf, maxcnt,
 			"diagnostic failure on component 0x%X", qual);
 		return (sbuf);
 	}
 	if (code == 0x4D) {
-		js_snprintf(sbuf, maxcnt,
+		snprintf(sbuf, maxcnt,
 			"tagged overlapped commands, queue tag is 0x%X",
 									qual);
 		return (sbuf);
 	}
 	if (code == 0x70) {
-		js_snprintf(sbuf, maxcnt,
+		snprintf(sbuf, maxcnt,
 			"decompression exception short algorithm id of 0x%X",
 									qual);
 		return (sbuf);
@@ -759,10 +759,10 @@
 		return ((char *)NULL);
 
 	if (code < 0x80) {
-		js_snprintf(sbuf, maxcnt, "invalid sense code 0x%X", code);
+		snprintf(sbuf, maxcnt, "invalid sense code 0x%X", code);
 		return (sbuf);
 	}
-	js_snprintf(sbuf, maxcnt, "vendor unique sense code 0x%X", code);
+	snprintf(sbuf, maxcnt, "vendor unique sense code 0x%X", code);
 	return (sbuf);
 }
 
@@ -843,7 +843,7 @@
 	}
 */
 	cmdname = "";
-	n = js_snprintf(obuf, sizeleft, "%sSense Key: 0x%X %s%s, Segment %d\n",
+	n = snprintf(obuf, sizeleft, "%sSense Key: 0x%X %s%s, Segment %d\n",
 		cmdname, key, sensekey,
 		(sense->code == 0x71)?", deferred error":"",
 		segment);
@@ -853,7 +853,7 @@
 	}
 	obuf += n;
 	sizeleft -= n;
-	n = js_snprintf(obuf, sizeleft, "Sense Code: 0x%02X Qual 0x%02X %s%s%s%s Fru 0x%X\n",
+	n = snprintf(obuf, sizeleft, "Sense Code: 0x%02X Qual 0x%02X %s%s%s%s Fru 0x%X\n",
 		code, qual, *sensemsg?"(":"", sensemsg, *sensemsg?")":"",
 		badqual? " [No matching qualifier]":"",
 		fru);
@@ -863,7 +863,7 @@
 	}
 	obuf += n;
 	sizeleft -= n;
-	n = js_snprintf(obuf, sizeleft, "Sense flags: Blk %d %s%s%s%s",
+	n = snprintf(obuf, sizeleft, "Sense flags: Blk %d %s%s%s%s",
 		blkno, blkvalid?"(valid) ":"(not valid) ",
 		fm?"file mark detected ":"",
 		eom?"end of medium ":"",
@@ -875,7 +875,7 @@
 	obuf += n;
 	sizeleft -= n;
 	if (!sksv) {
-		n = js_snprintf(obuf, sizeleft, "\n");
+		n = snprintf(obuf, sizeleft, "\n");
 		if (n <= 0) {
 			obuf[0] = '\0';
 			return (maxcnt - sizeleft);
@@ -887,7 +887,7 @@
 	switch (key) {
 
 	case SC_ILLEGAL_REQUEST:
-		n = js_snprintf(obuf, sizeleft, "error refers to %s part, bit ptr %d %s field ptr %d",
+		n = snprintf(obuf, sizeleft, "error refers to %s part, bit ptr %d %s field ptr %d",
 			ext_sense->cd? "command":"data",
 			(int)ext_sense->bptr,
 			ext_sense->bpv? "(valid)":"(not valid)",
@@ -904,7 +904,7 @@
 	case SC_RECOVERABLE_ERROR:
 	case SC_HARDWARE_ERROR:
 	case SC_MEDIUM_ERROR:
-		n = js_snprintf(obuf, sizeleft, "actual retry count %d",
+		n = snprintf(obuf, sizeleft, "actual retry count %d",
 			ext_sense->field_ptr[0] << 8 |
 			ext_sense->field_ptr[1]);
 		if (n <= 0) {
@@ -916,7 +916,7 @@
 		break;
 
 	case SC_NOT_READY:
-		n = js_snprintf(obuf, sizeleft, "operation %d%% done",
+		n = snprintf(obuf, sizeleft, "operation %d%% done",
 			(100*(ext_sense->field_ptr[0] << 8 |
 			      ext_sense->field_ptr[1]))/(unsigned)65536);
 		if (n < 0) {
@@ -927,7 +927,7 @@
 		sizeleft -= n;
 		break;
 	}
-	n = js_snprintf(obuf, sizeleft, "\n");
+	n = snprintf(obuf, sizeleft, "\n");
 	if (n <= 0) {
 		obuf[0] = '\0';
 		return (maxcnt - sizeleft);
@@ -965,14 +965,14 @@
 		break;
 #endif
 	}
-	js_printf("error code: 0x%x", code);
+	printf("error code: 0x%x", code);
 	if (vec == (char **)NULL)
 		return;
 
 	for (i = 0; i < 2; i++) {
 		while (*vec != (char *) NULL) {
 			if (code == (Uchar)*vec[0]) {
-				js_printf(" (%s)", (char *)((int)(*vec)+1));
+				printf(" (%s)", (char *)((int)(*vec)+1));
 				return;
 			} else
 				vec++;
@@ -989,18 +989,18 @@
 
 #ifdef ACB
 	for (i = 0; i < 0x30; i++) {
-/*		js_printf("Code: 0x%x	Key: 0x%x	", i, sd_adaptec_keys[i]);*/
-		js_printf("Key: 0x%x %-16s ", sd_adaptec_keys[i],
+/*		printf("Code: 0x%x	Key: 0x%x	", i, sd_adaptec_keys[i]);*/
+		printf("Key: 0x%x %-16s ", sd_adaptec_keys[i],
 					sd_sense_keys[sd_adaptec_keys[i]] );
 		js_print_err(i, CTYPE_ACB4000);
-		js_printf("\n");
+		printf("\n");
 	}
 #else
 /*	for (i = 0; i < 0x84; i++) {*/
 	for (i = 0; i < 0xd8; i++) {
 /*		print_err(i, CTYPE_SMO_C501);*/
 		print_err(i, DEV_CDD_521);
-		js_printf("\n");
+		printf("\n");
 	}
 #endif
 }

Modified: cdrkit/trunk/libusal/scsiopen.c
===================================================================
--- cdrkit/trunk/libusal/scsiopen.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libusal/scsiopen.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -124,7 +124,7 @@
 	usalp = usal_smalloc();
 	if (usalp == NULL) {
 		if (errs)
-			js_snprintf(errs, slen, "No memory for SCSI structure");
+			snprintf(errs, slen, "No memory for SCSI structure");
 		return ((SCSI *)0);
 	}
 	usalp->debug = debug;
@@ -228,7 +228,7 @@
 					if (*astoi(&devp[2], &lun) != '\0') {
 						errno = EINVAL;
 						if (errs)
-							js_snprintf(errs, slen,
+							snprintf(errs, slen,
 								"Invalid lun specifier '%s'",
 										&devp[2]);
 						return ((SCSI *)0);
@@ -279,24 +279,24 @@
 		/*
 		 * XXX May this happen after we allow tgt to repesent tgt,0 ?
 		 */
-		js_fprintf(stderr, "WARNING: device not valid, trying to use default target...\n");
+		fprintf(stderr, "WARNING: device not valid, trying to use default target...\n");
 		usal_settarget(usalp, 0, 6, 0);
 	}
 	if (be_verbose && scsidev != NULL) {
-		js_fprintf(stderr, "scsidev: '%s'\n", scsidev);
+		fprintf(stderr, "scsidev: '%s'\n", scsidev);
 		if (devname[0] != '\0')
-			js_fprintf(stderr, "devname: '%s'\n", devname);
-		js_fprintf(stderr, "scsibus: %d target: %d lun: %d\n",
+			fprintf(stderr, "devname: '%s'\n", devname);
+		fprintf(stderr, "scsibus: %d target: %d lun: %d\n",
 					usal_scsibus(usalp), usal_target(usalp), usal_lun(usalp));
 	}
 	if (debug > 0) {
-		js_fprintf(stderr, "usal__open(%s) %d,%d,%d\n",
+		fprintf(stderr, "usal__open(%s) %d,%d,%d\n",
 			devname,
 			usal_scsibus(usalp), usal_target(usalp), usal_lun(usalp));
 	}
 	if (usal__open(usalp, devname) <= 0) {
 		if (errs && usalp->errstr)
-			js_snprintf(errs, slen, "%s", usalp->errstr);
+			snprintf(errs, slen, "%s", usalp->errstr);
 		usal_sfree(usalp);
 		return ((SCSI *)0);
 	}
@@ -344,7 +344,7 @@
 			n++;
 		} else {
 			if (errs)
-				js_snprintf(errs, slen, "Invalid bus or target specifier in '%s'", devp);
+				snprintf(errs, slen, "Invalid bus or target specifier in '%s'", devp);
 			return (-1);
 		}
 	}
@@ -356,7 +356,7 @@
 			n++;
 		} else {
 			if (errs)
-				js_snprintf(errs, slen, "Invalid target or lun specifier in '%s'", devp);
+				snprintf(errs, slen, "Invalid target or lun specifier in '%s'", devp);
 			return (-1);
 		}
 	}
@@ -366,7 +366,7 @@
 			n++;
 		} else {
 			if (errs)
-				js_snprintf(errs, slen, "Invalid lun specifier in '%s'", devp);
+				snprintf(errs, slen, "Invalid lun specifier in '%s'", devp);
 			return (-1);
 		}
 	}
@@ -385,7 +385,7 @@
 
 	if (x1 < 0 || x2 < 0 || x3 < 0) {
 		if (errs)
-			js_snprintf(errs, slen, "Invalid value for bus, target or lun (%d,%d,%d)",
+			snprintf(errs, slen, "Invalid value for bus, target or lun (%d,%d,%d)",
 				*busp, *tgtp, *lunp);
 		return (-1);
 	}

Modified: cdrkit/trunk/libusal/scsitransp.c
===================================================================
--- cdrkit/trunk/libusal/scsitransp.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/libusal/scsitransp.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -296,7 +296,7 @@
 {
 	char okbuf[10];
 
-	js_printf("%s", msg);
+	printf("%s", msg);
 	flush();
 	if (getline(okbuf, sizeof (okbuf)) == EOF)
 		exit(EX_BAD);
@@ -311,10 +311,10 @@
 static void
 usal_sighandler(int sig)
 {
-	js_printf("\n");
+	printf("\n");
 	if (scsi_running) {
-		js_printf("Running command: %s\n", scsi_command);
-		js_printf("Resetting SCSI - Bus.\n");
+		printf("Running command: %s\n", scsi_command);
+		printf("Resetting SCSI - Bus.\n");
 		if (usal_reset(usalp) < 0)
 			errmsg("Cannot reset SCSI - Bus.\n");
 	}
@@ -419,7 +419,7 @@
 	if (usalp->verbose <= 0)
 		return (0);
 
-	amt = js_snprintf(p, maxcnt,
+	amt = snprintf(p, maxcnt,
 		"\nExecuting '%s' command on Bus %d Target %d, Lun %d timeout %ds\n",
 								/* XXX Really this ??? */
 /*		usalp->cmdname, usal_scsibus(usalp), usal_target(usalp), usalp->scmd->cdb.g0_cdb.lun,*/
@@ -491,13 +491,13 @@
 			 * A DMA residual count < 0 (-1) is a hint for a DMA
 			 * overrun but does not affect the transfer count.
 			 */
-			amt = js_snprintf(p, maxcnt, "DMA overrun, ");
+			amt = snprintf(p, maxcnt, "DMA overrun, ");
 			if (amt < 0)
 				return (amt);
 			p += amt;
 			maxcnt -= amt;
 		}
-		amt = js_snprintf(p, maxcnt, "resid: %d\n", usalp->scmd->resid);
+		amt = snprintf(p, maxcnt, "resid: %d\n", usalp->scmd->resid);
 		if (amt < 0)
 			return (amt);
 		p += amt;
@@ -669,23 +669,27 @@
 				 * We need to cast timeval->* to long because
 				 * of the broken sys/time.h in Linux.
 				 */
-	case SCG_TIMEOUT  :	js_snprintf(errbuf, sizeof (errbuf),
+	case SCG_TIMEOUT  :	snprintf(errbuf, sizeof (errbuf),
 					"cmd timeout after %ld.%03ld (%d) s",
 					(long)usalp->cmdstop->tv_sec,
 					(long)usalp->cmdstop->tv_usec/1000,
 								cp->timeout);
 				err = errbuf;
 				break;
-	default:		js_snprintf(errbuf, sizeof (errbuf),
+	default:		snprintf(errbuf, sizeof (errbuf),
 					"error: %d", cp->error);
 				err = errbuf;
 	}
 
 	if (usalp->cmdname != NULL && usalp->cmdname[0] != '\0')
 		cmdname = usalp->cmdname;
-	amt = serrmsgno(cp->ux_errno, p, maxcnt, "%s: scsi sendcmd: %s\n", cmdname, err);
+	/*amt = serrmsgno(cp->ux_errno, p, maxcnt, "%s: scsi sendcmd: %s\n", cmdname, err);
 	if (amt < 0)
 		return (amt);
+    */
+  amt=snprintf(p, maxcnt, "Errno: %d (%s), %s scsi sendcmd: %s\n", cp->ux_errno, strerror(cp->ux_errno), cmdname, err);
+  if(amt>=maxcnt || amt<0)
+     return (amt);
 	p += amt;
 	maxcnt -= amt;
 
@@ -756,7 +760,7 @@
 	register struct	usal_cmd	*scmd = usalp->scmd;
 
 	if (scmd->size > 0 && (scmd->flags & SCG_RECV_DATA) == 0) {
-		js_fprintf(stderr, "Sending %d (0x%X) bytes of data.\n",
+		fprintf(stderr, "Sending %d (0x%X) bytes of data.\n",
 			scmd->size, scmd->size);
 		usal_prbytes("Write Data: ",
 			(Uchar *)scmd->addr,
@@ -775,7 +779,7 @@
 	register int		amt;
 
 	if (scmd->size > 0 && (scmd->flags & SCG_RECV_DATA) == 0) {
-		amt = js_snprintf(p, maxcnt,
+		amt = snprintf(p, maxcnt,
 			"Sending %d (0x%X) bytes of data.\n",
 			scmd->size, scmd->size);
 		if (amt < 0)
@@ -804,7 +808,7 @@
 	register int		trcnt = usal_getdmacnt(usalp);
 
 	if (scmd->size > 0 && (scmd->flags & SCG_RECV_DATA) != 0) {
-		js_fprintf(stderr, "Got %d (0x%X), expecting %d (0x%X) bytes of data.\n",
+		fprintf(stderr, "Got %d (0x%X), expecting %d (0x%X) bytes of data.\n",
 			trcnt, trcnt,
 			scmd->size, scmd->size);
 		usal_prbytes("Received Data: ",
@@ -825,7 +829,7 @@
 	register int		trcnt = usal_getdmacnt(usalp);
 
 	if (scmd->size > 0 && (scmd->flags & SCG_RECV_DATA) != 0) {
-		amt = js_snprintf(p, maxcnt,
+		amt = snprintf(p, maxcnt,
 			"Got %d (0x%X), expecting %d (0x%X) bytes of data.\n",
 			trcnt, trcnt,
 			scmd->size, scmd->size);
@@ -852,7 +856,7 @@
 void
 usal_printresult(SCSI *usalp)
 {
-	js_fprintf(stderr, "cmd finished after %ld.%03lds timeout %ds\n",
+	fprintf(stderr, "cmd finished after %ld.%03lds timeout %ds\n",
 		(long)usalp->cmdstop->tv_sec,
 		(long)usalp->cmdstop->tv_usec/1000,
 		usalp->scmd->timeout);
@@ -870,7 +874,7 @@
 	register char		*p = buf;
 	register int		amt;
 
-	amt = js_snprintf(p, maxcnt,
+	amt = snprintf(p, maxcnt,
 		"cmd finished after %ld.%03lds timeout %ds\n",
 		(long)usalp->cmdstop->tv_sec,
 		(long)usalp->cmdstop->tv_usec/1000,
@@ -918,21 +922,21 @@
 	register char	*p = buf;
 	register int	amt;
 
-	amt = js_snprintf(p, maxcnt, "status: 0x%x ", *(Uchar *)&cp->scb);
+	amt = snprintf(p, maxcnt, "status: 0x%x ", *(Uchar *)&cp->scb);
 	if (amt < 0)
 		return (amt);
 	p += amt;
 	maxcnt -= amt;
 #ifdef	SCSI_EXTENDED_STATUS
 	if (cp->scb.ext_st1) {
-		amt = js_snprintf(p, maxcnt, "0x%x ", ((Uchar *)&cp->scb)[1]);
+		amt = snprintf(p, maxcnt, "0x%x ", ((Uchar *)&cp->scb)[1]);
 		if (amt < 0)
 			return (amt);
 		p += amt;
 		maxcnt -= amt;
 	}
 	if (cp->scb.ext_st2) {
-		amt = js_snprintf(p, maxcnt, "0x%x ", ((Uchar *)&cp->scb)[2]);
+		amt = snprintf(p, maxcnt, "0x%x ", ((Uchar *)&cp->scb)[2]);
 		if (amt < 0)
 			return (amt);
 		p += amt;
@@ -954,7 +958,7 @@
 	if (cp->scb.ext_st1 && cp->scb.ha_er)
 		err2 = " host adapter detected error";
 #endif
-	amt = js_snprintf(p, maxcnt, "(%s%s)\n", err, err2);
+	amt = snprintf(p, maxcnt, "(%s%s)\n", err, err2);
 	if (amt < 0)
 		return (amt);
 	p += amt;
@@ -967,10 +971,10 @@
 void
 usal_fprbytes(FILE *f, char *s, register Uchar *cp, register int n)
 {
-	js_fprintf(f, "%s", s);
+	fprintf(f, "%s", s);
 	while (--n >= 0)
-		js_fprintf(f, " %02X", *cp++);
-	js_fprintf(f, "\n");
+		fprintf(f, " %02X", *cp++);
+	fprintf(f, "\n");
 }
 
 /*
@@ -981,15 +985,15 @@
 {
 	register int	c;
 
-	js_fprintf(f, "%s", s);
+	fprintf(f, "%s", s);
 	while (--n >= 0) {
 		c = *cp++;
 		if (c >= ' ' && c < 0177)
-			js_fprintf(f, "%c", c);
+			fprintf(f, "%c", c);
 		else
-			js_fprintf(f, ".");
+			fprintf(f, ".");
 	}
-	js_fprintf(f, "\n");
+	fprintf(f, "\n");
 }
 
 /*
@@ -1023,20 +1027,20 @@
 	register char	*p = buf;
 	register int	amt;
 
-	amt = js_snprintf(p, maxcnt, "%s", s);
+	amt = snprintf(p, maxcnt, "%s", s);
 	if (amt < 0)
 		return (amt);
 	p += amt;
 	maxcnt -= amt;
 
 	while (--n >= 0) {
-		amt = js_snprintf(p, maxcnt, " %02X", *cp++);
+		amt = snprintf(p, maxcnt, " %02X", *cp++);
 		if (amt < 0)
 			return (amt);
 		p += amt;
 		maxcnt -= amt;
 	}
-	amt = js_snprintf(p, maxcnt, "\n");
+	amt = snprintf(p, maxcnt, "\n");
 	if (amt < 0)
 		return (amt);
 	p += amt;
@@ -1053,7 +1057,7 @@
 	register int	amt;
 	register int	c;
 
-	amt = js_snprintf(p, maxcnt, "%s", s);
+	amt = snprintf(p, maxcnt, "%s", s);
 	if (amt < 0)
 		return (amt);
 	p += amt;
@@ -1062,15 +1066,15 @@
 	while (--n >= 0) {
 		c = *cp++;
 		if (c >= ' ' && c < 0177)
-			amt = js_snprintf(p, maxcnt, "%c", c);
+			amt = snprintf(p, maxcnt, "%c", c);
 		else
-			amt = js_snprintf(p, maxcnt, ".");
+			amt = snprintf(p, maxcnt, ".");
 		if (amt < 0)
 			return (amt);
 		p += amt;
 		maxcnt -= amt;
 	}
-	amt = js_snprintf(p, maxcnt, "\n");
+	amt = snprintf(p, maxcnt, "\n");
 	if (amt < 0)
 		return (amt);
 	p += amt;
@@ -1194,85 +1198,85 @@
 usal_fprintdev(FILE *f, struct scsi_inquiry *ip)
 {
 	if (ip->removable)
-		js_fprintf(f, "Removable ");
+		fprintf(f, "Removable ");
 	if (ip->data_format >= 2) {
 		switch (ip->qualifier) {
 
 		case INQ_DEV_PRESENT:
 			break;
 		case INQ_DEV_NOTPR:
-			js_fprintf(f, "not present ");
+			fprintf(f, "not present ");
 			break;
 		case INQ_DEV_RES:
-			js_fprintf(f, "reserved ");
+			fprintf(f, "reserved ");
 			break;
 		case INQ_DEV_NOTSUP:
 			if (ip->type == INQ_NODEV) {
-				js_fprintf(f, "unsupported\n"); return;
+				fprintf(f, "unsupported\n"); return;
 			}
-			js_fprintf(f, "unsupported ");
+			fprintf(f, "unsupported ");
 			break;
 		default:
-			js_fprintf(f, "vendor specific %d ",
+			fprintf(f, "vendor specific %d ",
 						(int)ip->qualifier);
 		}
 	}
 	switch (ip->type) {
 
 	case INQ_DASD:
-		js_fprintf(f, "Disk");		break;
+		fprintf(f, "Disk");		break;
 	case INQ_SEQD:
-		js_fprintf(f, "Tape");		break;
+		fprintf(f, "Tape");		break;
 	case INQ_PRTD:
-		js_fprintf(f, "Printer");	break;
+		fprintf(f, "Printer");	break;
 	case INQ_PROCD:
-		js_fprintf(f, "Processor");	break;
+		fprintf(f, "Processor");	break;
 	case INQ_WORM:
-		js_fprintf(f, "WORM");		break;
+		fprintf(f, "WORM");		break;
 	case INQ_ROMD:
-		js_fprintf(f, "CD-ROM");	break;
+		fprintf(f, "CD-ROM");	break;
 	case INQ_SCAN:
-		js_fprintf(f, "Scanner");	break;
+		fprintf(f, "Scanner");	break;
 	case INQ_OMEM:
-		js_fprintf(f, "Optical Storage"); break;
+		fprintf(f, "Optical Storage"); break;
 	case INQ_JUKE:
-		js_fprintf(f, "Juke Box");	break;
+		fprintf(f, "Juke Box");	break;
 	case INQ_COMM:
-		js_fprintf(f, "Communication");	break;
+		fprintf(f, "Communication");	break;
 	case INQ_IT8_1:
-		js_fprintf(f, "IT8 1");		break;
+		fprintf(f, "IT8 1");		break;
 	case INQ_IT8_2:
-		js_fprintf(f, "IT8 2");		break;
+		fprintf(f, "IT8 2");		break;
 	case INQ_STARR:
-		js_fprintf(f, "Storage array");	break;
+		fprintf(f, "Storage array");	break;
 	case INQ_ENCL:
-		js_fprintf(f, "Enclosure services"); break;
+		fprintf(f, "Enclosure services"); break;
 	case INQ_SDAD:
-		js_fprintf(f, "Simple direct access"); break;
+		fprintf(f, "Simple direct access"); break;
 	case INQ_OCRW:
-		js_fprintf(f, "Optical card r/w"); break;
+		fprintf(f, "Optical card r/w"); break;
 	case INQ_BRIDGE:
-		js_fprintf(f, "Bridging expander"); break;
+		fprintf(f, "Bridging expander"); break;
 	case INQ_OSD:
-		js_fprintf(f, "Object based storage"); break;
+		fprintf(f, "Object based storage"); break;
 	case INQ_ADC:
-		js_fprintf(f, "Automation/Drive Interface"); break;
+		fprintf(f, "Automation/Drive Interface"); break;
 	case INQ_WELLKNOWN:
-		js_fprintf(f, "Well known lun"); break;
+		fprintf(f, "Well known lun"); break;
 
 	case INQ_NODEV:
 		if (ip->data_format >= 2) {
-			js_fprintf(f, "unknown/no device");
+			fprintf(f, "unknown/no device");
 			break;
 		} else if (ip->qualifier == INQ_DEV_NOTSUP) {
-			js_fprintf(f, "unit not present");
+			fprintf(f, "unit not present");
 			break;
 		}
 	default:
-		js_fprintf(f, "unknown device type 0x%x",
+		fprintf(f, "unknown device type 0x%x",
 						(int)ip->type);
 	}
-	js_fprintf(f, "\n");
+	fprintf(f, "\n");
 }
 
 /*
@@ -1297,7 +1301,7 @@
 	va_list	args;
 
 	va_start(args, form);
-	cnt = js_snprintf(usalp->errptr, usal_errrsize(usalp), "%r", form, args);
+	cnt = snprintf(usalp->errptr, usal_errrsize(usalp), "%r", form, args);
 	va_end(args);
 
 	if (cnt < 0) {

Modified: cdrkit/trunk/netscsid/netscsid.c
===================================================================
--- cdrkit/trunk/netscsid/netscsid.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/netscsid/netscsid.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -76,7 +76,6 @@
 static	void	checkuser(void);
 static	char	*getpeer(void);
 static	BOOL	checktarget(void);
-static	BOOL	strmatch(char *str, char *pat);
 static	void	dorscsi(void);
 static	void	scsiversion(void);
 static	void	openscsi(void);
@@ -115,13 +114,13 @@
 static	char	*debug_name;
 static	FILE	*debug_file;
 
-#define	DEBUG(fmt)		if (debug_file) js_fprintf(debug_file, fmt)
-#define	DEBUG1(fmt,a)		if (debug_file) js_fprintf(debug_file, fmt, a)
-#define	DEBUG2(fmt,a1,a2)	if (debug_file) js_fprintf(debug_file, fmt, a1, a2)
-#define	DEBUG3(fmt,a1,a2,a3)	if (debug_file) js_fprintf(debug_file, fmt, a1, a2, a3)
-#define	DEBUG4(fmt,a1,a2,a3,a4)	if (debug_file) js_fprintf(debug_file, fmt, a1, a2, a3, a4)
-#define	DEBUG5(fmt,a1,a2,a3,a4,a5)	if (debug_file) js_fprintf(debug_file, fmt, a1, a2, a3, a4, a5)
-#define	DEBUG6(fmt,a1,a2,a3,a4,a5,a6)	if (debug_file) js_fprintf(debug_file, fmt, a1, a2, a3, a4, a5, a6)
+#define	DEBUG(fmt)		if (debug_file) fprintf(debug_file, fmt)
+#define	DEBUG1(fmt,a)		if (debug_file) fprintf(debug_file, fmt, a)
+#define	DEBUG2(fmt,a1,a2)	if (debug_file) fprintf(debug_file, fmt, a1, a2)
+#define	DEBUG3(fmt,a1,a2,a3)	if (debug_file) fprintf(debug_file, fmt, a1, a2, a3)
+#define	DEBUG4(fmt,a1,a2,a3,a4)	if (debug_file) fprintf(debug_file, fmt, a1, a2, a3, a4)
+#define	DEBUG5(fmt,a1,a2,a3,a4,a5)	if (debug_file) fprintf(debug_file, fmt, a1, a2, a3, a4, a5)
+#define	DEBUG6(fmt,a1,a2,a3,a4,a5,a6)	if (debug_file) fprintf(debug_file, fmt, a1, a2, a3, a4, a5, a6)
 #endif	/* USE_REMOTE */
 
 int
@@ -151,9 +150,9 @@
 	 * don't contribute work and don't give support, they are causing extra
 	 * work for me and this way slow down the development.
 	 */
-	if (cfg_open("/etc/rscsi.conf") < 0) {
+	if (cfg_open("/etc/netscsid.conf") < 0) {
 		rscsierror(geterrno(), errmsgstr(geterrno()),
-			"Remote configuration error: Cannot open /etc/rscsi.conf");
+			"Remote configuration error: Cannot open /etc/netscsid.conf");
 /*		rscsirespond(-1, geterrno());*/
 		exit(EX_BAD);
 	}
@@ -227,7 +226,7 @@
 
 	cfg_restart();
 	while ((uname = cfg_get_next("USER")) != NULL) {
-		if (strmatch(username, uname))
+		if (0==strcmp(username, uname))
 			return;
 	}
 notfound:
@@ -315,9 +314,9 @@
 		return ("CANNOT_MAP_ADDRESS");
 #else	/* HAVE_GETNAMEINFO */
 #ifdef	HAVE_INET_NTOA
-		(void) js_snprintf(buffer, sizeof(buffer), "%s", inet_ntoa(s->sin_addr));
+		(void) snprintf(buffer, sizeof(buffer), "%s", inet_ntoa(s->sin_addr));
 #else
-		(void) js_snprintf(buffer, sizeof(buffer), "%x", s->sin_addr.s_addr);
+		(void) snprintf(buffer, sizeof(buffer), "%x", s->sin_addr.s_addr);
 #endif
 		DEBUG1("rscsid: peername %s\n", buffer);
 		he = gethostbyaddr((char *)&s->sin_addr.s_addr, 4, AF_INET);
@@ -353,7 +352,7 @@
 			*p++ = '\0';
 		else
 			continue;
-		if (!strmatch(username, user))
+		if (0!=strcmp(username, user))
 			continue;
 
 		while (*p == '\t')
@@ -363,7 +362,7 @@
 			*p++ = '\0';
 		else
 			continue;
-		if (!strmatch(peername, host))
+		if (0!=strcmp(peername, host))
 			continue;
 
 		p = astoi(p, &bus);
@@ -392,42 +391,6 @@
 	return (FALSE);
 }
 
-static BOOL
-strmatch(char *str, char *pat)
-{
-	int	*aux;
-	int	*state;
-	int	alt;
-	int	plen;
-	char	*p;
-
-	plen = strlen(pat);
-	aux = malloc(plen*sizeof(int));
-	state = malloc((plen+1)*sizeof(int));
-	if (aux == NULL || state == NULL) {
-		if (aux) free(aux);
-		if (state) free(state);
-		return (FALSE);
-	}
-
-	if ((alt = patcompile((const unsigned char *)pat, plen, aux)) == 0) {
-		/* Bad pattern */
-		free(aux);
-		free(state);
-		return (FALSE);
-	}
-
-	p = (char *)patmatch((const unsigned char *)pat, aux,
-							(const unsigned char *)str, 0,
-							strlen(str), alt, state);
-	free(aux);
-	free(state);
-
-	if (p != NULL && *p == '\0')
-		return (TRUE);
-	return (FALSE);
-}
-
 static void
 dorscsi()
 {
@@ -551,7 +514,7 @@
 		usal_target(scsi_ptr),
 		usal_lun(scsi_ptr));
 
-	ret = js_snprintf(rbuf, sizeof(rbuf), "A0\n%d\n%d\n%d\n%d\n",
+	ret = snprintf(rbuf, sizeof(rbuf), "A0\n%d\n%d\n%d\n%d\n",
 		usal_scsibus(scsi_ptr),
 		0,
 		usal_target(scsi_ptr),
@@ -824,7 +787,7 @@
 		*(Uchar *)&scmd->scb,
 		scmd->sense_count);
 
-	ret = js_snprintf(rbuf, sizeof(rbuf), "A%d\n%d\n%d\n%d\n%d\n",
+	ret = snprintf(rbuf, sizeof(rbuf), "A%d\n%d\n%d\n%d\n%d\n",
 		n,
 		scmd->error,
 		scmd->ux_errno,
@@ -984,7 +947,7 @@
 	char	rbuf[CMD_SIZE];
 
 	DEBUG1("rscsid:>A %d\n", ret);
-	(void) js_snprintf(rbuf, sizeof(rbuf), "A%d\n", ret);
+	(void) snprintf(rbuf, sizeof(rbuf), "A%d\n", ret);
 	(void) _nixwrite(STDOUT_FILENO, rbuf, strlen(rbuf));
 }
 
@@ -999,7 +962,7 @@
 		xlen = strlen(xstr) + 1;
 
 	DEBUG3("rscsid:>E %d (%s) [%s]\n", err, str, xstr?xstr:"");
-	n = js_snprintf(rbuf, sizeof(rbuf), "E%d\n%s\n%d\n", err, str, xlen);
+	n = snprintf(rbuf, sizeof(rbuf), "E%d\n%s\n%d\n", err, str, xlen);
 
 	if (xlen > 0 && ((xlen + n) <= sizeof(rbuf))) {
 		movebytes(xstr, &rbuf[n], xlen);

Modified: cdrkit/trunk/readom/readom.c
===================================================================
--- cdrkit/trunk/readom/readom.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/readom/readom.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -913,7 +913,7 @@
 		if (len > (sizeof (filename)-5)) {
 			len = sizeof (filename)-5;
 		}
-		js_snprintf(filename, sizeof (filename), "%.*s.toc", len, parmp->name);
+		snprintf(filename, sizeof (filename), "%.*s.toc", len, parmp->name);
 	}
 
 	tp = (struct tocheader *)xb;

Modified: cdrkit/trunk/wodim/clone.c
===================================================================
--- cdrkit/trunk/wodim/clone.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/wodim/clone.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -97,7 +97,7 @@
 	if (len > (sizeof (filename)-5)) {
 		len = sizeof (filename)-5;
 	}
-	js_snprintf(filename, sizeof (filename), "%.*s.toc", len, trackp[1].filename);
+	snprintf(filename, sizeof (filename), "%.*s.toc", len, trackp[1].filename);
 
 	f = open(filename, O_RDONLY|O_BINARY);
 	if (f < 0)

Modified: cdrkit/trunk/wodim/cue.c
===================================================================
--- cdrkit/trunk/wodim/cue.c	2006-11-25 00:18:53 UTC (rev 461)
+++ cdrkit/trunk/wodim/cue.c	2006-11-25 00:20:20 UTC (rev 462)
@@ -461,12 +461,12 @@
 
 		if (strchr(word, '/') == 0 &&
 		    strchr(cuename(), '/') != 0) {
-			js_snprintf(cname, sizeof (cname),
+			snprintf(cname, sizeof (cname),
 				"%s", cuename());
 			p = strrchr(cname, '/');
 			if (p)
 				*p = '\0';
-			js_snprintf(newname, sizeof (newname),
+			snprintf(newname, sizeof (newname),
 				"%s/%s", cname, word);
 			word = newname;
 			sp->xfp = xopen(word, O_RDONLY|O_BINARY, 0);




More information about the Debburn-changes mailing list