/[avr-libc]/avr-libc/include/inttypes.h
ViewVC logotype

Diff of /avr-libc/include/inttypes.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12 by joerg_wunsch, Sun Sep 4 18:57:18 2005 UTC revision 1.13 by joerg_wunsch, Sun Sep 4 19:36:04 2005 UTC
# Line 42  Line 42 
42      This header file includes the exact-width integer definitions from      This header file includes the exact-width integer definitions from
43      <tt><stdint.h></tt>, and extends them with additional facilities      <tt><stdint.h></tt>, and extends them with additional facilities
44      provided by the implementation.      provided by the implementation.
45    
46        Currently, the extensions include two additional integer types
47        that could hold a "far" pointer (i.e. a code pointer that can
48        address more than 64 KB), as well as standard names for all printf
49        and scanf formatting options that are supported by the \ref avr_stdio.
50        As the library does not support the full range of conversion
51        specifiers from ISO 9899:1999, only those conversions that are
52        actually implemented will be listed here.
53    
54        The idea behind these conversion macros is that, for each of the
55        types defined by <stdint.h>, a macro will be supplied that portably
56        allows formatting an object of that type in printf() or scanf()
57        operations.  Example:
58    
59        \code
60        #include <inttypes.h>
61    
62        uint8_t smallval;
63        int32_t longval;
64        ...
65        printf("The hexadecimal value of smallval is " PRIx8
66               ", the decimal value of longval is " PRId32 ".\n",
67               smallval, longval);
68        \endcode
69  */  */
70    
71  /** \name Far pointers for memory access >64K */  /** \name Far pointers for memory access >64K */
# Line 146  typedef uint32_t uint_farptr_t; Line 170  typedef uint32_t uint_farptr_t;
170  #endif  #endif
171    
172  /** \ingroup avr_inttypes  /** \ingroup avr_inttypes
173      decimal printf format for int */      decimal printf format for intptr_t */
174  #define         PRIdPTR                 PRId16  #define         PRIdPTR                 PRId16
175  /** \ingroup avr_inttypes  /** \ingroup avr_inttypes
176      integer printf format for int */      integer printf format for intptr_t */
177  #define         PRIiPTR                 PRIi16  #define         PRIiPTR                 PRIi16
178    
179  /** \ingroup avr_inttypes  /** \ingroup avr_inttypes
# Line 194  typedef uint32_t uint_farptr_t; Line 218  typedef uint32_t uint_farptr_t;
218    
219    
220  /** \ingroup avr_inttypes  /** \ingroup avr_inttypes
221      octal printf format for uint8_t */      octal printf format for uint16_t */
222  #define         PRIo16                  "o"  #define         PRIo16                  "o"
223  /** \ingroup avr_inttypes  /** \ingroup avr_inttypes
224      octal printf format for uint_least8_t */      octal printf format for uint_least16_t */
225  #define         PRIoLEAST16             "o"  #define         PRIoLEAST16             "o"
226  /** \ingroup avr_inttypes  /** \ingroup avr_inttypes
227      octal printf format for uint_fast8_t */      octal printf format for uint_fast16_t */
228  #define         PRIoFAST16              "o"  #define         PRIoFAST16              "o"
229    
230    /** \ingroup avr_inttypes
231        decimal printf format for uint16_t */
232  #define         PRIu16                  "u"  #define         PRIu16                  "u"
233    /** \ingroup avr_inttypes
234        decimal printf format for uint_least16_t */
235  #define         PRIuLEAST16             "u"  #define         PRIuLEAST16             "u"
236    /** \ingroup avr_inttypes
237        decimal printf format for uint_fast16_t */
238  #define         PRIuFAST16              "u"  #define         PRIuFAST16              "u"
239    
240    /** \ingroup avr_inttypes
241        hexadecimal printf format for uint16_t */
242  #define         PRIx16                  "x"  #define         PRIx16                  "x"
243    /** \ingroup avr_inttypes
244        hexadecimal printf format for uint_least16_t */
245  #define         PRIxLEAST16             "x"  #define         PRIxLEAST16             "x"
246    /** \ingroup avr_inttypes
247        hexadecimal printf format for uint_fast16_t */
248  #define         PRIxFAST16              "x"  #define         PRIxFAST16              "x"
249    
250    /** \ingroup avr_inttypes
251        uppercase hexadecimal printf format for uint16_t */
252  #define         PRIX16                  "X"  #define         PRIX16                  "X"
253    /** \ingroup avr_inttypes
254        uppercase hexadecimal printf format for uint_least16_t */
255  #define         PRIXLEAST16             "X"  #define         PRIXLEAST16             "X"
256    /** \ingroup avr_inttypes
257        uppercase hexadecimal printf format for uint_fast16_t */
258  #define         PRIXFAST16              "X"  #define         PRIXFAST16              "X"
259    
260    
261    /** \ingroup avr_inttypes
262        octal printf format for uint32_t */
263  #define         PRIo32                  "lo"  #define         PRIo32                  "lo"
264    /** \ingroup avr_inttypes
265        octal printf format for uint_least32_t */
266  #define         PRIoLEAST32             "lo"  #define         PRIoLEAST32             "lo"
267    /** \ingroup avr_inttypes
268        octal printf format for uint_fast32_t */
269  #define         PRIoFAST32              "lo"  #define         PRIoFAST32              "lo"
270    
271    /** \ingroup avr_inttypes
272        decimal printf format for uint32_t */
273  #define         PRIu32                  "lu"  #define         PRIu32                  "lu"
274    /** \ingroup avr_inttypes
275        decimal printf format for uint_least32_t */
276  #define         PRIuLEAST32             "lu"  #define         PRIuLEAST32             "lu"
277    /** \ingroup avr_inttypes
278        decimal printf format for uint_fast32_t */
279  #define         PRIuFAST32              "lu"  #define         PRIuFAST32              "lu"
280    
281    /** \ingroup avr_inttypes
282        hexadecimal printf format for uint32_t */
283  #define         PRIx32                  "lx"  #define         PRIx32                  "lx"
284    /** \ingroup avr_inttypes
285        hexadecimal printf format for uint_least32_t */
286  #define         PRIxLEAST32             "lx"  #define         PRIxLEAST32             "lx"
287    /** \ingroup avr_inttypes
288        hexadecimal printf format for uint_fast32_t */
289  #define         PRIxFAST32              "lx"  #define         PRIxFAST32              "lx"
290    
291    /** \ingroup avr_inttypes
292        uppercase hexadecimal printf format for uint32_t */
293  #define         PRIX32                  "lX"  #define         PRIX32                  "lX"
294    /** \ingroup avr_inttypes
295        uppercase hexadecimal printf format for uint_least32_t */
296  #define         PRIXLEAST32             "lX"  #define         PRIXLEAST32             "lX"
297    /** \ingroup avr_inttypes
298        uppercase hexadecimal printf format for uint_fast32_t */
299  #define         PRIXFAST32              "lX"  #define         PRIXFAST32              "lX"
300    
301    
# Line 258  typedef uint32_t uint_farptr_t; Line 324  typedef uint32_t uint_farptr_t;
324    
325  #endif  #endif
326    
327    /** \ingroup avr_inttypes
328        octal printf format for uintptr_t */
329  #define         PRIoPTR                 PRIo16  #define         PRIoPTR                 PRIo16
330    /** \ingroup avr_inttypes
331        decimal printf format for uintptr_t */
332  #define         PRIuPTR                 PRIu16  #define         PRIuPTR                 PRIu16
333    /** \ingroup avr_inttypes
334        hexadecimal printf format for uintptr_t */
335  #define         PRIxPTR                 PRIx16  #define         PRIxPTR                 PRIx16
336    /** \ingroup avr_inttypes
337        uppercase hexadecimal printf format for uintptr_t */
338  #define         PRIXPTR                 PRIX16  #define         PRIXPTR                 PRIX16
339    
340    
341    #if __avr_libc_does_not_implement_hh_in_scanf
 /* The fscanf macros for signed integers */  
   
