]> pd.if.org Git - pdclib/blobdiff - includes/inttypes.h
Corrected _PDCLIB_CHAR_SIGNED comment.
[pdclib] / includes / inttypes.h
index 231dfab9408a87df3286500ff31fcf57ad0807af..f13db1bf8d7b250146be6ecf92a5af6a493e1eae 100644 (file)
@@ -1,6 +1,4 @@
-/* $Id$ */
-
-/* 7.8 Format conversion of integer types <inttypes.h>
+/* Format conversion of integer types <inttypes.h>
 
    This file is part of the Public Domain C Library (PDCLib).
    Permission is granted to use, modify, and / or redistribute at will.
@@ -9,8 +7,15 @@
 #ifndef _PDCLIB_INTTYPES_H
 #define _PDCLIB_INTTYPES_H _PDCLIB_INTTYPES_H
 #include <stdint.h>
-_PDCLIB_BEGIN_EXTERN_C
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* This structure has a member quot and a member rem, of type intmax_t.
+   The order of the members is platform-defined to allow the imaxdiv()
+   function below to be implemented efficiently.
+*/
 typedef struct _PDCLIB_imaxdiv_t imaxdiv_t;
 
 #define PRId8  _PDCLIB_symbol2string( _PDCLIB_concat( _PDCLIB_8_CONV, d ) )
@@ -211,15 +216,15 @@ typedef struct _PDCLIB_imaxdiv_t imaxdiv_t;
 #define SCNxMAX _PDCLIB_symbol2string( _PDCLIB_concat( _PDCLIB_MAX_CONV, x ) )
 #define SCNxPTR _PDCLIB_symbol2string( _PDCLIB_concat( _PDCLIB_PTR_CONV, x ) )
 
-/* 7.8.2 Functions for greatest-width integer types */
+/* Functions for greatest-width integer types */
 
 /* Calculate the absolute value of j */
-intmax_t imaxabs( intmax_t j );
+intmax_t imaxabs( intmax_t j ) _PDCLIB_nothrow;
 
 /* Return quotient (quot) and remainder (rem) of an integer division in the
    imaxdiv_t struct.
 */
-imaxdiv_t imaxdiv( intmax_t numer, intmax_t denom );
+imaxdiv_t imaxdiv( intmax_t numer, intmax_t denom ) _PDCLIB_nothrow;
 
 /* Seperate the character array nptr into three parts: A (possibly empty)
    sequence of whitespace characters, a character representation of an integer
@@ -240,14 +245,24 @@ imaxdiv_t imaxdiv( intmax_t numer, intmax_t denom );
    respectively, depending on the sign of the integer representation and the
    return type, and errno is set to ERANGE.
 */
-/* This function is equivalent to strtol() / strtoul() in <stdlib.h>, but on
+
+/* These functions are equivalent to strtol() / strtoul() in <stdlib.h>, but on
    the potentially larger type.
 */
-intmax_t strtoimax( const char * _PDCLIB_restrict nptr, char * * _PDCLIB_restrict endptr, int base );
-uintmax_t strtoumax( const char * _PDCLIB_restrict nptr, char * * _PDCLIB_restrict endptr, int base );
+intmax_t strtoimax( const char * _PDCLIB_restrict nptr, char * * _PDCLIB_restrict endptr, int base ) _PDCLIB_nothrow;
+uintmax_t strtoumax( const char * _PDCLIB_restrict nptr, char * * _PDCLIB_restrict endptr, int base ) _PDCLIB_nothrow;
 
-/* TODO: wcstoimax(), wcstoumax() */
+/* These functions are equivalent to wcstol() / wcstoul() in <wchar.h>, but on
+   the potentially larger type.
+*/
+/* TODO: Not _PDCLIB_nothrow? */
+/*
+intmax_t wcstoimax( const _PDCLIB_wchar_t * _PDCLIB_restrict nptr, _PDCLIB_wchar_t * * _PDCLIB_restrict endptr, int base );
+uintmax_t wcstoumax( const _PDCLIB_wchar_t * _PDCLIB_restrict nptr, _PDCLIB_wchar_t * * _PDCLIB_restrict endptr, int base );
+*/
 
-_PDCLIB_END_EXTERN_C
+#ifdef __cplusplus
+}
 #endif
 
+#endif