develooper Front page | perl.perl5.changes.mac | Postings from September 2001

PERFORCE change 11814 for review

From:
Chris Nandor
Date:
September 1, 2001 18:08
Subject:
PERFORCE change 11814 for review
Message ID:
p05100308b7b73687dc3a@[10.0.1.177]
Change 11814 by pudge@pudge-mobile on 2001/09/01 22:09:08

	Make MPW-style errors optional (but the default); add
	MacPerl::ErrorFormat() function and Mac::err pragma

Affected files ...

... //depot/maint-5.6/macperl/macos/ext/Mac/Makefile.mk#2 edit
... //depot/maint-5.6/macperl/macos/ext/Mac/err/Makefile.PL#1 add
... //depot/maint-5.6/macperl/macos/ext/Mac/err/err.pm#1 add
... //depot/maint-5.6/macperl/macos/ext/Mac/err/err.xs#1 add
... //depot/maint-5.6/macperl/macos/ext/MacPerl/MacPerl.xs#2 edit
... //depot/maint-5.6/macperl/macos/macish.c#5 edit
... //depot/maint-5.6/macperl/macos/macish.h#5 edit
... //depot/maint-5.6/macperl/macos/macperl.sym#2 edit

Differences ...

==== //depot/maint-5.6/macperl/macos/ext/Mac/Makefile.mk#2 (text) ====
Index: perl/macos/ext/Mac/Makefile.mk
--- perl/macos/ext/Mac/Makefile.mk.~1~	Sat Sep  1 16:15:06 2001
+++ perl/macos/ext/Mac/Makefile.mk	Sat Sep  1 16:15:06 2001
@@ -6,32 +6,33 @@
 COpt += -i :::
 
 dirs = 	\
+	err:err					\
 	AppleEvents:AppleEvents			\
 	Components:Components			\
-	Controls:Controls				\
-	Dialogs:Dialogs					\
-	Events:Events					\
-	Files:Files						\
-	Fonts:Fonts						\
-	Gestalt:Gestalt					\
-	InternetConfig:InternetConfig	\
-	Lists:Lists						\
-	Memory:Memory					\
-	Menus:Menus						\
-	MoreFiles:MoreFiles				\
-	Movies:Movies					\
-	OSA:OSA							\
-	Processes:Processes				\
+	Controls:Controls			\
+	Dialogs:Dialogs				\
+	Events:Events				\
+	Files:Files				\
+	Fonts:Fonts				\
+	Gestalt:Gestalt				\
+	InternetConfig:InternetConfig		\
+	Lists:Lists				\
+	Memory:Memory				\
+	Menus:Menus				\
+	MoreFiles:MoreFiles			\
+	Movies:Movies				\
+	OSA:OSA					\
+	Processes:Processes			\
 	QDOffscreen:QDOffscreen			\
-	QuickDraw:QuickDraw				\
+	QuickDraw:QuickDraw			\
 	QuickTimeVR:QuickTimeVR			\
-	Resources:Resources				\
-	Sound:Sound						\
-	Speech:Speech					\
+	Resources:Resources			\
+	Sound:Sound				\
+	Speech:Speech				\
 	SpeechRecognition:SpeechRecognition	\
 	StandardFile:StandardFile		\
-	TextEdit:TextEdit				\
-	Types:Types						\
+	TextEdit:TextEdit			\
+	Types:Types				\
 	Windows:Windows
 
 all static dynamic install install_static install_dynamic: Obj

==== //depot/maint-5.6/macperl/macos/ext/MacPerl/MacPerl.xs#2 (text) ====
Index: perl/macos/ext/MacPerl/MacPerl.xs
--- perl/macos/ext/MacPerl/MacPerl.xs.~1~	Sat Sep  1 16:15:06 2001
+++ perl/macos/ext/MacPerl/MacPerl.xs	Sat Sep  1 16:15:06 2001
@@ -530,11 +530,23 @@
 		DisposeDialog(dlg);
 	}
 
-void
-MP_Quit(condition)
-	int	condition
+int
+MP_Quit(...)
+	CODE:
+		if (items > 0)
+			gMacPerl_Quit = SvIV(ST(0));
+		RETVAL = gMacPerl_Quit;
+	OUTPUT:
+	RETVAL
+
+int
+MP_ErrorFormat(...)
 	CODE:
-	gMacPerl_Quit = condition;
+		if (items > 0)
+			gMacPerl_ErrorFormat = SvIV(ST(0));
+		RETVAL = gMacPerl_ErrorFormat;
+	OUTPUT:
+	RETVAL
 
 void
 MP_FAccess(file, cmd, ...)

