[Debburn-changes] r836 - in cdrkit/trunk: include librols librols/stdio libusal readom wodim

Peter Samuelson peters at alioth.debian.org
Sun Oct 11 22:31:30 UTC 2009


Author: peters
Date: 2009-10-11 22:31:30 +0000 (Sun, 11 Oct 2009)
New Revision: 836

Modified:
   cdrkit/trunk/include/schily.h
   cdrkit/trunk/librols/fexec.c
   cdrkit/trunk/librols/getdomainname.c
   cdrkit/trunk/librols/spawn.c
   cdrkit/trunk/librols/stdio/fgetline.c
   cdrkit/trunk/libusal/scsi-unixware.c
   cdrkit/trunk/libusal/scsitransp.c
   cdrkit/trunk/readom/io.c
   cdrkit/trunk/readom/readom.c
   cdrkit/trunk/wodim/cue.c
   cdrkit/trunk/wodim/wodim.c
Log:
Add a rols_ prefix to getline, fgetline, and the fexec family from librols.
Prevents some more clashes with POSIX.

I note that phasing out librols/stdio (and maybe more of librols)
entirely would probably be better, but that is for another day.


Modified: cdrkit/trunk/include/schily.h
===================================================================
--- cdrkit/trunk/include/schily.h	2009-10-11 22:10:00 UTC (rev 835)
+++ cdrkit/trunk/include/schily.h	2009-10-11 22:31:30 UTC (rev 836)
@@ -112,17 +112,17 @@
 extern	FILE	*_fcons(FILE *, int, int);
 extern	FILE	*fdup(FILE *);
 extern	int	fdown(FILE *);
-extern	int	fexecl(const char *, FILE *, FILE *, FILE *, const char *, ...);
-extern	int	fexecle(const char *, FILE *, FILE *, FILE *, const char *, ...);
+extern	int	rols_fexecl(const char *, FILE *, FILE *, FILE *, const char *, ...);
+extern	int	rols_fexecle(const char *, FILE *, FILE *, FILE *, const char *, ...);
 		/* 6th arg not const, fexecv forces av[ac] = NULL */
-extern	int	fexecv(const char *, FILE *, FILE *, FILE *, int, char **);
-extern	int	fexecve(const char *, FILE *, FILE *, FILE *, char * const *, 
+extern	int	rols_fexecv(const char *, FILE *, FILE *, FILE *, int, char **);
+extern	int	rols_fexecve(const char *, FILE *, FILE *, FILE *, char * const *, 
 							  char * const *);
 extern	int	fspawnv(FILE *, FILE *, FILE *, int, char * const *);
 extern	int	fspawnl(FILE *, FILE *, FILE *, const char *, const char *, ...);
 extern	int	fspawnv_nowait(FILE *, FILE *, FILE *, const char *, int, 
 										char *const*);
-extern	int	fgetline(FILE *, char *, int);
+extern	int	rols_fgetline(FILE *, char *, int);
 extern	int	fgetstr(FILE *, char *, int);
 extern	void	file_raise(FILE *, int);
 extern	int	fileclose(FILE *);
@@ -190,7 +190,7 @@
 extern	char	*fillbytes(void *, int, char);
 extern	char	*findbytes(const void *, int, char);
 extern	int	findline(const char *, char, const char *, int, char **, int);
-extern	int	getline(char *, int);
+extern	int	rols_getline(char *, int);
 extern	int	getstr(char *, int);
 extern	int	breakline(char *, char, char **, int);
 extern	int	getallargs(int *, char * const**, const char *, ...);

Modified: cdrkit/trunk/librols/fexec.c
===================================================================
--- cdrkit/trunk/librols/fexec.c	2009-10-11 22:10:00 UTC (rev 835)
+++ cdrkit/trunk/librols/fexec.c	2009-10-11 22:31:30 UTC (rev 836)
@@ -34,13 +34,13 @@
 #include <mconfig.h>
 #include <stdio.h>
 #include <standard.h>
-#define	fexecl	__nothing_1_	/* prototype in schily.h is wrong */
-#define	fexecle	__nothing_2_	/* prototype in schily.h is wrong */
+#define	rols_fexecl	__nothing_1_	/* prototype in schily.h is wrong */
+#define	rols_fexecle	__nothing_2_	/* prototype in schily.h is wrong */
 #include <schily.h>
-#undef	fexecl
-#undef	fexecle
-	int fexecl	__PR((const char *, FILE *, FILE *, FILE *, ...));
-	int fexecle	__PR((const char *, FILE *, FILE *, FILE *, ...));
+#undef	rols_fexecl
+#undef	rols_fexecle
+	int rols_fexecl  __PR((const char *, FILE *, FILE *, FILE *, ...));
+	int rols_fexecle __PR((const char *, FILE *, FILE *, FILE *, ...));
 #include <unixstd.h>
 #include <stdxlib.h>
 #include <strdefs.h>
@@ -66,10 +66,10 @@
 
 #ifdef	PROTOTYPES
 EXPORT int
-fexecl(const char *name, FILE *in, FILE *out, FILE *err, ...)
+rols_fexecl(const char *name, FILE *in, FILE *out, FILE *err, ...)
 #else
 EXPORT int
-fexecl(name, in, out, err, va_alist)
+rols_fexecl(name, in, out, err, va_alist)
 	char	*name;
 	FILE	*in;
 	FILE	*out;
@@ -113,7 +113,7 @@
 	} while (p != NULL);
 	va_end(args);
 