342    
343  #define         SCNd8                   "hhd"  #define         SCNd8                   "hhd"
344  #define         SCNdLEAST8              "hhd"  #define         SCNdLEAST8              "hhd"
# Line 276  typedef uint32_t uint_farptr_t; Line 348  typedef uint32_t uint_farptr_t;
348  #define         SCNiLEAST8              "hhi"  #define         SCNiLEAST8              "hhi"
349  #define         SCNiFAST8               "hhi"  #define         SCNiFAST8               "hhi"
350    
351    #endif
352    
353    
354    /** \ingroup avr_inttypes
355        decimal scanf format for int16_t */
356  #define         SCNd16                  "d"  #define         SCNd16                  "d"
357    /** \ingroup avr_inttypes
358        decimal scanf format for int_least16_t */
359  #define         SCNdLEAST16             "d"  #define         SCNdLEAST16             "d"
360    /** \ingroup avr_inttypes
361        decimal scanf format for int_fast16_t */
362  #define         SCNdFAST16              "d"  #define         SCNdFAST16              "d"
363    
364    /** \ingroup avr_inttypes
365        generic-integer scanf format for int16_t */
366  #define         SCNi16                  "i"  #define         SCNi16                  "i"
367    /** \ingroup avr_inttypes
368        generic-integer scanf format for int_least16_t */
369  #define         SCNiLEAST16             "i"  #define         SCNiLEAST16             "i"
370    /** \ingroup avr_inttypes
371        generic-integer scanf format for int_fast16_t */
372  #define         SCNiFAST16              "i"  #define         SCNiFAST16              "i"
373    
374    
375    /** \ingroup avr_inttypes
376        decimal scanf format for int32_t */
377  #define         SCNd32                  "ld"  #define         SCNd32                  "ld"
378    /** \ingroup avr_inttypes
379        decimal scanf format for int_least32_t */
380  #define         SCNdLEAST32             "ld"  #define         SCNdLEAST32             "ld"
381    /** \ingroup avr_inttypes
382        decimal scanf format for int_fast32_t */
383  #define         SCNdFAST32              "ld"  #define         SCNdFAST32              "ld"
384    
385    /** \ingroup avr_inttypes
386        generic-integer scanf format for int32_t */
387  #define         SCNi32                  "li"  #define         SCNi32                  "li"
388    /** \ingroup avr_inttypes
389        generic-integer scanf format for int_least32_t */
390  #define         SCNiLEAST32             "li"  #define         SCNiLEAST32             "li"
391    /** \ingroup avr_inttypes
392        generic-integer scanf format for int_fast32_t */
393  #define         SCNiFAST32              "li"  #define         SCNiFAST32              "li"
394    
395    
# Line 310  typedef uint32_t uint_farptr_t; Line 408  typedef uint32_t uint_farptr_t;
408    
409  #endif  #endif
410    
411    /** \ingroup avr_inttypes
412        decimal scanf format for intptr_t */
413  #define         SCNdPTR                 SCNd16  #define         SCNdPTR                 SCNd16
414    /** \ingroup avr_inttypes
415        generic-integer scanf format for intptr_t */
416  #define         SCNiPTR                 SCNi16  #define         SCNiPTR                 SCNi16
417    
418    #if __avr_libc_does_not_implement_hh_in_scanf
 /* The fscanf macros for unsigned integers */  
   
