summaryrefslogtreecommitdiff
path: root/util.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove NetWare supportDagfinn Ilmari Mannsåker2021-10-081-5/+0
| | | | The build has been broken since 2009.
* util.h: Save a '&' instr by casting to U8Karl Williamson2021-07-301-1/+1
|
* replace all instances of PERL_IMPLICIT_CONTEXT with MULTIPLICITYTomasz Konojacki2021-06-091-2/+2
| | | | | | | | | | | | Since the removal of PERL_OBJECT (acfe0abcedaf592fb4b9cb69ce3468308ae99d91) PERL_IMPLICIT_CONTEXT and MULTIPLICITY have been synonymous and they're being used interchangeably. To simplify the code, this commit replaces all instances of PERL_IMPLICIT_CONTEXT with MULTIPLICITY. PERL_IMPLICIT_CONTEXT will stay defined for compatibility with XS modules.
* style: Detabify indentation of the C code maintained by the core.Michael G. Schwern2021-01-171-12/+12
| | | | | | | | | | | 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.
* autodoc.pl: Enhance apidoc_section featureKarl Williamson2020-11-061-1/+1
| | | | | | | | | | | This feature allows documentation destined for perlapi or perlintern to be split into sections of related functions, no matter where the documentation source is. Prior to this commit the line had to contain the exact text of the title of the section. Now it can be a $variable name that autodoc.pl expands to the title. It still has to be an exact match for the variable in autodoc, but now, the expanded text can be changed in autodoc alone, without other files needing to be updated at the same time.
* Cast parameters to instr, strstrKarl Williamson2020-11-021-1/+1
| | | | | This code isn't apparently compiled on modern platforms, as when I tried to force them to compile, I had to do this.
* Reorganize perlapiKarl Williamson2020-09-041-1/+1
| | | | | This uses a new organization of sections that I came up with. I asked for comments on p5p, but there were none.
* Document ibcmp_utf8, and move to like-fcns hdrKarl Williamson2020-08-221-0/+6
|
* Remove Symbian portDagfinn Ilmari Mannsåker2020-07-201-2/+2
| | | | | Also eliminate USE_HEAP_INSTEAD_OF_STACK and SETSOCKOPT_OPTION_VALUE_T, since Symbian was the only user of those.
* Add memCHRs() macro and use itKarl Williamson2019-12-181-1/+1
| | | | | | | This replaces strchr("list", c) calls throughout the core. They don't work properly when 'c' is a NUL, returning the position of the terminating NUL in "list" instead of failure. This could lead to segfaults or even security issues.
* The VC6 Chainsaw MassacreSteve Hay2019-10-171-3/+2
| | | | | Remove MS Visual C++ 6.0 support as agreed in the thread starting here: https://www.nntp.perl.org/group/perl.perl5.porters/2019/07/msg255625.html
* Document instr()Karl Williamson2019-09-021-0/+10
|
* (perl #134221) support O_APPEND for open ..., undef on VMSTony Cook2019-07-161-0/+11
| | | | | | | | | | VMS doesn't allow you to delete an open file like POSIXish systems do, but you can mark a file to be deleted once it's closed, but only when you open it. Since VMS doesn't (yet) have mkostemp() we can add our own flag to our mkostemp() emulation to pass the necessary magic to open() call to delete the file on close.
* embed.fnc: Add flag for bypass macro existenceKarl Williamson2019-05-301-0/+2
| | | | | | | Sometimes a function is reduced to be a wrapper, and we want for code to directly call the underlying one, but we retain the old 'Perl_foo' function to avoid breaking code that used that form. I've tried various kludges around that, but this seems more promising.
* use Perl_my_mkstemp() where appropriateZefram2017-12-221-0/+5
| | | | | | Since commit e48855bdd2fc57fc51156f5e4b8dee6b544456c8 there has been no need to be conditional about using mkstemp(). Perl_my_mkstemp() is always available, one way or another.
* portable Perl_my_mkostemp()Zefram2017-12-221-0/+3
| | | | | | | | Akin to the existing Perl_my_mkstemp(), Perl_my_mkostemp() is defined as a macro for mkostemp() where available, and otherwise as our own implementation of it. The guts of our own implementations of the two functions are shared. Perl_my_mkostemp() is not guaranteed to handle O_CLOEXEC: that depends on open() handling it.
* util.h: simplify cpp conditionalsAaron Crane2017-10-211-15/+9
|
* Parenthesize macro arguments to ninstr()Karl Williamson2017-09-141-1/+2
| | | | | | | This did not work properly if called if expressions for arguments. Could someone write a porting test to look for non-parenthesized macro arguments involved in expressions
* (perl #127663) add our own mkstemp() implementationTony Cook2017-09-111-0/+4
| | | | | | | | | | | | Needed to generate temp files for safer in-place editing. Not based on any particular implementation, the BSD implementations tend to be wrappers around a megafunction that also does a few variations of mkstemp() and mkdtemp(), which we don't need (yet.) This might also be useful as a replacement for broken mkstemp() implementations that use a mode of 0666 when creating the file, though we'd need to add Configure probing for that.
* (perl #127663) create a separate random source for internal useTony Cook2017-09-111-0/+6
| | | | | and use it to initialize hash randomization and to innoculate against quadratic behaviour in pp_sort
* add PERL_UTIL_H_ to util.h, not util.hDavid Mitchell2017-04-181-0/+6
| | | | | | | With v5.25.11-59-g7335cb8 I added an include guard. PERL_UTIL_H_, but added it to util.c rather than util.h. I am not a smart man....
* Use memmem() if available on the platform for Perl_ninstr()Karl Williamson2016-05-121-0/+5
|
* Reinstate "Make instr() a macro"Karl Williamson2016-05-091-0/+2
| | | | | | This reverts commit 2e08dfb2b133af0fbcb4346f8d096ca68454ca54, thus reinstating the commit it reverted. This was delayed until 5.25. The next commit will solve some problems with c++ that this commit causes
* Revert "Make instr() a macro"Karl Williamson2016-04-081-2/+0
| | | | | | This reverts commit fea1d2dd5d210564d442a09fe034b62f262f35f9 due to it causing problems so close to the release of 5.24. See https://rt.perl.org/Ticket/Display.html?id=127852
* Make instr() a macroKarl Williamson2016-03-171-0/+2
| | | | ... thus avoiding a function call overhead
* perlapi: Add some S<>Karl Williamson2015-09-031-2/+2
| | | | | so that these constructs appear on a single output line for reader convenience.
* 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.
* add filename handling to xs handshakeDaniel Dragan2014-11-131-10/+18
| | | | | | | | | | | | | | | | | | | | | - this improves the error message on ABI incompatibility, per [perl #123136] - reduce the number of gv_fetchfile calls in newXS over registering many XSUBs - "v" was not stripped from PERL_API_VERSION_STRING since string "vX.XX.X\0", a typical version number is 8 bytes long, and aligned to 4/8 by most compilers in an image. A double digit maint release is extremely unlikely. - newXS_deffile saves on machine code in bootstrap functions by not passing arg filename - move newXS to where the rest of the newXS*()s live - move the "no address" panic closer to the start to get it out of the way sooner flow wise (it nothing to do with var gv or cv) - move CvANON_on to not check var name twice - change die message to use %p, more efficient on 32 ptr/64 IV platforms see ML post "about commit "util.c: fix comiler warnings"" - vars cv/xs_spp (stack pointer pointer)/xs_interp exist for inspection by a C debugger in an unoptimized build
* add xs_handshake APIDaniel Dragan2014-11-071-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This API elevates the amount of ABI compatibility protection between XS modules and the interp. It also makes each boot XSUB smaller in machine code by removing function calls and factoring out code into the new Perl_xs_handshake and Perl_xs_epilog functions. sv.c : - revise padlist duping code to reduce code bloat/asserts on DEBUGGING ext/DynaLoader/dlutils.c : - disable version checking so interp startup is faster, ABI mismatches are impossible because DynaLoader is never available as a shared library ext/XS-APItest/XSUB-redefined-macros.xs : - "" means dont check the version, so switch to " " to make the test in xsub_h.t pass, see ML thread "XS_APIVERSION_BOOTCHECK and XS_VERSION is CPP defined but "", mow what?" ext/re/re.xs : - disable API version checking until #123007 is resolved ParseXS/Utilities.pm : 109-standard_XS_defs.t : - remove context from S_croak_xs_usage similar to core commit cb077ed296 . CvGV doesn't need a context until 5.21.4 and commit ae77754ae2 and by then core's croak_xs_uage API has been long available and this backport doesn't need to account for newer perls - fix test where lack of having PERL_IMPLICIT_CONTEXT caused it to fail
* C backtrace tweaks.Jarkko Hietaniemi2014-06-111-0/+6
| | | | | | | | | Rename the environment variable that triggers the backtrace before warns and croaks as PERL_USE_C_BACKTRACE_ON_ERROR (and correspondingly, the define as USE_C_BACKTRACE_ON_ERROR). Pod cleanups and updates, and move the needed #includes from perl.h to util.c since that's the only place where they are needed.
* Add C backtrace API.Jarkko Hietaniemi2014-06-071-0/+72
| | | | | | | | Useful for at least debugging. Supported in Linux and OS X (possibly to some extent in *BSD). See perlhacktips for details.
* perlapi: Refactor placements, headings of some functionsKarl Williamson2014-06-051-0/+2
| | | | | | | | | | | | | | It is not very user friendly to list functions as "Functions found in file FOO". Better is to group them by purpose, as many were already. I went through and placed the ones that weren't already so grouped into groups. Patches welcome if you have a better classification. I changed the headings of some so that the important disctinction was the first word so that they are placed in the file more appropriately. And a couple of ones that I had created myself, I came up with a name that I think is better than the original
* Add a USING_MSVC6 macro to identify Microsoft Visual C++ 6.0Steve Hay2013-09-191-3/+1
| | | | | | | This simplifies some of the logic necessary for coping with its various problems. Suggested by Nicholas Clark.
* Update the comment in util.h related to HAS_QUAD and U64TYPE.Nicholas Clark2013-09-181-1/+3
|
* Fix the VC6 build on Windows following commit 3be8f09452Steve Hay2013-09-131-2/+5
| | | | | | The VC6 compiler has slightly flaky support for __int64 and chokes on util.c when using the 64-bit implementation of drand48, so switch it to the 32-bit version instead.
* [perl #115928] a consistent (public) rand() implementationTony Cook2013-09-131-0/+27
| | | | | | | | | | | | | | | | Based on Yves's random branch work. This version makes the new random number visible to external modules, for example, List::Util's XS shuffle() implementation. I've also added a 64-bit implementation when HAS_QUAD is true, this should be significantly faster, even on 32-bit CPUs. This is intended to produce exactly the same sequence as the original implementation. The original version of this commit retained the "freebsd" name from Yves's original work for the function and data structure names. I've removed "freebsd" from most function names so the name isn't an issue if we choose to replace the implementation,
* Change core calls of isALNUM() to isWORDCHAR()Karl Williamson2012-12-311-1/+1
| | | | The latter is more clearly named to indicate it includes the underscore.
* Remove the EPOC port.Nicholas Clark2012-11-191-2/+2
| | | | | | | EPOC was a family of operating systems developed by Psion for mobile devices. It was the predecessor of Symbian. The port was last updated in April 2002.
* 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.
* Change name of ibcmp to foldEQKarl Williamson2010-06-051-0/+15
| | | | | | | | | | | | | | | | As discussed on p5p, ibcmp has different semantics from other cmp functions in that it is a binary instead of ternary function. It is less confusing then to have a name that implies true/false. There are three functions affected: ibcmp, ibcmp_locale and ibcmp_utf8. ibcmp is actually equivalent to foldNE, but for the same reason that things like 'unless' and 'until' are cautioned against, I changed the functions to foldEQ, so that the existing names, like ibcmp_utf8 are defined as macros as being the complement of foldEQ. This patch also changes the one file where turning ibcmp into a macro causes problems. It changes it to use the new name. It also documents for the first time ibcmp, ibcmp_locale and their new names.
* Remove all #ifdef MACOS_TRADITIONAL code in core and non-dual-life XS code.Nicholas Clark2009-04-271-5/+1
| | | | | | | | (MacOS support was removed from MakeMaker in 6.22, and merged to blead on 15th December 2004 with 5dca256ec738057dc331fb644a93eca44ad5fa14. After this point MacOS wouldn't even have been able to build the perl binary, because it would not have been able to build DynaLoader. If anyone wishes to resurrect MacOS, start by reversing this commit and the relevant part of that commit.)
* Add editor blocks to some header files.Marcus Holland-Moritz2008-01-011-0/+10
| | | p4raw-id: //depot/perl@32793
* Fix up copyright years for files modified in 2007.Nicholas Clark2007-11-071-2/+2
| | | p4raw-id: //depot/perl@32237
* Update copyright years in .h files. Also, in .plRafael Garcia-Suarez2007-01-051-1/+1
| | | | | | files that generate .h files, so they'll be ready next time. p4raw-id: //depot/perl@29695
* missed some SYMBIAN ifdefsJarkko Hietaniemi2005-10-181-1/+1
| | | | | Message-ID: <B356D8F434D20B40A8CEDAEC305A1F24E7A64D@esebe105.NOE.Nokia.com> p4raw-id: //depot/perl@25790
* Symbian port of PerlJarkko Hietaniemi2005-04-211-2/+2
| | | | | Message-ID: <B356D8F434D20B40A8CEDAEC305A1F2453D653@esebe105.NOE.Nokia.com> p4raw-id: //depot/perl@24271
* Re: [perl #30633] Perl's "do" operator with a variety of absolute paths ↵Yitzchak Scott-Thoennes2004-11-031-1/+1
| | | | | | | under Cygwin Message-ID: <20041103012429.GA7196@efn.org> p4raw-id: //depot/perl@23468
* Fix up Larry's copyright statements to my best knowledge.Jarkko Hietaniemi2003-04-161-1/+2
| | | | | | | (Lots of Perl 5 source code archaeology was involved.) Larry didn't make strangled noises when I showed him the patch, either :-) p4raw-id: //depot/perl@19242
* Reverse copyright update (#18801) for files not changed in 2003.Hugo van der Sanden2003-03-021-1/+1
| | | p4raw-id: //depot/perl@18807
* Update all copyrights to 2003, from JarkkoHugo van der Sanden2003-03-021-1/+1
| | | p4raw-id: //depot/perl@18801