==== //depot/maint-5.6/macperl/macos/macish.c#5 (text) ====
Index: perl/macos/macish.c
--- perl/macos/macish.c.~1~	Sat Sep  1 16:15:06 2001
+++ perl/macos/macish.c	Sat Sep  1 16:15:06 2001
@@ -831,7 +831,12 @@
 {
 	const char * line= msg;
 	const char * at;
-	
+
+	if (!gMacPerl_ErrorFormat) {
+		PerlIO_write(io, msg, len);
+		return;
+	}
+
 	/* Look for " line \d" */
 	while (line = strnstr(line+1, " line ", msg+len-line-1)) {
 		if (line[6] >= '0' && line[6] <= '9') {

==== //depot/maint-5.6/macperl/macos/macish.h#5 (text) ====
Index: perl/macos/macish.h
--- perl/macos/macish.h.~1~	Sat Sep  1 16:15:06 2001
+++ perl/macos/macish.h	Sat Sep  1 16:15:06 2001
@@ -48,6 +48,7 @@
 MP_EXT char 	gMacPerl_PseudoFileName[256];
 MP_EXT int	gMacPerl_Quit;
 MP_EXT clock_t	gMacPerl_StartClock;
+MP_EXT int	gMacPerl_ErrorFormat		MP_INIT(1);
 
 #ifdef MAC_CONTEXT
 #undef Move

==== //depot/maint-5.6/macperl/macos/macperl.sym#2 (text) ====
Index: perl/macos/macperl.sym
--- perl/macos/macperl.sym.~1~	Sat Sep  1 16:15:06 2001
+++ perl/macos/macperl.sym	Sat Sep  1 16:15:06 2001
@@ -258,3 +258,6 @@
 sys_errlist
 _stdopen
 _Sfstderr
+# more symbols, Fri, Aug 31, 2001 20:21:48
+gMacPerl_Perl5DB
+gMacPerl_ErrorFormat

==== //depot/maint-5.6/macperl/macos/ext/Mac/err/Makefile.PL#1 (text) ====
Index: perl/macos/ext/Mac/err/Makefile.PL
--- perl/macos/ext/Mac/err/Makefile.PL.~1~	Sat Sep  1 16:15:06 2001
+++ perl/macos/ext/Mac/err/Makefile.PL	Sat Sep  1 16:15:06 2001
@@ -0,0 +1,7 @@
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+	'NAME' 		=> q(Mac::err),
+	'VERSION_FROM'	=> 'err.pm',
+    	'LINKTYPE'	=> 'static dynamic',
+);

==== //depot/maint-5.6/macperl/macos/ext/Mac/err/err.pm#1 (text) ====
Index: perl/macos/ext/Mac/err/err.pm
--- perl/macos/ext/Mac/err/err.pm.~1~	Sat Sep  1 16:15:06 2001
+++ perl/macos/ext/Mac/err/err.pm	Sat Sep  1 16:15:06 2001
@@ -0,0 +1,60 @@
+package Mac::err;
+
+use strict;
+use vars qw($VERSION @ISA);
+
+require DynaLoader;
+
+@ISA = qw(Exporter DynaLoader);
+# Items to export into callers namespace by default. Note: do not export
+# names by default without a very good reason. Use EXPORT_OK instead.
+# Do not simply export all your public functions/methods/constants.
+$VERSION = '0.01';
+
+sub import {
+	my($pkg, $import) = @_;
+
+	if	($import =~ /(?:mpw|mac)/i) {
+		Mac_err_MPW();
+	}
+	elsif	($import =~ /(?:nix|perl)/i) {
+		Mac_err_Unix();
+	}
+}
+
+bootstrap Mac::err $VERSION;
+
+# Preloaded methods go here.
+
+# Autoload methods go after =cut, and are processed by the autosplit program.
+
+1;
+__END__
+# Below is the stub of documentation for your module. You better edit it!
+
+=head1 NAME
+
+Mac::err - Perl extension for blah blah blah
+
+=head1 SYNOPSIS
+
+  use Mac::err;
+  blah blah blah
+
+=head1 DESCRIPTION
+
+Stub documentation for Mac::err was created by h2xs. It looks like the
+author of the extension was negligent enough to leave the stub
+unedited.
+
+Blah blah blah.
+
+=head1 AUTHOR
+
+A. U. Thor, a.u.thor@a.galaxy.far.far.away
+
+=head1 SEE ALSO
+
+perl(1).
+
+=cut

==== //depot/maint-5.6/macperl/macos/ext/Mac/err/err.xs#1 (text) ====
Index: perl/macos/ext/Mac/err/err.xs
--- perl/macos/ext/Mac/err/err.xs.~1~	Sat Sep  1 16:15:06 2001
+++ perl/macos/ext/Mac/err/err.xs	Sat Sep  1 16:15:06 2001
@@ -0,0 +1,22 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+#ifdef __cplusplus
+}
+#endif
+
+
+MODULE = Mac::err		PACKAGE = Mac::err
+
+void
+Mac_err_Unix()
+	CODE:
+		gMacPerl_ErrorFormat = 0;
+
+void
+Mac_err_MPW()
+	CODE:
+		gMacPerl_ErrorFormat = 1;
End of Patch.



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About