summaryrefslogtreecommitdiff
path: root/perliol.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove :win32 PerlIO layerLeon Timmermans2021-06-281-3/+0
|
* style: Detabify indentation of the C code maintained by the core.Michael G. Schwern2021-01-171-5/+5
| | | | | | | | | | | This just detabifies to get rid of the mixed tab/space indentation. Applying consistent indentation and dealing with other tabs are another issue. Done with `expand -i`. * vutil.* left alone, it's part of version. * Left regen managed files alone for now.
* Remove PERLIO_FUNCS_CONSTKarl Williamson2020-11-181-16/+9
| | | | | As the comment said, this was temporary until vtables got to be all const
* Use new paradigm for hdr file double inclusion guardKarl Williamson2017-06-021-3/+3
| | | | | | | | | | We changed to use symbols not likely to be used by non-Perl code that could conflict, and which have trailing underbars, so they don't look like a regular Perl #define. See https://rt.perl.org/Ticket/Display.html?id=131110 There are many more header files which are not guarded.
* remove redundant PERL_EXPORT_C and PERL_XS_EXPORT_C macrosDaniel Dragan2015-06-031-105/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These 2 macros were created for the Symbian port in commit "Symbian port of Perl" to replace a direct "extern" token. I guess the author was unaware of PERL_CALLCONV. PERL_CALLCONV is the official macro to use. PERL_XS_EXPORT_C and PERL_EXPORT_C have no usage on cpan grep except for modules with direct copies of core headers. A defect of using PERL_EXPORT_C and PERL_XS_EXPORT_C instead of PERL_CALLCONV is that win32/win32.h has no knowledge of the 2 macros and doesn't set them, and os/os2ish.h doesn't either. On Win32, since the unix defaults are used instead of Win32 specific "__declspec(dllimport)" token, XS modules use indirect function stubs in each XS module placed by the CC to call into perl5**.dll instead of directly calls the core C functions. I observed this in in XS-Typemap's DLL. To simplify the API, and to decrease the amount of macros needing to implemented to support each platform, just remove the 2 macros. Since perl.h's fallback defaults for PERL_CALLCONV are very late in perl.h, they need to be moved up before function declarations start in perlio.h (perlio.h is included from iperlsys.h). win32iop.h contains the "PerlIO" and SV" tokens, so perlio.h must be included before win32iop.h is. Including perlio.h so early in win32.h, causes PERL_CALLCONV not be defined since Win32 platform uses the fallback in perl.h, since win32.h doesn't always define PERL_CALLCONV and sometimes relies on the fallback. Since win32iop.h contains alot of declarations, it belongs with other declarations such as those in proto.h so move it from win32.h to perl.h. the "free" token in struct regexp_engine conflicts with win32iop's "#define free win32_free" so rename that member.
* Replace common Emacs file-local variables with dir-localsDagfinn Ilmari Mannsåker2015-03-221-6/+0
| | | | | | | | | | | | | | | | An empty cpan/.dir-locals.el stops Emacs using the core defaults for code imported from CPAN. Committer's work: To keep t/porting/cmp_version.t and t/porting/utils.t happy, $VERSION needed to be incremented in many files, including throughout dist/PathTools. perldelta entry for module updates. Add two Emacs control files to MANIFEST; re-sort MANIFEST. For: RT #124119.
* Revert "Fix PerlIO vtables on VMS."Craig A. Berry2015-01-021-5/+1
| | | | | | This reverts commit 0c2c3d000e799a35bdc2bdd24feaf77cf854a2dd. It's not needed after 400638aa931c47.
* Fix PerlIO vtables on VMS.Craig A. Berry2015-01-011-1/+5
| | | | | | | | | | | f0e5c859d36afe5 broke the build because it caused the PerlIO_funcs declarations to be const in perlio.h and EXTPERLIO in perliol.h and on VMS, EXTPERLIO was EXTCONST which is globalref. The compiler considers globalref and const to be incompatible. As a workaround, make EXTPERLIO "extern const" on VMS only. The whole custom global data model on VMS probably needs a rethink, but this gets the build working again.
* Record errno value in IO handlesFather Chrysostomos2014-11-021-0/+8
|
* Added missing prototypes.Brian Fraser2014-02-051-0/+8
| | | | | This was mostly for XS functions defined in the core, but also for a handful of functions in the :stdio layer.
* suppress duplicate line in perliol.hChristian Millour2013-12-201-1/+0
|
* Purge remaining references to PerlIO_sprintf and PerlIO_vsprintf().Nicholas Clark2013-10-071-2/+0
| | | | | | Eliminate their function prototypes. Eliminate references in perlio.sym and makedef.pl which caused them to still be added to the Win32 linker definitions.
* update the editor hints for spaces, not tabsRicardo Signes2012-05-291-2/+2
| | | | | This updates the editor hints in our files for Emacs and vim to request that tabs be inserted as spaces.
* Moving :mmap out of core binary into a moduleLeon Timmermans2012-01-301-14/+0
|
* [perl #78494] Pipes cause threads to hang on join()Father Chrysostomos2011-02-151-0/+1
| | | | | | | | | | | | | or on close() in either thread. close() in one thread blocks until close() is called in the other thread, because both closes are waiting for the child process to end. Since we have a reference-counting mechanism for the underlying fileno, we can use that to determine whether close() should wait. This does not solve the problem of close $OUT block when it has been duplicated via open $OUT2, ">&" and $OUT2 is still in scope.
* Don't export PerlIORaw_open if it doesn't exist anymore.Craig A. Berry2011-01-211-1/+0
| | | | Follow-up to ecfd064986aef03b9b7d8b56da83ae37ff435721.
* Define PerlIOBase_openLeon Timmermans2011-01-201-0/+1
|
* Make PerlIO marginally reentrantDavid Mitchell2010-11-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | Currently if an operation on a file handle is interrupted, and if the signal handler accesses that same file handle (e.g. closes it), then perl will crash. See [perl #75556]. This commit provides some basic infrastructure to avoid segfaults. Basically it adds a lock count field to each handle (by re-purposing the unused flags field in the PL_perlio array), then each time a signal handler is called, the count is incremented. Then various parts of PerlIO use a positive count to change behaviour. Most importantly, when layers are popped, the PerlIOl structure is cleared, but not freed, and is left in the chain of layers. This means that callers still holding pointers to the various layers won't access freed structures. It does however mean that PerlIOl structs may be leaked, and possibly slots in PL_perlio. But this is better than crashing. Not much has been done to give sensible behaviour on re-entrancy; for example, a buffer that has already been written once might get written again. Fixing this sort of thing would require a large-scale audit of perlio.c.
* add 'head' field to PerlIOl structDavid Mitchell2010-11-261-0/+1
| | | | | | | | | | | | | This allows any layer to find the top of the layer stack, or more specifically, the entry in PL_perlio that points to the top. Needed for the next commit, which will implement a reference counting scheme. There's currently a bug in MakeMaker which causes several extensions to miss the dependency on perliol.h having changed, so this commit includes a gratuitous whitespace change to perl.h to hopefully force recompilation.
* make PL_perlio an array of PerlIOl, not PerlIO *David Mitchell2010-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Layers in PerlIO are implemented as a linked list of PerlIOl structs; eaxch one has a 'next' field pointing to the next layer. Now here's the clever bit: When PerlIO* pointers are passed around to refer to a particular handle, these are actually pointers to the 'next' field of the *parent* layer (so to access the flags field say of a PerlIOl, you have to double-defref it, e.g. (*f)->flags). The big advantage of this is that it's easy for a layer to pop itself; when you call PerlIO_pop(f), f is a pointer to the parent's 'next' field, so pop(f) can just do *f = (*f)->next. This means that there has to be a fake 'next' field above the topmost layer. This is where PL_perlio comes in: it's a pointer to an arena of arrays of pointers, each one capable of pointing to a PerlIOl structure. When a new handle is created, a spare arena slot is grabbed, and the address of that slot is returned. This also allows for a handle with no layers. What this commit does is change PL_perlio from being an array of PerlIO* into an array of PerlIOl structures - i.e. each element in the array goes from being a single pointer, to having several fields. These will be made used of in follow-up commits.
* Silence Borland compiler warnings (except for warnings from zlib) here:Steve Hay2008-02-251-1/+1
| | | | | http://www.nntp.perl.org/group/perl.daily-build.reports/2008/02/msg53937.html p4raw-id: //depot/perl@33370
* Add editor blocks to some header files.Marcus Holland-Moritz2008-01-011-0/+10
| | | p4raw-id: //depot/perl@32793
* Re: building mod_perl-2.0.3 with Perl 5.10.0 (DEVEL32096)Jarkko Hietaniemi2007-11-031-1/+1
| | | | | | | | Message-Id: <472BD128.9080105@iki.fi> PerlIO_teardown is called when there may no longer be an interpreter available p4raw-id: //depot/perl@32215
* one more iteration on PerlIO_teardown prototypeJarkko Hietaniemi2007-01-301-1/+4
| | | | | Message-Id: <20070130022021.6051443A67@anubis.hut.fi> p4raw-id: //depot/perl@30079
* More leak fixes, by JarkkoRafael Garcia-Suarez2006-10-201-0/+1
| | | p4raw-id: //depot/perl@29060
* printf.patch: Adding printf checking for gccAndy Lester2005-05-021-3/+2
| | | | | Message-ID: <20050501200755.GA30259@petdance.com> p4raw-id: //depot/perl@24365
* perlio-two.patch: More warnings squashed, more constsAndy Lester2005-04-271-45/+128
| | | | | Message-ID: <20050427150243.GA21883@petdance.com> p4raw-id: //depot/perl@24338
* Symbian port of PerlJarkko Hietaniemi2005-04-211-54/+61
| | | | | Message-ID: <B356D8F434D20B40A8CEDAEC305A1F2453D653@esebe105.NOE.Nokia.com> p4raw-id: //depot/perl@24271
* Third consting batchAndy Lester2005-03-241-1/+1
| | | | | Message-Id: <2f14220e7101a03f7659dbe79a03b115@petdance.com> p4raw-id: //depot/perl@24074
* Retract #20260.Jarkko Hietaniemi2003-07-281-2/+2
| | | p4raw-id: //depot/perl@20267
* (Retracted by #20267)Jarkko Hietaniemi2003-07-281-2/+2
| | | p4raw-id: //depot/perl@20260
* Fix for bugs 21717 and 22140.Nick Ing-Simmons2003-05-101-0/+1
| | | | | | | | Win32's lseek claims to have succeeded in pipes etc. Which confuses :perlio and derived layers. So have :unix's "pushed" method stat() the fd and cache non S_ISREG nature. Have Unix_seek fail if fd is NOT S_ISREG to match UNIX behaviour. p4raw-id: //depot/perlio@19475
* PerlIO Layer implementation future proofing.Nick Ing-Simmons2002-06-201-3/+4
| | | | | | | | | - Inspired by Nick C's suggestion add size of function table to the table as a validation check. - also optimize pseudo-layer code to avoid malloc/link of something destined to be immediately popped & freed. - Minor addition to pod/perliol.pod p4raw-id: //depot/perlio@17330
* "Clean" implementation of binmode(FH)/":raw" identity.Nick Ing-Simmons2002-06-191-0/+2
| | | | | | | New function table entry so all layer definitions need tweaking. Extra function table entry allows a layer to remain on a binmode stack New PerlIOBase_binmode allows easy implementation of default policy. p4raw-id: //depot/perlio@17309
* Last minute tinkering with PerlIO abstraction API.Nick Ing-Simmons2002-06-161-1/+1
| | | | | | | | - PerlIO_importFILE and PerlIO_exportFILE now documented as taking const char *mode. - Other 'flags' field changed to U32 - Discouraging words written about ":raw". p4raw-id: //depot/perlio@17258
* Re: linux + usemorebits: gcc error?Hugo van der Sanden2002-06-131-1/+1
| | | | | | | Message-Id: <200206131403.g5DE3Sk21964@crypt.compulink.co.uk> (go U32 based on NI-S since it's a flags field) p4raw-id: //depot/perl@17222
* Fix the crlf.t buffer leakNick Ing-Simmons2002-05-171-0/+1
| | | | | | | | - actually a generic PerlIOBuf_xxx derived leak-on-pop, but :crlf flagged it because it is more often popped without stream being closed. - Define non-noop PerlIOBuf_popped(), use it and export it. p4raw-id: //depot/perlio@16657
* Fix fd leak on Via(bogus).Nick Ing-Simmons2002-04-271-0/+7
| | | | | | | Finish implementing PerlIOVia_open(). Export more guts of PerlIO_* so Via_open() can work. Fix various PerlIO_allocate() features exposed by above. p4raw-id: //depot/perlio@16207
* perlio.c cleanup - in particular avoid accidental PerlIO_flush(NULL)Nick Ing-Simmons2001-12-311-0/+1
| | | | | if PerlIONext is NULL. p4raw-id: //depot/perlio@13975
* Add pTHX to all vtable functions for future-proofing andNick Ing-Simmons2001-12-191-47/+47
| | | | | consistency of PerlIO layers. p4raw-id: //depot/perlio@13808
* Detypo and rename.Jarkko Hietaniemi2001-12-121-1/+1
| | | p4raw-id: //depot/perl@13637
* Try to handle platforms that have O_TEXT != O_BINARY butJarkko Hietaniemi2001-12-111-1/+1
| | | | | | | which are not DOSish, BeOS being one of such platforms. Ideally this should be a Configure test, not a hardwired cpp symbol test... p4raw-id: //depot/perl@13621
* Allow multi-arg open() if opening layer declares this legal.Nick Ing-Simmons2001-12-081-0/+1
| | | p4raw-id: //depot/perlio@13530
* Allow dup'ing of PerlIO::Scalar etc.Nick Ing-Simmons2001-11-181-4/+4
| | | p4raw-id: //depot/perlio@13072
* PerlIOBuf_dupNicholas Clark2001-10-301-0/+1
| | | | | | | Message-ID: <20011029215235.K41204@plum.flirble.org> Add prototype. p4raw-id: //depot/perl@12779
* Convert rest of PerlIO's memory tables to per-interp and add clone functionsNick Ing-Simmons2001-10-211-2/+2
| | | | | | | | for them. Call explicit cleanup during destruct process. - one binmode test is failing - also ext/threads/t/basic.t fails under make test, and is noisy under harness. (Threads results are intermingled and don't match order expected.) p4raw-id: //depot/perlio@12547
* Skeleton of "PerlIO_dup" coded.Nick Ing-Simmons2001-10-161-2/+3
| | | | | Still-passes all tests non-threaded (well it would wouldn't it!) p4raw-id: //depot/perlio@12451
* Beginings of PerlIO_dup support (unstable)Nick Ing-Simmons2001-10-151-0/+2
| | | p4raw-id: //depot/perlio@12447
* Reindent the PerlIO files (suggested by NI-S), usedJarkko Hietaniemi2001-09-171-92/+90
| | | | | | | | | indent -kr -nce -psl -sc -TSV -TAV -THV -TGV -TIV -TUV -TNV -TMAGIC -TFILE -TPerlIO -TPerlIO_list_t -TPerlIO_funcs -TPerlIO_pair_t (GNU indent). Note that wholesale re-indenting might be nice, but that would break nice formatting/alignment of assignments, equality testing, and complex boolean expressions with lots of &s and |s. p4raw-id: //depot/perl@12052
* Work-in-progress win32 layer semi-functional, checking Nick Ing-Simmons2001-06-161-1/+5
| | | | | for UNIX breakage. p4raw-id: //depot/perlio@10632