summaryrefslogtreecommitdiff
path: root/ext
Commit message (Collapse)AuthorAgeFilesLines
* Correct punctuation in some POSIX error messagesFather Chrysostomos2011-09-172-39/+39
| | | | | | | | | | | Commit fa22ee54 changed some of the POSIX error messages to be more consistent, but in doing so made many of them grammatically incorrect. It is almost always incorrect in English to join two independent clauses with a comma. I don’t think it’s particularly important that error messages be gram- matical; I just don’t want them getting worse over time. Hence, I have not touched those that were already ungrammatical.
* POSIX::access() doesn't do ENOTDIR on VMS.Craig A. Berry2011-09-171-1/+1
| | | | Even though the underlying error is RMS$_DNF. Go figure.
* Tests for goto &xsub and lexical hintsFather Chrysostomos2011-09-162-0/+25
| | | | | This new script tests that goto &xsub causes the sub to see the hints, not of the subroutine it replaces, but of that subroutine’s caller.
* update B::Concise test for B::Deparse changeZefram2011-09-161-0/+1
|
* Assorted File::Glob test fix-ups following 528bd3ce85.Craig A. Berry2011-09-161-24/+32
| | | | | | | | | | - Avoid list assignment to %ENV, which fails at compile time on VMS. - Use consistent indentation for readability. - Mark bsd_glob('~') tests TODO on VMS. The HOME path is successfully retrieved, but it normally contains square brackets, which confuse glob, because it thinks the directory portion of the path contained within brackets is a pattern. The path probably needs to be converted to Unix syntax first.
* Change POSIX::Termios::setattr() to default to TCASNOW, not 0.Nicholas Clark2011-09-131-1/+8
| | | | | | | | 0 isn't valid on all operating systems. TCASNOW has the value 0 on most operating systems, but on Solaris (at least) TCASNOW, TCSADRAIN and TCSAFLUSH have the same values as the equivalent ioctls, TCSETS, TCSETSW and TCSETSF. Solaris faults 0, setting errno to EINVAL. This isn't useful as a default behaviour.
* Remove unneeded fallback definitions of dNOOP, dVAR etc from POSIX.xsNicholas Clark2011-09-131-20/+0
| | | | | | As POSIX.xs is not dual life, we can always rely on these macros being defined for us in perl.h. (And these days, dual life XS code should let Devel::PPPort take care of this sort of thing.)
* Merge the implementations of POSIX::{asctime,mktime} using ALIAS.Nicholas Clark2011-09-131-34/+18
| | | | | | This shares identical code marshaling 6 to 9 input arguments into a struct tm. However, as the return types differ we have to explicitly code pushing the return value onto perl's stack.
* Merge the implementations of POSIX::{access,mkfifo} using ALIAS.Nicholas Clark2011-09-131-7/+8
|
* Merge the implementations of POSIX::{close,dup,tcdrain} using ALIAS.Nicholas Clark2011-09-131-8/+8
| | | | On this platform, this reduces the shared object size by about .5K.
* Add tests for POSIX::{access,close,dup,dup2}.Nicholas Clark2011-09-131-2/+51
|
* In ext/POSIX/t/sysconf.t, make the tests more strict.Nicholas Clark2011-09-131-8/+5
| | | | | | $! should always be 0 after each call, so test this whether the result is defined or undefined. Match a defined result against a regex to ensure that it is an integer, and give better diagnostics if it is not.
* In ext/POSIX/t/sysconf.t, refactor the API of _check_and_report().Nicholas Clark2011-09-131-24/+18
| | | | The new API removes a lot of code repetition in the callers.
* In various POSIX tests, make better use of Test::More.Nicholas Clark2011-09-133-35/+38
| | | | | Avoid using ok() when alternatives are available, as ok() can't give useful diagnostics on failure.
* Merge the implementations of 11 is*() functions in POSIX using XSANY.Nicholas Clark2011-09-131-154/+74
| | | | | | | is{alnum,alpha,cntrl,digit,graph,lower,print,punct,space,upper,xdigit} have identical structures, so replace them with one body to marshal arguments between Perl and C, calling the C library is*() function via a function pointer stored in the CV's XSANY.
* Merge the implementations of 10 maths functions in POSIX using ALIAS.Nicholas Clark2011-09-131-36/+44
| | | | | | 10 functions take a single NV argument and return an NV result. Merging them reduces the shared object size by over 2K on this platform. (Argument marshalling code in XS is not free.)
* Further tests for POSIX trigonometric and hyperbolic functions.Nicholas Clark2011-09-131-1/+31
|
* Change POSIX::localeconv() to a table-driven implementation.Nicholas Clark2011-09-131-63/+58
| | | | | | This removes a lot of copy-paste code. [with a tweak by Ilmari that removed residual duplication]
* Add tests for POSIX::localeconv().Nicholas Clark2011-09-131-3/+31
|
* Merge the implementations of 2 sets of POSIX functions.Nicholas Clark2011-09-131-15/+14
| | | | | | Using ALIAS to merge POSIX::sig{pending,suspend} and POSIX::tc{flow,flush,sendbreak} reduces the size of POSIX.so by about 2K on this platform.
* Merge the implementations of 4 sets of POSIX::Termios methods.Nicholas Clark2011-09-131-87/+53
| | | | | | Using ALIAS to merge cfget[io]speed(), get[cloi]flag(), cfset[io]speed() and set[cloi]flag() reduces the size of POSIX.so by almost 2K on this platform.
* Merge the implementations of 2 pairs of POSIX::SigSet methods.Nicholas Clark2011-09-131-11/+14
| | | | | | Using ALIAS to merge addset() with delset() and emptyset() with fillset() reduces the shared object size, by removing duplicate marshaling code for arguments and return values. On this platform the saving is over .5K
* Store sigset_t used by POSIX::SigSet directly in the object SV.Nicholas Clark2011-09-132-23/+16
| | | | | | | | | | | | | | Previously POSIX::SigSet was using the PTROBJ typemap to store a pointer to a dynamically-allocated sigset_t as an IV (blessed into the class) This requires an explicit DESTROY to free the dynamic allocation, but fails badly if any POSIX::SigSet objects exist at ithread clone time, as the dynamic allocation is not duplicated in the new thread. (DESTROY is called in both threads, free-from-wrong pool or other jollity occurs.) Removing dynamic allocation removes the need for a DESTROY method. This change is analogous to the previous change in POSIX::Termios, and is made for the same reason.
* In POSIX.xs, extract allocate_struct() from POSIX::Termios::new().Nicholas Clark2011-09-131-7/+13
| | | | | The same code will be needed for POSIX::SigSet::new(), so share it as a small static function.
* Add tests for POSIX::SigSet.Nicholas Clark2011-09-131-0/+96
|
* Store struct termios used by POSIX::Termios directly in the object SV.Nicholas Clark2011-09-132-16/+28
| | | | | | | | | | | | | | | | | Previously POSIX::Termios was using the PTROBJ typemap to store a pointer to a dynamically-allocated struct termios as an IV (blessed into the class). This requires an explicit DESTROY to free the dynamic allocation, but fails badly if any POSIX::Termios objects exist at ithread clone time, as the dynamic allocation is not duplicated in the new thread. (DESTROY is called in both threads, free-from-wrong pool or other jollity occurs.) Removing dynamic allocation removes the need for a DESTROY method. This introduces a new OPAQUEPTROBJ typemap, but currently doesn't use the OUTPUT section, as that copies an existing structure, whereas POSIX::Termios->new() only needs to zero-allocate the right space. Assuming that this typemap should be of general applicability, it should be moved to the main typemap file.
* Add tests for POSIX::tc{drain,flow,flush,sendbreak}()Nicholas Clark2011-09-131-0/+18
| | | | | | We don't want to mess with the user's terminal (as we might mess it up), so attempt to call each function on a disk file, and verify that it fails with ENOTTY.
* Add tests for POSIX::Termios->setattr().Nicholas Clark2011-09-131-0/+12
| | | | | | We don't want to mess with the user's terminal (as we might mess it up), so attempt to call tcsetattr() on a disk file, and verify that it fails with ENOTTY.
* Add tests for POSIX::Termios->setcc().Nicholas Clark2011-09-131-0/+21
|
* Add tests for POSIX::Termios->get[iocf]flags().Nicholas Clark2011-09-131-0/+33
|
* Add tests for POSIX::Termios->get[io]speed().Nicholas Clark2011-09-131-0/+25
|
* Add tests for passing POSIX::Termios->getcc() out of range subscripts.Nicholas Clark2011-09-131-0/+5
|
* In termios.t, avoid reading uninitialised memory in the tests.Nicholas Clark2011-09-131-22/+39
| | | | | | | | | | If no terminal devices are found, or getattr() fails on all of them, then the struct termios wrapped by the POSIX:Termios object will consist of initialised memory. In this case, it's not possible to use getcc() or the other get*() methods on it. Try harder to find a terminal device - as well as STDIN, STDOUT and STDERR also try to open the controlling terminal directly.
* Refactor ext/POSIX/t/termios.tNicholas Clark2011-09-131-43/+25
| | | | | | | | | | * Only import termios.h functions and constants from POSIX * Loop over STDIN, STDOUT, STDERR instead of duplicating code. * Avoid a needless defined? test, as isa_ok() handles undef. * Switch to done_testing(), which also allows @getters to be inlined and eliminated. * The various get*() methods return integer values, so check this. * Enable warnings.
* Teach B::Concise about OPpFT_STACKINGFather Chrysostomos2011-09-101-1/+1
|
* The Borland Chainsaw MassacreSteve Hay2011-09-105-17/+8
| | | | | Remove support for the Borland C++ compiler on Win32, as agreed here: http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2011-09/msg00034.html
* Add plain ~ expansion for Windows system in File::GlobDouglas Christopher Wilson2011-09-102-1/+44
| | | | | | | | | | | Previously in File::Glob, a plain ~ expansion will check the $HOME environment variable, but that does not normally exist on Windows systems. There is another variable that holds the appropriate home path value, which is $USERPROFILE. This adds a fallback to check $USERPROFILE when $HOME is not there, the system does not support checking the password file and the system is DOSISH.
* remove index offsetting ($[)Zefram2011-09-094-10/+10
| | | | | | $[ remains as a variable. It no longer has compile-time magic. At runtime, it always reads as zero, accepts a write of zero, but dies on writing any other value.
* Increase $attributes::version to 0.16Father Chrysostomos2011-09-071-1/+1
|
* Convert some files from Latin-1 to UTF-8Keith Thompson2011-09-071-1/+1
|
* ODBM_File can use the same T_PTROBJ typemap as the other ?DBM_File modules.Nicholas Clark2011-09-073-3/+5
| | | | | | | | This simplifies the RETVAL handling in TIEHASH, and makes the code closer to the other 3 ?DBM_File modules. The difference in TIEHASH handling dates back to 5.000, where only ODBM_File needed helper code around the dbm_open() call. The other 3 were able to #define it as dbm_TIEHASH, and hence had no CODE: section when first written.
* In Glob.xs, use memset() instead of bzero()Nicholas Clark2011-09-061-1/+1
| | | | 3c97495f56fb647c used bzero(), which isn't available on some platforms.
* dual-life CarpZefram2011-09-044-1083/+0
| | | | | | | | | Make Carp portable to older Perl versions: * check minimum Perl version (5.6) at load time * use || instead of // * attempt downgrading to avoid loading Unicode tables when that might fail * check whether utf8::is_utf8() exists before calling it * lower IPC::Open3 version requirement in Carp tests
* move Carp to ext/Carp, preparing for dual-lifingZefram2011-09-044-0/+1083
|
* Remove sockadapt layer from the VMS build.Craig A. Berry2011-09-032-26/+22
| | | | | | | | | | | | | | SOCKETSHR is/was an interface to abstract out TCP/IP calls for the various vendors' networking implementations, including the freeware CMU-IP stack. Neither SOCKETSHR nor CMU-IP has seen any maintenance for over a decade and are likely not even C89-compliant. The CRTL socket routines have been supported by the different vendors' stacks for many years so there is no reason to maintain an alternative, and there probably hasn't been a real working alternative for some years anyway. The code is still there in maint-5.14 and earlier branches if anyone has need of it.
* Plug segfault in bsd_glob() with unsupported ALTDIRFUNC flag.Craig A. Berry2011-09-033-2/+9
| | | | | | | | | First, disable all the unsupported flags just to make sure they aren't triggering something they shouldn't be. Also, zero the pglob struct before passing to bsd_glob(); it contains function pointers, and it's safest if they are null rather than containing random stack data. Bug reported by Clément Lecigne <clemun@gmail.com>.
* Change the synopsis in POSIX.pod to stress use POSIX ();Nicholas Clark2011-09-011-2/+4
| | | | | | Explicitly warn that the default of importing everything means that use POSIX; has to import 553 symbols. Hence it's probably better to use an explicit import list, or import nothing.
* Generate @POSIX::EXPORT_OK from %reimpl, %replacement and an exception list.Nicholas Clark2011-09-011-59/+5
| | | | | | | This is considerably terser than listing all the entries for @EXPORT_OK longhand. With this change we can no longer delete from %replacement in AUTOLOAD(), as import() and load_imports() may be called after AUTOLOAD() has already been run.
* Test that @POSIX::EXPORT and @POSIX::EXPORT_OK are not inadvertently changed.Nicholas Clark2011-09-011-0/+116
|
* Remove isatty from @POSIX::EXPORT_OK, as it's already in @EXPORT.Nicholas Clark2011-09-011-1/+0
| | | | | | This effectively reverts commit d925a710473da185, which added it and reformatted the source code. isatty was in (the generated) @EXPORT at that time, hence there was never a need to add it.