monetary.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* Header file for monetary value formatting functions.
  2. Copyright (C) 1996-2026 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. __attr_access ((__write_only__, 1, 2));
  32. #ifdef __USE_XOPEN2K8
  33. /* POSIX.1-2008 extended locale interface (see locale.h). */
  34. # include <bits/types/locale_t.h>
  35. /* Formatting a monetary value according to the given locale. */
  36. extern ssize_t strfmon_l (char *__restrict __s, size_t __maxsize,
  37. locale_t __loc,
  38. const char *__restrict __format, ...)
  39. __THROW __attribute_format_strfmon__ (4, 5)
  40. __attr_access ((__write_only__, 1, 2));
  41. #endif
  42. #include <bits/floatn.h>
  43. #if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
  44. # include <bits/monetary-ldbl.h>
  45. #endif
  46. __END_DECLS
  47. #endif /* monetary.h */