summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-06-30 12:44:51 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-06-30 12:44:51 +0000
commit32ce01bccb8e58ee340ca4100517f9c031630ea7 (patch)
tree29c620f50b5b4aee153fb734bdabde07b2875d3c
parentfc833f5303910487406f29ed9b64ac271eb7125b (diff)
downloadperl-32ce01bccb8e58ee340ca4100517f9c031630ea7.tar.gz
NetWare tweaks from Guruprasad.
p4raw-id: //depot/perl@11035
-rw-r--r--MANIFEST2
-rw-r--r--NetWare/Makefile6
-rw-r--r--NetWare/config.wc1
-rw-r--r--NetWare/config_H.wc2
-rw-r--r--NetWare/nwperlsys.c73
-rw-r--r--NetWare/nwperlsys.h3
-rw-r--r--NetWare/nwstdio.h122
-rw-r--r--NetWare/perlsdio.h18
-rw-r--r--NetWare/t/Readme.txt93
9 files changed, 267 insertions, 53 deletions
diff --git a/MANIFEST b/MANIFEST
index 0a9f2c3b28..658e08c90a 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1522,7 +1522,9 @@ NetWare/nwplglob.h Netware port
NetWare/NWTInfo.c Netware port
NetWare/nwtinfo.h Netware port
NetWare/NWUtil.c Netware port
+NetWare/nwstdio.h Netware port
NetWare/nwutil.h Netware port
+NetWare/perlsdio.h Netware port
NetWare/t/NWModify.pl Netware port
NetWare/t/NWScripts.pl Netware port
NetWare/t/Readme.txt Netware port
diff --git a/NetWare/Makefile b/NetWare/Makefile
index 70659178c4..4ac2091d10 100644
--- a/NetWare/Makefile
+++ b/NetWare/Makefile
@@ -15,7 +15,7 @@
## This file is created by using the makefile that creates Windows Perl as the reference
## Author: sgp
## Date Created: 13th July 2000
-## Date Modified: 03th April 2001
+## Date Modified: 30th June 2001
# Name of the NLM
NLM_NAME = perl.nlm
@@ -1501,7 +1501,9 @@ install_tests :
xcopy /f /r /i /s /d *.t $(INST_NW_TOP2)\scripts\t\lib
cd ..\ext
xcopy /f /r /i /s /d *.t $(INST_NW_TOP2)\scripts\t\ext
- cd ..\netware
+ cd ..\netware\t
+ xcopy /f /r /i /s /d *.pl $(INST_NW_TOP2)\scripts\t
+ cd ..
nwinstall: utils installnw install_tests
diff --git a/NetWare/config.wc b/NetWare/config.wc
index a8455f64a7..c4492baaaf 100644
--- a/NetWare/config.wc
+++ b/NetWare/config.wc
@@ -326,6 +326,7 @@ d_strcoll='define'
d_strctcpy='define'
d_strerrm='strerror(e)'
d_strerror='define'
+d_strftime='define'
d_strtod='define'
d_strtol='define'
d_strtold='undef'
diff --git a/NetWare/config_H.wc b/NetWare/config_H.wc
index ea927ddef3..c3428f777b 100644
--- a/NetWare/config_H.wc
+++ b/NetWare/config_H.wc
@@ -3421,7 +3421,7 @@
* This symbol, if defined, indicates that the strftime routine is
* available to do time formatting.
*/
-/*#define HAS_STRFTIME /**/
+#define HAS_STRFTIME /**/
/* HAS_SYSCALL_PROTO:
* This symbol, if defined, indicates that the system provides
diff --git a/NetWare/nwperlsys.c b/NetWare/nwperlsys.c
index bc97b11135..b1bf8ddd69 100644
--- a/NetWare/nwperlsys.c
+++ b/NetWare/nwperlsys.c
@@ -122,42 +122,71 @@ perl_alloc(void)
==============================================================================================*/
EXTERN_C PerlInterpreter*
-perl_alloc_override(struct IPerlMem* ppMem, struct IPerlMem* ppMemShared,
- struct IPerlMem* ppMemParse, struct IPerlEnv* ppEnv,
- struct IPerlStdIO* ppStdIO, struct IPerlLIO* ppLIO,
- struct IPerlDir* ppDir, struct IPerlSock* ppSock,
- struct IPerlProc* ppProc)
+perl_alloc_override(struct IPerlMem** ppMem, struct IPerlMem** ppMemShared,
+ struct IPerlMem** ppMemParse, struct IPerlEnv** ppEnv,
+ struct IPerlStdIO** ppStdIO, struct IPerlLIO** ppLIO,
+ struct IPerlDir** ppDir, struct IPerlSock** ppSock,
+ struct IPerlProc** ppProc)
{
PerlInterpreter *my_perl = NULL;
+ struct IPerlMem* lpMem;
+ struct IPerlEnv* lpEnv;
+ struct IPerlStdIO* lpStdio;
+ struct IPerlLIO* lpLIO;
+ struct IPerlDir* lpDir;
+ struct IPerlSock* lpSock;
+ struct IPerlProc* lpProc;
+
WCValHashTable<void*>* m_allocList;
m_allocList = new WCValHashTable<void*> (fnAllocListHash, 256);
fnInsertHashListAddrs(m_allocList, FALSE);
if (!ppMem)
- ppMem=&perlMem;
+ lpMem=&perlMem;
+ else
+ lpMem=*ppMem;
+
if (!ppEnv)
- ppEnv=&perlEnv;
+ lpEnv=&perlEnv;
+ else
+ lpEnv=*ppEnv;
+
if (!ppStdIO)
- ppStdIO=&perlStdIO;
+ lpStdio=&perlStdIO;
+ else
+ lpStdio=*ppStdIO;
+
if (!ppLIO)
- ppLIO=&perlLIO;
+ lpLIO=&perlLIO;
+ else
+ lpLIO=*ppLIO;
+
if (!ppDir)
- ppDir=&perlDir;
+ lpDir=&perlDir;
+ else
+ lpDir=*ppDir;
+
if (!ppSock)
- ppSock=&perlSock;
+ lpSock=&perlSock;
+ else
+ lpSock=*ppSock;
+
if (!ppProc)
- ppProc=&perlProc;
-
- my_perl = perl_alloc_using(ppMem,
- ppMemShared,
- ppMemParse,
- ppEnv,
- ppStdIO,
- ppLIO,
- ppDir,
- ppSock,
- ppProc);
+ lpProc=&perlProc;
+ else
+ lpProc=*ppProc;
+
+ my_perl = perl_alloc_using(lpMem,
+ NULL,
+ NULL,
+ lpEnv,
+ lpStdio,
+ lpLIO,
+ lpDir,
+ lpSock,
+ lpProc);
+
if (my_perl) {
#ifdef PERL_OBJECT
CPerlObj* pPerl = (CPerlObj*)my_perl;
diff --git a/NetWare/nwperlsys.h b/NetWare/nwperlsys.h
index c871f0a0a7..0b7271daaf 100644
--- a/NetWare/nwperlsys.h
+++ b/NetWare/nwperlsys.h
@@ -12,7 +12,7 @@
* platform specific function
* Author : SGP
* Date Created : June 12th 2001.
- * Date Modified: June 26th 2001.
+ * Date Modified: June 30th 2001.
*/
#ifndef ___NWPerlSys_H___
@@ -20,6 +20,7 @@
#include "iperlsys.h"
+#include "nwstdio.h"
#include "nw5iop.h"
#include <fcntl.h>
diff --git a/NetWare/nwstdio.h b/NetWare/nwstdio.h
new file mode 100644
index 0000000000..669ba13ab7
--- /dev/null
+++ b/NetWare/nwstdio.h
@@ -0,0 +1,122 @@
+/*
+ * Copyright © 2001 Novell, Inc. All Rights Reserved.
+ *
+ * You may distribute under the terms of either the GNU General Public
+ * License or the Artistic License, as specified in the README file.
+ *
+ */
+
+/*
+ * FILENAME : nwstdio.h
+ * DESCRIPTION : Making stdio calls go thro' the
+ * NetWare specific implementation.
+ * This gets included if PERLIO_IS_STDIO. Instead
+ * of directly calling stdio functions this goes
+ * thro' IPerlStdIO, this ensures that cgi2perl
+ * can call CGI functions and send the o/p to
+ * browser or console.
+ * Author : SGP
+ * Date Created : June 29th 2001.
+ * Date Modified: June 30th 2001.
+ */
+
+#ifndef ___NWStdio_H___
+#define ___NWStdio_H___
+
+#define PerlIO FILE
+
+#define PerlIO_putc(f,c) (*PL_StdIO->pPutc)(PL_StdIO, (f),(c))
+#define PerlIO_fileno(f) (*PL_StdIO->pFileno)(PL_StdIO, (f))
+#define PerlIO_close(f) (*PL_StdIO->pClose)(PL_StdIO, (f))
+#define PerlIO_stderr() (*PL_StdIO->pStderr)(PL_StdIO)
+#define PerlIO_printf Perl_fprintf_nocontext
+#define PerlIO_vprintf(f,fmt,a) (*PL_StdIO->pVprintf)(PL_StdIO, (f),(fmt),a)
+#define PerlIO_flush(f) (*PL_StdIO->pFlush)(PL_StdIO, (f))
+#define PerlIO_stdout() (*PL_StdIO->pStdout)(PL_StdIO)
+#define PerlIO_stdin() (*PL_StdIO->pStdin)(PL_StdIO)
+#define PerlIO_clearerr(f) (*PL_StdIO->pClearerr)(PL_StdIO, (f))
+#define PerlIO_fdopen(f,s) (*PL_StdIO->pFdopen)(PL_StdIO, (f),(s))
+#define PerlIO_getc(f) (*PL_StdIO->pGetc)(PL_StdIO, (f))
+#define PerlIO_ungetc(f,c) (*PL_StdIO->pUngetc)(PL_StdIO, (c),(f))
+#define PerlIO_tell(f) (*PL_StdIO->pTell)(PL_StdIO, (f))
+#define PerlIO_seek(f,o,w) (*PL_StdIO->pSeek)(PL_StdIO, (f),(o),(w))
+#define PerlIO_error(f) (*PL_StdIO->pError)(PL_StdIO, (f))
+#define PerlIO_write(f,buf,size) (*PL_StdIO->pWrite)(PL_StdIO, (buf), (size),1, (f))
+#define PerlIO_puts(f,s) (*PL_StdIO->pPuts)(PL_StdIO, (f),(s))
+#define PerlIO_read(f,buf,size) (*PL_StdIO->pRead)(PL_StdIO, (buf), (size), 1, (f))
+#define PerlIO_eof(f) (*PL_StdIO->pEof)(PL_StdIO, (f))
+#define PerlIO_fdupopen(f) (*PL_StdIO->pFdupopen)(PL_StdIO, (f))
+#define PerlIO_reopen(p,m,f) (*PL_StdIO->pReopen)(PL_StdIO, (p), (m), (f))
+#define PerlIO_open(x,y) (*PL_StdIO->pOpen)(PL_StdIO, (x),(y))
+
+#ifdef HAS_SETLINEBUF
+#define PerlIO_setlinebuf(f) (*PL_StdIO->pSetlinebuf)(PL_StdIO, (f))
+#else
+#define PerlIO_setlinebuf(f) setvbuf(f, Nullch, _IOLBF, 0)
+#endif
+
+#define PerlIO_isutf8(f) 0
+
+#ifdef USE_STDIO_PTR
+#define PerlIO_has_cntptr(f) 1
+#define PerlIO_get_ptr(f) FILE_ptr(f)
+#define PerlIO_get_cnt(f) FILE_cnt(f)
+
+#ifdef STDIO_CNT_LVALUE
+#define PerlIO_canset_cnt(f) 1
+#define PerlIO_set_cnt(f,c) (FILE_cnt(f) = (c))
+#ifdef STDIO_PTR_LVALUE
+#ifdef STDIO_PTR_LVAL_NOCHANGE_CNT
+#define PerlIO_fast_gets(f) 1
+#endif
+#endif /* STDIO_PTR_LVALUE */
+#else /* STDIO_CNT_LVALUE */
+#define PerlIO_canset_cnt(f) 0
+#define PerlIO_set_cnt(f,c) abort()
+#endif
+
+#ifdef STDIO_PTR_LVALUE
+#ifdef STDIO_PTR_LVAL_NOCHANGE_CNT
+#define PerlIO_set_ptrcnt(f,p,c) STMT_START {FILE_ptr(f) = (p), PerlIO_set_cnt(f,c);} STMT_END
+#else
+#ifdef STDIO_PTR_LVAL_SETS_CNT
+/* assert() may pre-process to ""; potential syntax error (FILE_ptr(), ) */
+#define PerlIO_set_ptrcnt(f,p,c) STMT_START {FILE_ptr(f) = (p); assert(FILE_cnt(f) == (c));} STMT_END
+#define PerlIO_fast_gets(f) 1
+#else
+#define PerlIO_set_ptrcnt(f,p,c) abort()
+#endif
+#endif
+#endif
+
+#else /* USE_STDIO_PTR */
+
+#define PerlIO_has_cntptr(f) 0
+#define PerlIO_canset_cnt(f) 0
+#define PerlIO_get_cnt(f) (abort(),0)
+#define PerlIO_get_ptr(f) (abort(),(void *)0)
+#define PerlIO_set_cnt(f,c) abort()
+#define PerlIO_set_ptrcnt(f,p,c) abort()
+
+#endif /* USE_STDIO_PTR */
+
+#ifndef PerlIO_fast_gets
+#define PerlIO_fast_gets(f) 0
+#endif
+
+#ifdef FILE_base
+#define PerlIO_has_base(f) 1
+#define PerlIO_get_bufsiz(f) (*PL_StdIO->pGetBufsiz)(PL_StdIO, (f))
+#define PerlIO_get_base(f) (*PL_StdIO->pGetBase)(PL_StdIO, (f))
+#else
+#define PerlIO_has_base(f) 0
+#define PerlIO_get_base(f) (abort(),(void *)0)
+#define PerlIO_get_bufsiz(f) (abort(),0)
+#endif
+
+#define PerlIO_importFILE(f,fl) (f)
+#define PerlIO_exportFILE(f,fl) (f)
+#define PerlIO_findFILE(f) (f)
+#define PerlIO_releaseFILE(p,f) ((void) 0)
+
+#endif /* ___NWStdio_H___ */
diff --git a/NetWare/perlsdio.h b/NetWare/perlsdio.h
new file mode 100644
index 0000000000..fad4277e8e
--- /dev/null
+++ b/NetWare/perlsdio.h
@@ -0,0 +1,18 @@
+--- perlsdio.h.old Sat Jun 30 14:42:22 2001
++++ perlsdio.h Sat Jun 30 14:59:49 2001
+@@ -1,4 +1,9 @@
+ #ifdef PERLIO_IS_STDIO
++
++#ifdef NETWARE
++ #include "nwstdio.h"
++#else
++
+ /*
+ * This file #define-s the PerlIO_xxx abstraction onto stdio functions.
+ * Make this as close to original stdio as possible.
+@@ -136,4 +141,5 @@
+ #define PerlIO_get_bufsiz(f) (abort(),0)
+ #endif
+
++#endif /* NETWARE */
+ #endif /* PERLIO_IS_STDIO */
diff --git a/NetWare/t/Readme.txt b/NetWare/t/Readme.txt
index 6f82a3f9c1..32624177c9 100644
--- a/NetWare/t/Readme.txt
+++ b/NetWare/t/Readme.txt
@@ -4,41 +4,75 @@
-A set of Standard Unit Test Scripts to test all the functionalities of Perl5 Interpreter are available along with the CPAN download. They are all located under 't' folder. These include sub-folders under 't' such as: 'base', 'cmd', 'comp', 'io', lib', 'op', 'pod', 'pragma' and 'run'. Each of these sub-folders contain few test scripts ('.t' files) under them.
-
-Executing these test scripts on NetWare can be automated as per the following:
-
-1. Generate automated scripts like 'base.pl', 'cmd.pl', 'comp.pl', 'io.pl', 'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' that execute all the test scripts ('.t' files) under the corresponding folder.
-For example, 'base.pl' to test all the scripts under 'sys:\perl\scripts\t\base' folder,
- 'comp.pl' to test all the scripts under 'sys:\perl\scripts\t\comp' folder and so on.
-
-2. Generate an automated script, 'nwauto.pl' that executes all the above mentioned '.pl' automated scripts, thus in turn executing all the '.t' scripts.
-
-The script, 'NWScripts.pl' available under the 'NetWare\t' folder of the CPAN download, is written to generate these automated scripts when executed on a NetWare server. It generates 'base.pl', 'cmd.pl', 'comp.pl', 'io.pl', 'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' and also 'nwauto.pl' by including all the corresponding '.t' scripts in them in backtick operators.
-For example, all the scripts that are under 't\base' folder will be entered in 'base.pl' and so on. 'nwauto.pl' includes all these '.pl' scripts like 'base.pl', 'comp.pl' etc.
-
-
-The following steps elicits the procedure for executing the automated scripts:
+A set of Standard Unit Test Scripts to test all the functionalities of
+Perl5 Interpreter are available along with the CPAN download. They are
+all located under 't' folder. These include sub-folders under 't' such
+as: 'base', 'cmd', 'comp', 'io', lib', 'op', 'pod', 'pragma' and 'run'.
+Each of these sub-folders contain few test scripts ('.t' files) under
+them.
+
+Executing these test scripts on NetWare can be automated as per the
+following:
+
+1. Generate automated scripts like 'base.pl', 'cmd.pl', 'comp.pl', 'io.pl',
+'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' that execute all the
+test scripts ('.t' files) under the corresponding folder.
+
+For example, 'base.pl' to test all the scripts
+ under 'sys:\perl\scripts\t\base' folder,
+ 'comp.pl' to test all the scripts
+ under 'sys:\perl\scripts\t\comp' folder and so on.
+
+2. Generate an automated script, 'nwauto.pl' that executes all the above
+mentioned '.pl' automated scripts, thus in turn executing all the '.t'
+scripts.
+
+The script, 'NWScripts.pl' available under the 'NetWare\t' folder of the
+CPAN download, is written to generate these automated scripts when
+executed on a NetWare server. It generates 'base.pl', 'cmd.pl', 'comp.pl',
+'io.pl', 'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' and also
+'nwauto.pl' by including all the corresponding '.t' scripts in them in
+backtick operators.
+
+For example, all the scripts that are under 't\base' folder will be
+entered in 'base.pl' and so on. 'nwauto.pl' includes all these '.pl'
+scripts like 'base.pl', 'comp.pl' etc.
+
+Perform the following steps to execute the automated scripts:
1. Make sure that your NetWare server is mapped to "i:".
-2. Execute "nmake nwinstall" (after complete build) in the 'NetWare' folder of the CPAN download. This installs all the library files, perl modules and all the 't' scripts in appropriate folders onto your server.
+2. Execute "nmake nwinstall" (after building interpreter and extensions)
+in the 'NetWare' folder of the CPAN download. This installs all the
+library files, perl modules and all the 't' scripts in appropriate
+folders onto your server.
-3. Copy all the files from 'NetWare\t' folder of the CPAN download into 'sys:\perl\scripts\t' folder.
+3. Execute the command "perl t\NWModify.pl" on the console command
+prompt of your server. This script replaces
-4. Execute the command "perl t\NWModify.pl" on the console command prompt of your server. This script replaces
"@INC = " with "unshift @INC, " and
"push @INC, " with "unshift @INC, "
- from all the scripts under 'sys:\perl\scripts\t' folder.
-This is done to include the correct path for libraries into the scripts when executed on NetWare. If this is not done, some of the scripts will not get executed since they cannot locate the corresponding libraries.
+from all the scripts under 'sys:\perl\scripts\t' folder.
+
+This is done to include the correct path for libraries into the scripts
+when executed on NetWare. If this is not done, some of the scripts will
+not get executed since they cannot locate the corresponding libraries.
-5. Execute the command "perl t\NWScripts.pl" on the console command prompt to generate the automated scripts mentioned above under the 'sys:\perl\scripts\t' folder.
+4. Execute the command "perl t\NWScripts.pl" on the console command
+prompt to generate the automated scripts mentioned above
+under the 'sys:\perl\scripts\t' folder.
-6. Execute the command "perl t\nwauto.pl" on the server console command prompt. This runs all the standard test scripts. If you desire to redirect or save the results into a file, say 'nwauto.txt', then the console command to execute is: "perl t\nwauto.pl > nwauto.txt".
+5. Execute the command "perl t\nwauto.pl" on the server console command
+prompt. This runs all the standard test scripts. If you desire to
+redirect or save the results into a file, say 'nwauto.txt', then the
+console command to execute is: "perl t\nwauto.pl > nwauto.txt".
-7. If you wish to execute only a certain set of scripts, then run the corresponding '.pl' file.
-For example, if you wish to execute only the 'lib' scripts, then execute 'lib.pl' through the server console command, "perl t\lib.pl'. To redirect the results into a file, the console command is, "perl t\lib.pl > lib.txt".
+6. If you wish to execute only a certain set of scripts, then run the
+corresponding '.pl' file. For example, if you wish to execute only the
+'lib' scripts, then execute 'lib.pl' through the server console command,
+"perl t\lib.pl'. To redirect the results into a file, the console command
+ is, "perl t\lib.pl > lib.txt".
@@ -48,13 +82,18 @@ The following scripts are commented out in the corresponding autoscript:
1. 'openpid.t' in 'sys:\perl\scripts\t\io.pl' script
Reason:
- This either hangs or abends the server when executing through auto scripts. When run individually, the script execution goes through fine.
+ This either hangs or abends the server when executing through auto
+ scripts. When run individually, the script execution goes through
+ fine.
2. 'argv.t' in 'sys:\perl\scripts\t\io.pl' script
Reason:
- This either hangs or abends the server when executing through auto scripts. When run individually, the script execution goes through fine.
+ This either hangs or abends the server when executing through auto
+ scripts. When run individually, the script execution goes through
+ fine.
3. 'filehandle.t' in 'sys:\perl\scripts\t\lib.pl' script
Reason:
- This hangs in the last test case where it uses FileHandle::Pipe whether run individually or through an auto script.
+ This hangs in the last test case where it uses FileHandle::Pipe
+ whether run individually or through an auto script.