-	ret = fexecv(name, in, out, err, ac, av);
+	ret = rols_fexecv(name, in, out, err, ac, av);
 	if (av != xav)
 		free(av);
 	return (ret);
@@ -121,10 +121,10 @@
 
 #ifdef	PROTOTYPES
 EXPORT int
-fexecle(const char *name, FILE *in, FILE *out, FILE *err, ...)
+rols_fexecle(const char *name, FILE *in, FILE *out, FILE *err, ...)
 #else
 EXPORT int
-fexecle(name, in, out, err, va_alist)
+rols_fexecle(name, in, out, err, va_alist)
 	char	*name;
 	FILE	*in;
 	FILE	*out;
@@ -170,25 +170,25 @@
 	} while (p != NULL);
 	va_end(args);
 
-	ret = fexecve(name, in, out, err, av, env);
+	ret = rols_fexecve(name, in, out, err, av, env);
 	if (av != xav)
 		free(av);
 	return (ret);
 }
 
 EXPORT int
-fexecv(name, in, out, err, ac, av)
+rols_fexecv(name, in, out, err, ac, av)
 	const char *name;
 	FILE *in, *out, *err;
 	int ac;
 	char *av[];
 {
 	av[ac] = NULL;			/*  force list to be null terminated */
-	return (fexecve(name, in, out, err, av, environ));
+	return (rols_fexecve(name, in, out, err, av, environ));
 }
 
 EXPORT int
-fexecve(name, in, out, err, av, env)
+rols_fexecve(name, in, out, err, av, env)
 	const char *name;
 	FILE *in, *out, *err;
 	char * const av[], * const env[];

Modified: cdrkit/trunk/librols/getdomainname.c
===================================================================
--- cdrkit/trunk/librols/getdomainname.c	2009-10-11 22:10:00 UTC (rev 835)
+++ cdrkit/trunk/librols/getdomainname.c	2009-10-11 22:31:30 UTC (rev 836)
@@ -83,7 +83,7 @@
 	if (f == NULL)
 		return (-1);
 
-	while (fgetline(f, name1, sizeof (name1)) >= 0) {
+	while (rols_fgetline(f, name1, sizeof (name1)) >= 0) {
 		if ((p = strchr(name1, '#')) != NULL)
 			*p = '\0';
 

Modified: cdrkit/trunk/librols/spawn.c
===================================================================
--- cdrkit/trunk/librols/spawn.c	2009-10-11 22:10:00 UTC (rev 835)
+++ cdrkit/trunk/librols/spawn.c	2009-10-11 22:31:30 UTC (rev 836)
@@ -143,7 +143,7 @@
 				 * silly: fexecv must set av[ac] = NULL
 				 * so we have to cast argv tp (char **)
 				 */
-	fexecv(name, in, out, err, argc, (char **)argv);
+	rols_fexecv(name, in, out, err, argc, (char **)argv);
 	exit(geterrno());
 	/* NOTREACHED */
 }

Modified: cdrkit/trunk/librols/stdio/fgetline.c
===================================================================
--- cdrkit/trunk/librols/stdio/fgetline.c	2009-10-11 22:10:00 UTC (rev 835)
+++ cdrkit/trunk/librols/stdio/fgetline.c	2009-10-11 22:31:30 UTC (rev 836)
@@ -37,7 +37,7 @@
  */
 
 EXPORT int
-fgetline(f, buf, len)
+rols_fgetline(f, buf, len)
 	register	FILE	*f;
 			char	*buf;
 	register	int	len;
@@ -76,9 +76,9 @@
 }
 
 EXPORT int
-getline(buf, len)
+rols_getline(buf, len)
 	char	*buf;
 	int	len;
 {
-	return (fgetline(stdin, buf, len));
+	return (rols_fgetline(stdin, buf, len));
 }

Modified: cdrkit/trunk/libusal/scsi-unixware.c
===================================================================
--- cdrkit/trunk/libusal/scsi-unixware.c	2009-10-11 22:10:00 UTC (rev 835)
+++ cdrkit/trunk/libusal/scsi-unixware.c	2009-10-11 22:31:30 UTC (rev 836)
@@ -891,7 +891,7 @@
 		setuid(0);
 
 		fclose(pp[0]);
