# $(CWD_NLP) \
# cwd.pm needs to be modifed for NetWare.
-# Begin - Following is required to build NetWare specific extensions Perl2UCS & CGI2Perl
-PERL2UCS = $(EXTDIR)\Perl2UCS\Perl2UCS
-CGI2PERL = CGI2Perl\CGI2Perl
+# Begin - Following is required to build NetWare specific extensions Perl2UCS, UCSExt & CGI2Perl
-PERL2UCS_NLP = $(AUTODIR)\Perl2UCS\Perl2UCS.nlp
-CGI2PERL_NLP = \CGI2Perl\CGI2Perl.nlp
+PERL2UCS = $(EXTDIR)\Perl2UCS\Perl2UCS
+UCSEXT = $(EXTDIR)\UCSExt\UCSExt
+CGI2PERL = CGI2Perl\CGI2Perl
+
+PERL2UCS_NLP = $(AUTODIR)\Perl2UCS\Perl2UCS.nlp
+UCSEXT_NLP = $(AUTODIR)\UCSExt\UCSExt.nlp
+CGI2PERL_NLP = \CGI2Perl\CGI2Perl.nlp
NETWARE_EXTNS = \
$(PERL2UCS_NLP) \
+ $(UCSEXT_NLP) \
$(CGI2PERL_NLP)
# End
+
ECHO_SRC = TestNLM\echo\echo.c
TYPE_SRC = TestNLM\type\type.c
ECHO_SRC_OBJ = $(ECHO_SRC:.c=.obj)
!endif #!ifdef WATCOM
!endif #!ifndef BASE_LIBRARIES
-COPYRIGHT = Copyright 2001 by Novell, Inc. All rights reserved.
+COPYRIGHT = (C) Copyright 2001-2002 Novell Inc. All rights reserved.
EXPORTS = Export @perl.imp
DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re \
Data/Dumper Devel/Peek ByteLoader Devel/DProf File/Glob \
Storable/Storable List/Util MIME/Base64/Base64 \
- XS/Typemap/Typemap Unicode/Normalize/Normalize Sys/Hostnamees
+ XS/Typemap/Typemap Unicode/Normalize/Normalize Sys/Hostname
STATIC_EXT = DynaLoader
@copy << stdio.h >\nul
/*
- * Copyright © 2001 Novell, Inc. All Rights Reserved.
+ * (C) Copyright 2001-2002 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.
@copy << string.h >\nul
/*
- * Copyright © 2001 Novell, Inc. All Rights Reserved.
+ * (C) Copyright 2001-2002 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.
# $(MINIPERL) -I..\lib config_sh.PL $(NW_CFG_VARS) config.nw5 > ..\config.sh
# @pause
# cd ..
-# del config.sh
+# del /f /q config.sh
# rename nwconfig.sh config.sh
# cd netware
cd ..\..\netware
!endif
+$(UCSEXT_NLP):
+!if "$(NW_EXTNS)"=="yes"
+ cd $(EXTDIR)\$(*B)
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
+ cd ..\..\netware
+!endif
+
nwclean:
-rmdir /s /q $(REL_DIR)
-rmdir /s /q $(DEB_DIR)
-del /f /q $(CONFIGPM)
-del /f /q bin\*.bat
cd $(EXTDIR)
- -del /s /q *.lib *.def *.map *.pdb *.bs Makefile *$(o) pm_to_blib *.xdc *.err
+ -del /s /f /q *.lib *.def *.map *.pdb *.bs Makefile *$(o) pm_to_blib *.xdc *.err
cd ..\netware
!if "$(NW_EXTNS)"=="yes"
cd cgi2perl
cd $(EXTDIR)\Perl2UCS
-del /f /q *.obj *.bs Makefile *$(o) *.c pm_to_blib *.xdc *.err *.sym *.map *.c
cd ..\..\netware
+ cd $(EXTDIR)\UCSExt
+ -del /f /q *.obj *.bs Makefile *$(o) *.c pm_to_blib *.xdc *.err *.sym *.map *.c
+ cd ..\..\netware
!endif
-rmdir /s /q $(AUTODIR)
-rmdir /s /q $(COREDIR)
@rem CREATED: Sat Apr 14 13:05:44 2001
@rem LAST REVISED: Sat Apr 14 2001
@rem Batch file to toggle b/n building and not building NetWare
-@rem specific extns - cgi2perl & perl2ucs.
+@rem specific extns - cgi2perl, perl2ucs & ucsext.
if "%1" == "" goto Usage
nlmHandle = FindNLMHandle(mod_name8);
}
}
- //use UCSExt encountered-
+ //use Perl2UCS or UCSExt encountered :
//initialize UCS, this has to be terminated when the script finishes execution
//Is the script intending to use UCS Extensions?
//This should be done once per script execution
- if (strcmp(mod_name,"Perl2UCS.nlp")==0)
+ if ((strcmp(mod_name,"Perl2UCS.nlp")==0) || (strcmp(mod_name,"UCSExt.nlp")==0))
{
unsigned int moduleHandle = 0;
moduleHandle = FindNLMHandle("UCSCORE.NLM");
EXTERN_C void Perl_nw5_init(int *argcp, char ***argvp);
EXTERN_C void boot_DynaLoader (pTHX_ CV* cv);
+EXTERN_C BOOL Remove_Thread_Ctx(void);
+
ClsPerlHost::ClsPerlHost()
{
ClsPerlHost::PerlDestroy(PerlInterpreter *my_perl)
{
perl_destruct(my_perl); // Destructor for Perl.
+}
+
+void
+ClsPerlHost::PerlFree(PerlInterpreter *my_perl)
+{
perl_free(my_perl); // Free the memory allocated for Perl.
+ // Remove the thread context set during Perl_set_context
+ // This is added here since for web script there is no other place this gets executed
+ // and it cannot be included into cgi2perl.xs unless this symbol is exported.
+ Remove_Thread_Ctx();
}
/*============================================================================================
}
nlm.PerlDestroy(my_perl);
}
+ if(my_perl)
+ nlm.PerlFree(my_perl);
#ifdef USE_ITHREADS
if (new_perl)
{
PERL_SET_THX(new_perl);
nlm.PerlDestroy(new_perl);
+ nlm.PerlFree(my_perl);
}
#endif
//
IPerlHost* AllocStdPerl()
{
- return new ClsPerlHost();
+ return (IPerlHost*) new ClsPerlHost();
}
//
void FreeStdPerl(IPerlHost* pPerlHost)
{
- delete (ClsPerlHost*) pPerlHost;
+ if (pPerlHost)
+ delete (ClsPerlHost*) pPerlHost;
}
-
int PerlParse(PerlInterpreter *my_perl, int argc, char** argv, char** env);
int PerlRun(PerlInterpreter *my_perl);
void PerlDestroy(PerlInterpreter *my_perl);
+ void PerlFree(PerlInterpreter *my_perl);
+
bool RegisterWithThreadTable(void);
bool UnregisterWithThreadTable(void);
};
virtual int PerlParse(PerlInterpreter *my_perl,int argc, char** argv, char** env) = 0;
virtual int PerlRun(PerlInterpreter *my_perl) = 0;
virtual void PerlDestroy(PerlInterpreter *my_perl) = 0;
+ virtual void PerlFree(PerlInterpreter *my_perl) = 0;
+
virtual bool RegisterWithThreadTable(void)=0;
virtual bool UnregisterWithThreadTable(void)=0;
};
nw_telldir(DIR *dirp)
{
dTHX;
- Perl_croak(aTHX_ "telldir function is not implemented");
+ Perl_croak(aTHX_ "The telldir() function is not implemented on NetWare\n");
return 0l;
}
dTHR;
return des_fcrypt(txt, salt, w32_crypt_buffer);
#else
- Perl_croak(aTHX_ "The crypt() function is unimplemented due to excessive paranoia.");
+ Perl_croak(aTHX_ "The crypt() function is not implemented on NetWare\n");
return Nullch;
#endif
}
int
nw_flock(int fd, int oper)
{
+ dTHX;
+ Perl_croak(aTHX_ "The flock() function is not implemented on NetWare\n");
return 0;
}
nw_rewinddir(DIR *dirp)
{
dTHX;
- Perl_croak(aTHX_ "rewinddir function is not implemented");
+ Perl_croak(aTHX_ "The rewinddir() function is not implemented on NetWare\n");
}
void
nw_seekdir(DIR *dirp, long loc)
{
dTHX;
- Perl_croak(aTHX_ "seekdir function is not implemented");
+ Perl_croak(aTHX_ "The seekdir() function is not implemented on NetWare\n");
}
int *
#include <fcntl.h>
#include <sys/stat.h>
+// This is defined here since arpa\inet.h defines this array as an extern,
+// and arpa\inet.h gets included by the inet_ntoa call.
+char nwinet_scratch[18] = {'\0'};
+
+
u_long
nw_htonl(u_long hostlong)
{
return inet_addr((char*)cp);
}
+char *
+nw_inet_ntoa(struct in_addr in)
+{
+ return inet_ntoa(in);
+}
+
SOCKET
nw_socket(int af, int type, int protocol)
{
int nw_getsockopt(SOCKET s, int level, int optname, char *optval, int *optlen);
unsigned long nw_inet_addr(const char *cp);
+char * nw_inet_ntoa(struct in_addr in);
void nw_endhostent();
void nw_endnetent();
//For now let us just see when this happens -sgp.
#define COND_INIT(c) \
STMT_START { \
- ConsolePrintf("In COND_INIT\n"); \
+ /*ConsolePrintf("In COND_INIT\n"); */\
} STMT_END
/* (c)->waiters = 0; \
#define COND_SIGNAL(c) \
STMT_START { \
- ConsolePrintf("In COND_SIGNAL\n"); \
+ /*ConsolePrintf("In COND_SIGNAL\n"); */\
} STMT_END
/*if ((c)->waiters > 0 && \
SignalLocalSemaphore((c)->sem) != 0) \
#define COND_BROADCAST(c) \
STMT_START { \
- ConsolePrintf("In COND_BROADCAST\n"); \
+ /*ConsolePrintf("In COND_BROADCAST\n"); */\
} STMT_END
/*if ((c)->waiters > 0 ) { \
} \*/
#define COND_WAIT(c, m) \
STMT_START { \
- ConsolePrintf("In COND_WAIT\n"); \
+ /*ConsolePrintf("In COND_WAIT\n"); */\
} STMT_END
#define COND_DESTROY(c) \
STMT_START { \
- ConsolePrintf("In COND_DESTROY\n"); \
+ /*ConsolePrintf("In COND_DESTROY\n"); */\
} STMT_END
/* (c)->waiters = 0; \
open(FH, "+< $FileToProcess") or die "Unable to open the file, $FileToProcess for reading and writing.\n";
@ARRAY = <FH>; # Get the contents of the file into an array.
- flock(FH, LOCK_EX); # Lock the file for safety purposes.
foreach $Line(@ARRAY) # Get each line of the file.
{
if($Line =~ m/\@INC = /)
seek(FH, 0, 0); # Seek to the beginning.
print FH @ARRAY; # Write the changed array into the file.
- flock(FH, LOCK_UN); # unlock the file.
close FH; # close the file.
$FilesRead++; # One more file read.
open(FHWA, "> t/nwauto.pl") or die "Unable to open the file, t/nwauto.pl for writing.\n";
seek(FHWA, 0, 0); # seek to the beginning of the file.
-flock(FHWA, LOCK_EX); # Lock the file for safety purposes.
$version = sprintf("%vd",$^V);
print FHWA "\n\nprint \"Automated Unit Testing of Perl$version for NetWare\\n\\n\\n\"\;\n\n\n";
# Write into the intermediary auto script.
open(FHW, ">> $IntAutoScript") or die "Unable to open the file, $IntAutoScript for appending.\n";
seek(FHW, 0, 2); # seek to the end of the file.
- flock(FHW, LOCK_EX); # Lock the file for safety purposes.
$pos = tell(FHW);
if($pos <= 0)
$index++;
}
- flock(FHW, LOCK_UN); # unlock the file.
close FHW; # close the file.
if($index <= 0)
# Write into the intermediary auto script.
open(FHW, ">> $IntAutoScript") or die "Unable to open the file, $IntAutoScript for appending.\n";
seek(FHW, 0, 2); # seek to the end of the file.
- flock(FHW, LOCK_EX); # Lock the file for safety purposes.
# Write into the intermediary auto script.
print FHW "\nprint \"Testing of $DirItem folder done!\\n\\n\"\;\n\n";
- flock(FHW, LOCK_UN); # unlock the file.
close FHW; # close the file.
}
}
# Write into nwauto.pl
print FHWA "\nprint \"Automated Unit Testing of Perl$version for NetWare done!\\n\\n\"\;\n\n";
-flock(FHWA, LOCK_UN); # unlock the file.
close FHWA; # close the file.
print "\n\nGeneration of t/nwauto.pl Done!\n\n";
nw_setprotoent
nw_setservent
nw_setsockopt
+ nw_inet_ntoa
nw_shutdown
nw_crypt
nw_execvp