419    
420  #define         SCNo8                   "hho"  #define         SCNo8                   "hho"
421  #define         SCNoLEAST8              "hho"  #define         SCNoLEAST8              "hho"
# Line 329  typedef uint32_t uint_farptr_t; Line 429  typedef uint32_t uint_farptr_t;
429  #define         SCNxLEAST8              "hhx"  #define         SCNxLEAST8              "hhx"
430  #define         SCNxFAST8               "hhx"  #define         SCNxFAST8               "hhx"
431    
432    #endif
433    
434    /** \ingroup avr_inttypes
435        octal scanf format for uint16_t */
436  #define         SCNo16                  "o"  #define         SCNo16                  "o"
437    /** \ingroup avr_inttypes
438        octal scanf format for uint_least16_t */
439  #define         SCNoLEAST16             "o"  #define         SCNoLEAST16             "o"
440    /** \ingroup avr_inttypes
441        octal scanf format for uint_fast16_t */
442  #define         SCNoFAST16              "o"  #define         SCNoFAST16              "o"
443    
444    /** \ingroup avr_inttypes
445        decimal scanf format for uint16_t */
446  #define         SCNu16                  "u"  #define         SCNu16                  "u"
447    /** \ingroup avr_inttypes
448        decimal scanf format for uint_least16_t */
449  #define         SCNuLEAST16             "u"  #define         SCNuLEAST16             "u"
450    /** \ingroup avr_inttypes
451        decimal scanf format for uint_fast16_t */
452  #define         SCNuFAST16              "u"  #define         SCNuFAST16              "u"
453    
454    /** \ingroup avr_inttypes
455        hexadecimal scanf format for uint16_t */
456  #define         SCNx16                  "x"  #define         SCNx16                  "x"
457    /** \ingroup avr_inttypes
458        hexadecimal scanf format for uint_least16_t */
459  #define         SCNxLEAST16             "x"  #define         SCNxLEAST16             "x"
460    /** \ingroup avr_inttypes
461        hexadecimal scanf format for uint_fast16_t */
462  #define         SCNxFAST16              "x"  #define         SCNxFAST16              "x"
463    
464    
465    /** \ingroup avr_inttypes
466        octal scanf format for uint32_t */
467  #define         SCNo32                  "lo"  #define         SCNo32                  "lo"
468    /** \ingroup avr_inttypes
469        octal scanf format for uint_least32_t */
470  #define         SCNoLEAST32             "lo"  #define         SCNoLEAST32             "lo"
471    /** \ingroup avr_inttypes
472        octal scanf format for uint_fast32_t */
473  #define         SCNoFAST32              "lo"  #define         SCNoFAST32              "lo"
474    
475    /** \ingroup avr_inttypes
476        decimal scanf format for uint32_t */
477  #define         SCNu32                  "lu"  #define         SCNu32                  "lu"
478    /** \ingroup avr_inttypes
479        decimal scanf format for uint_least32_t */
480  #define         SCNuLEAST32             "lu"  #define         SCNuLEAST32             "lu"
481    /** \ingroup avr_inttypes
482        decimal scanf format for uint_fast32_t */
483  #define         SCNuFAST32              "lu"  #define         SCNuFAST32              "lu"
484    
485    /** \ingroup avr_inttypes
486        hexadecimal scanf format for uint32_t */
487  #define         SCNx32                  "lx"  #define         SCNx32                  "lx"
488    /** \ingroup avr_inttypes
489        hexadecimal scanf format for uint_least32_t */
490  #define         SCNxLEAST32             "lx"  #define         SCNxLEAST32             "lx"
491    /** \ingroup avr_inttypes
492        hexadecimal scanf format for uint_fast32_t */
493  #define         SCNxFAST32              "lx"  #define         SCNxFAST32              "lx"
494    
495    
# Line 374  typedef uint32_t uint_farptr_t; Line 511  typedef uint32_t uint_farptr_t;
511  #define         SCNuMAX                 "llu"  #define         SCNuMAX                 "llu"
512  #define         SCNxMAX                 "llx"  #define         SCNxMAX                 "llx"
513    
514    #endif
515    
516    /** \ingroup avr_inttypes
517        octal scanf format for uintptr_t */
518  #define         SCNoPTR                 SCNo16  #define         SCNoPTR                 SCNo16
519    /** \ingroup avr_inttypes
520        decimal scanf format for uintptr_t */
521  #define         SCNuPTR                 SCNu16  #define         SCNuPTR                 SCNu16
522    /** \ingroup avr_inttypes
523        hexadecimal scanf format for uintptr_t */
524  #define         SCNxPTR                 SCNx16  #define         SCNxPTR                 SCNx16
525    
 #endif  
526  /*@{*/  /*@{*/
527    
528    

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26