00001 /*-------------------------------------------------------- 00002 * / 00003 * / apeNEXT inttypes for nlcc 00004 * / 00005 * / $Id: inttypes.h,v 1.19 2005/10/27 20:04:44 morinl Exp $ 00006 * / 00007 * / ISO/IEC 9899:1999 (E) Standard 00008 * / #include <inttypes.h> 00009 * / 00010 * / IMPLEMENTATION for APEnext: possible (inttypes.h) [completed yes/no] 00011 * /---------------------------------------------------------------------------------------------*/ 00012 00013 #ifndef _INTTYPES_H 00014 #define _INTTYPES_H 00015 00016 #include <nlibc.h> 00017 #include <stdint.h> // for intmax_t etc. 00018 #include <stddef.h> // for wchar_t etc. 00019 /*------------------------------------------------------------------------------------------------ 00020 * / 00021 * / The purpose of this header file <inttypes.h> is to provide a set of integer types whose 00022 * / definitions are consistent across the apeNEXT machines and independent of the 00023 * / operating systems and other implementation idiosyncrasies. 00024 * / 00025 * / It defines integer types of various sizes. The implementations are free to typedef 00026 * / as ISO standard integer types or extensions that they support. Consistent use of this 00027 * / header will greatly increase the portability of applications across our platforms. 00028 * / 00029 * / The ISO standard specified that the language should support four signed 00030 * / and unsigned integer data types char, short, int, and long but placed very little 00031 * / requirement on their size other than that int and short be at least 16 bits and long 00032 * / be at least as long as int and not smaller than 32 bits. 00033 * / For 32-bit systems (like old ape1000), the common practice has been to 00034 * / assign 8, 16, 32, and 32 bits to these types. 00035 * / 00036 * /This difference in int size can create some problems for users who migrate 00037 * / from one system to another which assigns different sizes to integer types, because the 00038 * / ISO standard integer promotion rule can produce silent changes unexpectedly. 00039 * / 00040 * / We have excluded the wide-character strings, although some of such variables 00041 * / are partially defined (only as an example) 00042 * / 00043 * / Note: this header file wil be revised later. Please frequentlly upate the 00044 * / outcomming further versions! 00045 * / 00046 /*------------------------------------------------------------------------------------------------ 00047 00048 /*------------------------------------------------------------------------------------------------ 00049 * / NAME 00050 * / inttypes.h - fixed size integer types 00051 * / 00052 * / SYNOPSIS 00053 * / #include <inttypes.h> 00054 * / 00055 * / DESCRIPTION 00056 * / The <inttypes.h> header includes the <stdint.h> header and at least a definition 00057 * / of the following type: 00058 * / imaxdiv_t = structure type that is the type of the value returned by 00059 * / the imaxdiv() function. 00060 * / 00061 * / RETURN VALUE 00062 * / 00063 * / Notes 00064 * / Each of the following macros are to be defined. They expand to character string 00065 * / literal containing a conversion specifier, possibly modified by a length modifier, 00066 * / suitable for use within the format argument of a formatted input/output function 00067 * / when converting the corresponding integer type. These macros have the general form 00068 * / of PRI (character string literals for the fprintf() and fwprintf() family of functions) 00069 * / or SCN (character string literals for the fscanf() and fwscanf() family of functions), 00070 * / followed by the conversion specifier, followed by a name corresponding to a similar 00071 * / type name in <stdint.h>. In these names, N represents the width of the type as 00072 * / described in <stdint.h>. 00073 * / 00074 * / The fprintf() macros for signed integers are: 00075 * / PRIdN PRIdLEASTN PRIdFASTN PRIdMAX PRIdPTR 00076 * / PRIiN PRIiLEASTN PRIiFASTN PRIiMAX PRIiPTR 00077 * / 00078 * / The fprintf() macros for unsigned integers are: 00079 * / PRIoN PRIoLEASTN PRIoFASTN PRIoMAX PRIoPTR 00080 * / PRIuN PRIuLEASTN PRIuFASTN PRIuMAX PRIuPTR 00081 * / PRIxN PRIxLEASTN PRIxFASTN PRIxMAX PRIxPTR 00082 * / PRIXN PRIXLEASTN PRIXFASTN PRIXMAX PRIXPTR 00083 * / 00084 * / The fscanf() macros for signed integers are: 00085 * / SCNdN SCNdLEASTN SCNdFASTN SCNdMAX SCNdPTR 00086 * / SCNiN SCNiLEASTN SCNiFASTN SCNiMAX SCNiPTR 00087 * / 00088 * / The fscanf() macros for unsigned integers are: 00089 * / SCNoN SCNoLEASTN SCNoFASTN SCNoMAX SCNoPTR 00090 * / SCNuN SCNuLEASTN SCNuFASTN SCNuMAX SCNuPTR 00091 * / SCNxN SCNxLEASTN SCNxFASTN SCNxMAX SCNxPTR 00092 * / 00093 * / For each type that the implementation provides in <stdint.h>, the corresponding 00094 * / fprintf() and fwprintf() macros shall be defined and the corresponding fscanf() 00095 * / and fwscanf() macros shall be defined unless the implementation does not have a 00096 * / suitable modifier for the type. 00097 * / 00098 * / The following shall be declared as functions and/or be defined as macros. 00099 * / Function prototypes shall be provided (will be given below). 00100 * / intmax_t imaxabs(intmax_t); 00101 * / imaxdiv_t imaxdiv(intmax_t, intmax_t); 00102 * / intmax_t strtoimax(const char *restrict, char **restrict, int); 00103 * / uintmax_t strtoumax(const char *restrict, char **restrict, int); 00104 * / intmax_t wcstoimax(const wchar_t *restrict, wchar_t **restrict, int); 00105 * / uintmax_t wcstoumax(const wchar_t *restrict, wchar_t **restrict, int); 00106 * / 00107 * / Add. Refs.: http://www.dinkumware.com/htm_cl/inttypes.html 00108 * / 00109 * / IMPLEMENTATION for APEnext: partially possible (except. wide-character strings) inttypes) 00110 * / --------------------------------------------------------------------------------------------*/ 00111 00112 /*------------------------------------------------------------------------------------------------ 00113 * / 00114 * / imaxdiv_t - structure type that is the type of the value returned by the imaxdiv() function 00115 * / 00116 * / Note 00117 * / If we want an integer with the widest range possible on our platform 00118 * / on which it is being used, we use one of the following. If we use these, 00119 * / we should write code that takes into account the variable size and range of 00120 * / the integer. 00121 * / imtmax_tm uintmax_t 00122 * / 00123 * / IMPLEMENTATION for APEnext: possible (imaxdiv_t) 00124 * / --------------------------------------------------------------------------------------------*/ 00125 typedef struct { intmax_t numer; 00126 intmax_t denom; 00127 } imaxdiv_t; 00128 00129 /*------------------------------------------------------------------------------------------------ 00130 * / (Only as an example!!!!) 00131 * / The macro expands to a string literal suitable for use as a d print conversion specificier, 00132 * / plus any needed qualifiers, to convert values of the types i 00133 * / int8_t, PRId8 'hhd' 00134 * / int16_t, PRId16 'hd' 00135 * / int32_t, PRId32 'ld' or 00136 * / int64_t, PRID64 'lld' respectively. 00137 * / 00138 * / IMPLEMENTATION for APEnext: possible (PRId64) 00139 * / --------------------------------------------------------------------------------------------*/ 00140 #define PRId64 'lld' 00141 00142 /*------------------------------------------------------------------------------------------------ 00143 * / (Only as an example!!!!) 00144 * / As given in the last macros, the N is defined as 8, 16, 32, 64. 00145 * / The conversion values are of the types int_least8_t, int_least16_t, int_least32_t, 00146 * / or int_fast64_t respectively. 00147 * / 00148 * / IMPLEMENTATION for APEnext: possible (PRIdLEAST64) 00149 * / --------------------------------------------------------------------------------------------*/ 00150 #define PRIdLEAST64 'lld' 00151 00152 /*------------------------------------------------------------------------------------------------ 00153 * / (Only as an example!!!!) 00154 * / As given in the last macros, the N is defined as 8, 16, 32, 64. 00155 * / The conversion values are of the types int_fast8_t, int_fast16_t, int_fast32_t, 00156 * / or int_fast64_t respectively. 00157 * / 00158 * / IMPLEMENTATION for APEnext: possible (PRIdFAST64) 00159 * / --------------------------------------------------------------------------------------------*/ 00160 #define PRIdFAST64 'lld' 00161 00162 /*------------------------------------------------------------------------------------------------ 00163 * / This macro expands to a string literal suitable for use as a d print conversion 00164 * / specificier, plus any needed qualifiers, to convert values of the types intmax_t. 00165 * / 00166 * / IMPLEMENTATION for APEnext: possible (PRIdMAX) 00167 * / --------------------------------------------------------------------------------------------*/ 00168 #define PRIdMAX 'lld' 00169 00170 /*------------------------------------------------------------------------------------------------ 00171 * / This macro expands to a string literal suitable for use as a d print conversion 00172 * / specificier, plus any needed qualifiers, to convert values of the types intptr_t. 00173 * / 00174 * / IMPLEMENTATION for APEnext: possible (PRIdPTR) 00175 * / --------------------------------------------------------------------------------------------*/ 00176 #define PRIdPTR 'lld' 00177 00178 /*------------------------------------------------------------------------------------------------ 00179 * / (Only as an example!!!!) 00180 * / For use as a i print 00181 * / As given in the last macros, the N is defined as 8, 16, 32, 64. 00182 * / The conversion values are of the types int8_t, int16_t, int32_t, or int64_t, respectively. 00183 * / 00184 * / IMPLEMENTATION for APEnext: possible (PRIi64) 00185 * / --------------------------------------------------------------------------------------------*/ 00186 #define PRIi64 'lli' 00187 00188 /*------------------------------------------------------------------------------------------------ 00189 * / (Only as an example!!!!) 00190 * / As given in the last macros, the N is defined as 8, 16, 32, 64. 00191 * / The conversion values are of the types int_fast8_t, int_fast16_t, int_fast32_t, 00192 * / or int_fast64_t respectively. 00193 * / 00194 * / IMPLEMENTATION for APEnext: possible (PRIiFAST64) 00195 * / --------------------------------------------------------------------------------------------*/ 00196 #define PRIiFAST64 'lli' 00197 00198 /*------------------------------------------------------------------------------------------------ 00199 * / The conversion values are of the types int_fast8_t, int_fast16_t, int_fast32_t, 00200 * / or int_fast64_t respectively. 00201 * / 00202 * / IMPLEMENTATION for APEnext: possible (PRIiLEAST64) 00203 * / --------------------------------------------------------------------------------------------*/ 00204 #define PRIiLEAST64 'lli' 00205 00206 /*------------------------------------------------------------------------------------------------ 00207 * / The conversion values are of the types intmax_t. 00208 * / 00209 * / IMPLEMENTATION for APEnext: possible (PRIMAX) 00210 * / --------------------------------------------------------------------------------------------*/ 00211 #define PRIiMAX 'lli' 00212 00213 /*------------------------------------------------------------------------------------------------ 00214 * / The conversion values are of the types intprt_t. 00215 * / 00216 * / IMPLEMENTATION for APEnext: possible (PRIiPTR) 00217 * / --------------------------------------------------------------------------------------------*/ 00218 #define PRIiPTR 'lli' 00219 00220 /*------------------------------------------------------------------------------------------------ 00221 * / For use as a o print 00222 * / The conversion values are of the types uint8_t, uint16_t, uint32_t, or uint64_t respectively. 00223 * / 00224 * / IMPLEMENTATION for APEnext: possible (PRIoN) 00225 * / --------------------------------------------------------------------------------------------*/ 00226 #define PRIoN 'llo' 00227 00228 /*------------------------------------------------------------------------------------------------ 00229 * / The conversion values are of the types uint_least8_t, uint_least16_t, uint_least32_t, 00230 * / or uint_least64_t respectively. 00231 * / 00232 * / IMPLEMENTATION for APEnext: possible (PRIoLEAST64) 00233 * / --------------------------------------------------------------------------------------------*/ 00234 #define PRIoLEAST64 'llo' 00235 00236 /*------------------------------------------------------------------------------------------------ 00237 * / The conversion values are of the types uint_fast8_t, uint_fast16_t, uint_fast32_t, 00238 * / or uint_fast64_t respectively. 00239 * / 00240 * / IMPLEMENTATION for APEnext: possible (PRIoFAST64) 00241 * / --------------------------------------------------------------------------------------------*/ 00242 #define PRIoFAST64 'llo' 00243 00244 /*------------------------------------------------------------------------------------------------ 00245 * / The conversion values are of the types unitmax_t. 00246 * / 00247 * / IMPLEMENTATION for APEnext: possible (PRIoMAX) 00248 * / --------------------------------------------------------------------------------------------*/ 00249 #define PRIoMAX 'llo' 00250 00251 /*------------------------------------------------------------------------------------------------ 00252 * / The conversion values are of the types unitprt_t. 00253 * / 00254 * / IMPLEMENTATION for APEnext: possible (PRIoPTR) 00255 * / --------------------------------------------------------------------------------------------*/ 00256 #define PRIoPTR 'llo' 00257 00258 /*------------------------------------------------------------------------------------------------ 00259 * / For use as a u print 00260 * / The conversion values are of the types uint8_t, uint16_t, uint32_t, or uint64_t respectively. 00261 * / 00262 * / IMPLEMENTATION for APEnext: possible (PRIu64) 00263 * / --------------------------------------------------------------------------------------------*/ 00264 #define PRIu64 'llu' 00265 00266 /*------------------------------------------------------------------------------------------------ 00267 * / The conversion values are of the types uint_least8_t, uint_least16_t, uint_least32_t, 00268 * / or uint_least64_t respectively. 00269 * / 00270 * / IMPLEMENTATION for APEnext: possible (PRIuLEAST64) 00271 * / --------------------------------------------------------------------------------------------*/ 00272 #define PRIuLEAST64 'llu' 00273 00274 /*------------------------------------------------------------------------------------------------ 00275 * / The conversion values are of the types uint_fast8_t, uint_fast16_t, uint_fast32_t, 00276 * / or uint_fast64_t respectively. 00277 * / 00278 * / IMPLEMENTATION for APEnext: possible (PRIuFAST64) 00279 * / --------------------------------------------------------------------------------------------*/ 00280 #define PRIuFAST64 'llu' 00281 00282 /*------------------------------------------------------------------------------------------------ 00283 * / The conversion values are of the types unitmax_t. 00284 * / 00285 * / IMPLEMENTATION for APEnext: possible (PRIuMAX) 00286 * / --------------------------------------------------------------------------------------------*/ 00287 #define PRIuMAX 'llu' 00288 00289 /*------------------------------------------------------------------------------------------------ 00290 * / The conversion values are of the types unitprt_t. 00291 * / 00292 * / IMPLEMENTATION for APEnext: possible (PRIuPTR) 00293 * / --------------------------------------------------------------------------------------------*/ 00294 #define PRIuPTR 'llu' 00295 00296 /*------------------------------------------------------------------------------------------------ 00297 * / For use as a x print 00298 * / 00299 * / IMPLEMENTATION for APEnext: possible (PRIxN) 00300 * / (PRIxLEAST46) 00301 * / (PRIxFAST46) 00302 * / (PRIxMAX) 00303 * / (PRIxPTR) 00304 * / --------------------------------------------------------------------------------------------*/ 00305 #define PRIxN 'llx' 00306 00307 #define PRIxLEAST64 'llx' 00308 00309 #define PRIxFAST64 'llx' 00310 00311 #define PRIxMAX 'llx' 00312 00313 #define PRIxPTR 'llx' 00314 00315 /*------------------------------------------------------------------------------------------------ 00316 * / For use as a X print 00317 * / 00318 * / IMPLEMENTATION for APEnext: possible (PRId64) 00319 * / --------------------------------------------------------------------------------------------*/ 00320 #define PRIX64 'llX' 00321 00322 #define PRIXLEAST64 'llX' 00323 00324 #define PRIXFAST64 'llX' 00325 00326 #define PRIXMAX 'llX' 00327 00328 #define PRIXPTR 'llX' 00329 00330 /*------------------------------------------------------------------------------------------------ 00331 * / For use as a d scan 00332 * / 00333 * / IMPLEMENTATION for APEnext: possible (SCNd64) 00334 * / (SCNdLEAST46) 00335 * / (SCNdFAST46) 00336 * / (SCNdMAX) 00337 * / (SCNdPTR) 00338 * / --------------------------------------------------------------------------------------------*/ 00339 #define SCNd64 'lld' 00340 00341 #define SCNdLEAST64 'lld' 00342 00343 #define SCNdFAST64 'lld' 00344 00345 #define SCNdMAX 'lld' 00346 00347 #define SCNdPTR 'lld' 00348 00349 /*------------------------------------------------------------------------------------------------ 00350 * / For use as a i scan 00351 * / 00352 * / IMPLEMENTATION for APEnext: possible (PRIi64) 00353 * / (PRIiLEAST46) 00354 * / (PRIiFAST46) 00355 * / (PRIiMAX) 00356 * / (PRIiPTR) 00357 * / --------------------------------------------------------------------------------------------*/ 00358 #define SCNi64 'lli' 00359 00360 #define SCNiLEAST64 'lli' 00361 00362 #define SCNiFAST64 'lli' 00363 00364 #define SCNiMAX 'lli' 00365 00366 #define SCNiPTR 'lli' 00367 00368 /*------------------------------------------------------------------------------------------------ 00369 * / For use as a o scan 00370 * / 00371 * / IMPLEMENTATION for APEnext: possible (SCNod64) 00372 * / (SCNoLEAST46) 00373 * / (SCNoFAST46) 00374 * / (SCNoMAX) 00375 * / (SCNoPTR) 00376 * / --------------------------------------------------------------------------------------------*/ 00377 #define SCNo64 'llo' 00378 00379 #define SCNoLEAST64 'llo' 00380 00381 #define SCNoFAST64 'llo' 00382 00383 #define SCNoMAX 'llo' 00384 00385 #define SCNoPTR 'llo' 00386 00387 /*------------------------------------------------------------------------------------------------ 00388 * / For use as a u scan 00389 * / 00390 * / IMPLEMENTATION for APEnext: possible (SCNu64) 00391 * / (SCNuLEAST46) 00392 * / (SCNuFAST46) 00393 * / (SCNuMAX) 00394 * / (SCNuPTR) 00395 * / --------------------------------------------------------------------------------------------*/ 00396 #define SCNu64 'llu' 00397 00398 #define SCNuLEAST64 'llu' 00399 00400 #define SCNuFAST64 'llu' 00401 00402 #define SCNuMAX 'llu' 00403 00404 #define SCNuPTR 'llu' 00405 00406 /*------------------------------------------------------------------------------------------------ 00407 * / For use as a x scan 00408 * / 00409 * / IMPLEMENTATION for APEnext: possible (SCNx64) 00410 * / (SCNxLEAST46) 00411 * / (SCNxFAST46) 00412 * / (SCNxMAX) 00413 * / (SCNxPTR) 00414 * / --------------------------------------------------------------------------------------------*/ 00415 #define SCNx64 'llx' 00416 00417 #define SCNxLEAST64 'llx' 00418 00419 #define SCNxFAST64 'llx' 00420 00421 #define SCNxMAX 'llx' 00422 00423 #define SCNxPTR 'llx' 00424 00425 /*------------------------------------------------------------------------------------------------ 00426 * / For use as a X scan (Following five macros are added by myself) 00427 * / 00428 * / IMPLEMENTATION for APEnext: possible (SCNX64) 00429 * / (SCNXLEAST46) 00430 * / (SCNXFAST46) 00431 * / (SCNXMAX) 00432 * / (SCNXPTR) 00433 * / --------------------------------------------------------------------------------------------*/ 00434 #define SCNX64 'llX' 00435 00436 #define SCNXLEAST64 'llX' 00437 00438 #define SCNXFAST64 'llX' 00439 00440 #define SCNXMAX 'llX' 00441 00442 #define SCNXPTR 'llX' 00443 00444 00445 /*------------------------------------------------------------------------------------------------ 00446 * / NAME 00447 * / imaxabs - absolute value of an intmax_t 00448 * / 00449 * / SYNOPSIS 00450 * / #include <inttypes.h> 00451 * / 00452 * / intmax_t imaxabs(intmax_t j) 00453 * / 00454 * / DESCRIPTION 00455 * / The imaxabs() function computes the absolute value of an integer j. 00456 * / If the result cannot be represented, the behavior is undefined 00457 * / 00458 * / RETURN VALUE 00459 * / The imaxabs() function returns the absolute value of an integer of type intmax_t. 00460 * / 00461 * / Notes 00462 * / 00463 * / 00464 * / IMPLEMENTATION for APEnext: possible (imaxabs) 00465 * / --------------------------------------------------------------------------------------------*/ 00466 #define imaxabs(I) ((intmax_t)abs((int)I)) 00467 00468 /*------------------------------------------------------------------------------------------------ 00469 * / NAME 00470 * / imaxdiv - quotient and remainder 00471 * / 00472 * / SYNOPSIS 00473 * / #include <inttypes.h> 00474 * / 00475 * / imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom) 00476 * / 00477 * / DESCRIPTION 00478 * / The imaxdiv() function computes numer / denom and numer % denom in a 00479 * / single operation. It returns both quotient and remainder in the structure 00480 * / result x, if the quotient can be represented. The structure member x.quot 00481 * / is the algebraic quotient truncated toward zero. The structure member 00482 * / x.rem is the remainder, such that numer == x.quot*denom + x.rem. 00483 * / 00484 * / RETURN VALUE 00485 * / The imaxdiv() function returns a structure of type imaxdiv_t, 00486 * / comprising both the quotient and the remainder. 00487 * / 00488 * / Notes 00489 * / If either part of the result cannot be represented, the behavior is undefined 00490 * / 00491 * / Implem. example typedef struct {intmax_t quot, rem; } imaxdiv_t; 00492 * / 00493 * / IMPLEMENTATION for APEnext: possible (imaxdiv) 00494 * / --------------------------------------------------------------------------------------------*/ 00495 #define imaxdiv(N,D) ((intmax_t)div((int)N,(int)D) 00496 00497 /*------------------------------------------------------------------------------------------------ 00498 * / NAME 00499 * / strtoimax - converts string to integer type equivalent of intmax_t 00500 * / 00501 * / SYNOPSIS 00502 * / #include <inttypes.h> 00503 * / 00504 * / intmax_t strtoimax(const char *restrict nptr, char **restrict endptr, int base) 00505 * / 00506 * / DESCRIPTION 00507 * / The strtoimax() function is equivalent to the strtol(), strtoll(), strtoul(), 00508 * / and strtoull() functions, except that the initial portion of the string is 00509 * / converted to intmax_t. It converts the initial characters of the string s 00510 * / to an equivalent value x of type intmax_t. If endptr is not a null pointer, 00511 * / it stores a pointer to the unconverted remainder of the string in *endptr. 00512 * / It then returns x. strtoimax converts strings exactly as does strtol. 00513 * / 00514 * / RETURN VALUE 00515 * / The strtoimax() function return intmax_t value 00516 * / 00517 * / Notes 00518 * / If the correct value is outside the range of representable values, 00519 * / {INTMAX_MAX}, {INTMAX_MIN}, or {UINTMAX_MAX} shall be returned (according to 00520 * / the return type and sign of the value, if any), and errno shall be set to [ERANGE]. 00521 * / 00522 * / IMPLEMENTATION for APEnext: possible (strtoimax) 00523 * / --------------------------------------------------------------------------------------------*/ 00524 #ifndef __HAS_MAIN 00525 extern intmax_t strtoimax(const char * restrict nptr, char ** restrict endptr, int base) ; 00526 #else 00527 #if !defined(__cflow_processed) || defined(_uses_strtoimax_inttypes_h) 00528 intmax_t strtoimax(const char * restrict nptr, char ** restrict endptr, int base) 00529 { 00530 return(0); 00531 } 00532 #endif // stdtoimax() 00533 #endif // Has Main 00534 00535 /*------------------------------------------------------------------------------------------------ 00536 * / NAME 00537 * / strtoumax - converts string to integer type equivalent of unitmax_t 00538 * / 00539 * / SYNOPSIS 00540 * / #include <inttypes.h> 00541 * / 00542 * / uintmax_t strtoumax(const char *restrict nptr, char **restrict endptr, int base) 00543 * / 00544 * / DESCRIPTION 00545 * / The strtoumax() function is equivalent to the strtol(), strtoll(), strtoul(), 00546 * / and strtoull() functions, except that the initial portion of the string is 00547 * / converted to unitmax_t. It converts the initial characters of the string s 00548 * / to an equivalent value x of type uintmax_t. If endptr is not a null pointer, 00549 * / it stores a pointer to the unconverted remainder of the string in *endptr. 00550 * / It then returns x. strtoumax converts strings exactly as does strtoul. 00551 * / 00552 * / RETURN VALUE 00553 * / The strtoumax() function return intmax_t value 00554 * / 00555 * / Notes 00556 * / If the correct value is outside the range of representable values, 00557 * / {INTMAX_MAX}, {INTMAX_MIN}, or {UINTMAX_MAX} shall be returned (according to 00558 * / the return type and sign of the value, if any), and errno shall be set to [ERANGE]. 00559 * / 00560 * / IMPLEMENTATION for APEnext: possible (strtoumax) 00561 * / --------------------------------------------------------------------------------------------*/ 00562 #ifndef __HAS_MAIN 00563 extern uintmax_t strtoumax(const char * restrict nptr, char ** restrict endptr, int base) ; 00564 #else 00565 #if !defined(__cflow_processed) || defined(_uses_strtoumax_inttypes_h) 00566 uintmax_t strtoumax(const char * restrict nptr, char ** restrict endptr, int base) 00567 { 00568 return(0); 00569 } 00570 #endif 00571 #endif // Has Main 00572 00573 /*------------------------------------------------------------------------------------------------ 00574 * / NAME 00575 * / wcstoimax - convert a wide-character string to an integer type of type intmax_t 00576 * / 00577 * / SYNOPSIS 00578 * / #include <inttypes.h> 00579 * / 00580 * / intmax_t wcstoimax(const wchar_t *restrict nptr, wchar_t **restrict endptr, int base) 00581 * / 00582 * / DESCRIPTION 00583 * / The wcstoimax() function is equivalent to the wcstol(), wcstoll(), wcstoul(), 00584 * / and wcstoull() functions, respectively, except that the initial 00585 * / portion of the wide string shall be converted to intmax_t. It converts the 00586 * / initial wide characters of the wide string s to an equivalent value x of 00587 * / type intmax_t. If endptr is not a null pointer, the function stores a 00588 * / pointer to the unconverted remainder of the wide string in *endptr. 00589 * / The function then returns x. 00590 * / 00591 * / RETURN VALUE 00592 * / The wcstoimax() function return intmax_t value 00593 * / 00594 * / Notes 00595 * / If no conversion could be performed, zero shall be returned. If the correct 00596 * / value is outside the range of representable values, {INTMAX_MAX}, 00597 * / {INTMAX_MIN}, or {UINTMAX_MAX} shall be returned (according to the return 00598 * / type and sign of the value, if any), and errno shall be set to [ERANGE]. 00599 * / 00600 * / IMPLEMENTATION for APEnext: not needed/not implemented for APEnext (wcstoimax) 00601 * / --------------------------------------------------------------------------------------------*/ 00602 #ifndef __HAS_MAIN 00603 extern intmax_t wcstoimax(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base) ; 00604 #else 00605 #if !defined(__cflow_processed) || defined(_uses_wcstoimax_inttypes_h) 00606 intmax_t wcstoimax(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base) 00607 { 00608 #ifdef __cflow_processed 00609 # error "Wide-characters not implemented" 00610 #endif 00611 } 00612 #endif // wcstoimax() 00613 #endif // Has Main 00614 00615 /*------------------------------------------------------------------------------------------------ 00616 * / NAME 00617 * / wcstoumax - convert a wide-character string to an integer typ 00618 * / 00619 * / SYNOPSIS 00620 * / #include <inttypes.h> 00621 * / 00622 * / unitmax_t wcstoumax(const wchar_t *restrict nptr, wchar_t **restrict endptr, int base) 00623 * / 00624 * / DESCRIPTION 00625 * / The wcstoumax() function is equivalent to the wcstol(), wcstoll(), wcstoul(), 00626 * / and wcstoull() functions, respectively, except that the initial 00627 * / portion of the wide string shall be converted to unitmax_t 00628 * / 00629 * / RETURN VALUE 00630 * / The wcstoimax() function return unitmax_t value 00631 * / 00632 * / Notes 00633 * / If no conversion could be performed, zero shall be returned. If the correct 00634 * / value is outside the range of representable values, {INTMAX_MAX}, 00635 * / {INTMAX_MIN}, or {UINTMAX_MAX} shall be returned (according to the return 00636 * / type and sign of the value, if any), and errno shall be set to [ERANGE]. 00637 * / 00638 * / IMPLEMENTATION for APEnext: not needed/implemented for APEnext (wcstoumax) 00639 * / --------------------------------------------------------------------------------------------*/ 00640 #ifndef __HAS_MAIN 00641 extern uintmax_t wcstoumax(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base) ; 00642 #else 00643 #if !defined(__cflow_processed) || defined(_uses_wcstoumax_inttypes_h) 00644 uintmax_t wcstoumax(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base) 00645 { 00646 #ifdef __cflow_processed 00647 # error "Wide-characters not implemented" 00648 #endif 00649 } 00650 #endif // wcstoumax() 00651 #endif // Has Main 00652 00653 #endif /* ifndef _INTTYPES_H_ */ 00654 00655 00656 00657 00658 00659 00660 00661 00662 00663