-		(void) fexecl("/bin/sh", stdin, pp[1], stderr,
+		(void) rols_fexecl("/bin/sh", stdin, pp[1], stderr,
 					"sh", "-c", cmd, (char *)0);
 		_exit(1);
 	}

Modified: cdrkit/trunk/libusal/scsitransp.c
===================================================================
--- cdrkit/trunk/libusal/scsitransp.c	2009-10-11 22:10:00 UTC (rev 835)
+++ cdrkit/trunk/libusal/scsitransp.c	2009-10-11 22:31:30 UTC (rev 836)
@@ -301,7 +301,7 @@
 
 	printf("%s", msg);
 	flush();
-	if (getline(okbuf, sizeof (okbuf)) == EOF)
+	if (rols_getline(okbuf, sizeof (okbuf)) == EOF)
 		exit(EX_BAD);
 	if (streql(okbuf, "y") || streql(okbuf, "yes") ||
 	    streql(okbuf, "Y") || streql(okbuf, "YES"))

Modified: cdrkit/trunk/readom/io.c
===================================================================
--- cdrkit/trunk/readom/io.c	2009-10-11 22:10:00 UTC (rev 835)
+++ cdrkit/trunk/readom/io.c	2009-10-11 22:31:30 UTC (rev 836)
@@ -130,7 +130,7 @@
 		(*prt)(s, *lp, mini, maxi, dp);
 		flush();
 		line[0] = '\0';
-		if (getline(line, 80) == EOF)
+		if (rols_getline(line, 80) == EOF)
 			exit(EX_BAD);
 
 		linep = skipwhite(line);
@@ -178,7 +178,7 @@
 	vprintf(form, args);
 	va_end(args);
 	flush();
-	if (getline(okbuf, sizeof(okbuf)) == EOF)
+	if (rols_getline(okbuf, sizeof(okbuf)) == EOF)
 		exit(EX_BAD);
 	if (okbuf[0] == '?') {
 		printf("Enter 'y', 'Y', 'yes' or 'YES' if you agree with the previous asked question.\n");

Modified: cdrkit/trunk/readom/readom.c
===================================================================
--- cdrkit/trunk/readom/readom.c	2009-10-11 22:10:00 UTC (rev 835)
+++ cdrkit/trunk/readom/readom.c	2009-10-11 22:31:30 UTC (rev 836)
@@ -1605,7 +1605,7 @@
 		fprintf(stderr, "Copy from SCSI (%d,%d,%d) disk to file\n",
 					usal_scsibus(usalp), usal_target(usalp), usal_lun(usalp));
 		fprintf(stderr, "Enter filename [%s]: ", defname); flush();
-		(void) getline(filename, sizeof (filename));
+		(void) rols_getline(filename, sizeof (filename));
 	}
 
 	if (askrange) {
@@ -1772,7 +1772,7 @@
 		fprintf(stderr, "Copy from file to SCSI (%d,%d,%d) disk\n",
 					usal_scsibus(usalp), usal_target(usalp), usal_lun(usalp));
 		fprintf(stderr, "Enter filename [%s]: ", defname); flush();
-		(void) getline(filename, sizeof (filename));
+		(void) rols_getline(filename, sizeof (filename));
 		fprintf(stderr, "Notice: reading from file always starts at file offset 0.\n");
 
 		getlong("Enter starting sector for copy:", &addr, 0L, end-1);

Modified: cdrkit/trunk/wodim/cue.c
===================================================================
--- cdrkit/trunk/wodim/cue.c	2009-10-11 22:10:00 UTC (rev 835)
+++ cdrkit/trunk/wodim/cue.c	2009-10-11 22:31:30 UTC (rev 836)
@@ -1037,7 +1037,7 @@
 
 	do {
 		fillbytes(linebuf, sizeof (linebuf), '\0');
-		len = fgetline(f, linebuf, sizeof (linebuf));
+		len = rols_fgetline(f, linebuf, sizeof (linebuf));
 		if (len < 0)
 			return (NULL);
 		if (len > 0 && linebuf[len-1] == '\r') {

Modified: cdrkit/trunk/wodim/wodim.c
===================================================================
--- cdrkit/trunk/wodim/wodim.c	2009-10-11 22:10:00 UTC (rev 835)
+++ cdrkit/trunk/wodim/wodim.c	2009-10-11 22:31:30 UTC (rev 836)
@@ -3964,7 +3964,7 @@
 #endif
 		} else
 #endif
-		if (fgetline(tty, ans, 1) < 0)
+		if (rols_fgetline(tty, ans, 1) < 0)
 			comerrno(EX_BAD, "Aborted by EOF on input.\n");
 	}
 	usalp->silent--;




More information about the Debburn-changes mailing list