/* <--- here ends the logic shared by perl.h and makedef.pl */
/*
+=for apidoc_section Compiler directives
=for apidoc AmnUu|void|EXTERN_C
When not compiling using C++, expands to nothing.
Otherwise is used in a declaration of a function to indicate the function
* but we cannot quite get rid of, such as "ax" in PPCODE+noargs xsubs,
* or variables/arguments that are used only in certain configurations.
-=head1 Miscellaneous Functions
-
=for apidoc Am||PERL_UNUSED_ARG|void x
This is used to suppress compiler warnings that a parameter to a function is
not used. This situation can arise, for example, when a parameter is needed
#endif
/*
-=head1 Miscellaneous Functions
-
+=for apidoc_section Compiler directives
=for apidoc AmnUu|void|STMT_START
+=for apidoc_item ||STMT_END
- STMT_START { statements; } STMT_END;
-
-can be used as a single statement, as in
+This allows a series of statements in a macro to be used as a single statement,
+as in
- if (x) STMT_START { ... } STMT_END; else ...
+ if (x) STMT_START { ... } STMT_END else ...
-These are often used in macro definitions. Note that you can't return a value
-out of them.
-
-=for apidoc AmnUhu|void|STMT_END
+Note that you can't return a value out of them, which limits their utility.
+But see C<L</PERL_USE_GCC_BRACE_GROUPS>>.
=for apidoc AmnuU|bool|PERL_USE_GCC_BRACE_GROUPS
This C pre-processor value, if defined, indicates that it is permissible to use
-the GCC brace groups extension. This extension is of the form C<({
-I<STATEMENTS> })>, and turns the block consisting of I<STATEMENTS> into an
-expression with a value, unlike plain C language blocks. This can present
-optimization possibilities, but there always needs to be an alternative in case
-this ability doesn't exist or has otherwise been forbidden.
+the GCC brace groups extension. This extension, of the form
+
+ ({ statement ... })
+
+turns the block consisting of I<statements ...> into an expression with a
+value, unlike plain C language blocks. This can present optimization
+possibilities, B<BUT> you generally need to specify an alternative in case this
+ability doesn't exist or has otherwise been forbidden.
+
+Example usage:
+
+=over
+
+ #ifdef PERL_USE_GCC_BRACE_GROUPS
+ ...
+ #else
+ ...
+ #endif
+
+=back
=cut
# define UINT64_C(c) PeRl_UINT64_C(c)
# endif
+/*
+=for apidoc_section Integer configuration values
+=for apidoc Am||INTMAX_C|number
+Returns a token the C compiler recognizes for the constant C<number> of the
+widest integer type on the machine. For example, if the machine has C<long
+long>s, C<INTMAX_C(-1)> would yield
+
+ -1LL
+
+=for apidoc Am||UINTMAX_C|number
+Returns a token the C compiler recognizes for the constant C<number> of the
+widest unsigned integer type on the machine. For example, if the machine has
+C<long>s, C<UINTMAX_C(1)> would yield
+
+ 1UL
+
+=cut
+*/
+
# ifndef I_STDINT
typedef I64TYPE PERL_INTMAX_T;
typedef U64TYPE PERL_UINTMAX_T;
#endif
/*
-=head1 Errno
+=for apidoc_section Errno
=for apidoc m|void|SETERRNO|int errcode|int vmserrcode
#endif
/*
-=head1 Warning and Dieing
+=for apidoc_section Warning and Dieing
=for apidoc Amn|SV *|ERRSV
# define SAVE_DEFSV SAVESPTR(GvSV(PL_defgv))
#endif
+/*
+=for apidoc_section SV Handling
+=for apidoc Amn|SV *|DEFSV
+Returns the SV associated with C<$_>
+
+=for apidoc Am|void|DEFSV_set|SV * sv
+Associate C<sv> with C<$_>
+
+=for apidoc Amn|void|SAVE_DEFSV
+Localize C<$_>. See L<perlguts/Localizing changes>.
+
+=cut
+*/
+
#ifndef errno
extern int errno; /* ANSI allows errno to be an lvalue expr.
* For example in multithreaded environments
* longer need that. XS modules can (and do) use this name, so it must remain
* a part of the API that's visible to modules.
-=head1 Miscellaneous Functions
-
+=for apidoc_section String Handling
=for apidoc ATmD|int|my_sprintf|NN char *buffer|NN const char *pat|...
Do NOT use this due to the possibility of overflowing C<buffer>. Instead use
#endif
/*
-=head1 Numeric functions
+=for apidoc_section Integer configuration values
=for apidoc AmnUh||PERL_INT_MIN
=for apidoc AmnUh||PERL_LONG_MAX
=for apidoc AmnUh||PERL_USHORT_MAX
=for apidoc AmnUh||PERL_USHORT_MIN
=for apidoc AmnUh||PERL_QUAD_MIN
+=for apidoc_section Floating point configuration values
+
=for apidoc AmnU||PERL_INT_MAX
This and
C<PERL_INT_MIN>,
#endif
/*
-=head1 Miscellaneous Functions
+=for apidoc_section Embedding and Interpreter Cloning
=for apidoc Am|void|PERL_SYS_INIT|int *argc|char*** argv
Provides system-specific tune up of the C runtime environment necessary to
#define HEKfARG(p) ((void*)(p))
-/*
-=for apidoc Amnh||UTF8f
-=for apidoc Amh||UTF8fARG|bool is_utf8|Size_t byte_len|char *str
-
-=cut
+/* Documented in perlguts
+ *
* %4p is a custom format
*/
#ifndef UTF8f
#endif
/*
-=head1 Miscellaneous Functions
+=for apidoc_section Compiler directives
=for apidoc AmU|bool|LIKELY|const bool expr
#define PERL_MAGIC_READONLY_ACCEPTABLE 0x40
#define PERL_MAGIC_VALUE_MAGIC 0x80
#define PERL_MAGIC_VTABLE_MASK 0x3F
+
+/* can this type of magic be attached to a readonly SV? */
#define PERL_MAGIC_TYPE_READONLY_ACCEPTABLE(t) \
(PL_magic_data[(U8)(t)] & PERL_MAGIC_READONLY_ACCEPTABLE)
+
+/* Is this type of magic container magic (%ENV, $1 etc),
+ * or value magic (pos, taint etc)?
+ */
#define PERL_MAGIC_TYPE_IS_VALUE_MAGIC(t) \
(PL_magic_data[(U8)(t)] & PERL_MAGIC_VALUE_MAGIC)
cBOOL(PL_hints & (HINT_LOCALE|HINT_LOCALE_PARTIAL))
/*
-=head1 Locale-related functions and macros
+=for apidoc_section Locales
=for apidoc Amn|bool|IN_LOCALE
* operations used by Perl, namely the decimal point, and even the thousands
* separator.)
-=head1 Locale-related functions and macros
+=for apidoc_section Locales
=for apidoc Amn|void|DECLARATION_FOR_LC_NUMERIC_MANIPULATION
/*
-=head1 Numeric functions
+=for apidoc_section Numeric Functions
=for apidoc AmTR|NV|Strtod|NN const char * const s|NULLOK char ** e
#define IS_NUMBER_TRAILING 0x40 /* number has trailing trash */
/*
-=head1 Numeric functions
+=for apidoc_section Numeric Functions
=for apidoc AmdR|bool|GROK_NUMERIC_RADIX|NN const char **sp|NN const char *send
#define PERL_UNICODE_UTF8CACHEASSERT 'a'
/*
+=for apidoc_section Signals
=for apidoc Amn|U32|PERL_SIGNALS_UNSAFE_FLAG
If this bit in C<PL_signals> is set, the system is uing the pre-Perl 5.8
unsafe signals. See L<perlrun/PERL_SIGNALS> and L<perlipc/Deferred Signals
#define PERL_SIGNALS_UNSAFE_FLAG 0x0001
/*
-=head1 Numeric functions
+=for apidoc_section Numeric Functions
=for apidoc Am|int|PERL_ABS|int
/*
-=head1 Miscellaneous Functions
+=for apidoc_section Utility Functions
=for apidoc Am|bool|IS_SAFE_SYSCALL|NN const char *pv|STRLEN len|NN const char *what|NN const char *op_name