monetary.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* Header file for monetary value formatting functions.
  2. Copyright (C) 1996-2020 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <https://www.gnu.org/licenses/>. */
  15. #ifndef _MONETARY_H
  16. #define _MONETARY_H 1
  17. #include <features.h>
  18. /* Get needed types. */
  19. #define __need_size_t
  20. #include <stddef.h>
  21. #include <bits/types.h>
  22. #ifndef __ssize_t_defined
  23. typedef __ssize_t ssize_t;
  24. # define __ssize_t_defined
  25. #endif
  26. __BEGIN_DECLS
  27. /* Formatting a monetary value according to the current locale. */
  28. extern ssize_t strfmon (char *__restrict __s, size_t __maxsize,
  29. const char *__restrict __format, ...)
  30. __THROW __attribute_format_strfmon__ (3, 4);
  31. #ifdef __USE_XOPEN2K8
  32. /* POSIX.1-2008 extended locale interface (see locale.h). */
  33. # include <bits/types/locale_t.h>
  34. /* Formatting a monetary value according to the given locale. */
  35. extern ssize_t strfmon_l (char *__restrict __s, size_t __maxsize,
  36. locale_t __loc,
  37. const char *__restrict __format, ...)
  38. __THROW __attribute_format_strfmon__ (4, 5);
  39. #endif
  40. #ifdef __LDBL_COMPAT
  41. # include <bits/monetary-ldbl.h>
  42. #endif
  43. __END_DECLS
  44. #endif /* monetary.h */