catgetsinfo.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* Copyright (C) 1996-2026 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, see
  13. <https://www.gnu.org/licenses/>. */
  14. #include <sys/types.h>
  15. struct catalog_obj
  16. {
  17. uint32_t magic;
  18. uint32_t plane_size;
  19. uint32_t plane_depth;
  20. /* This is in fact two arrays in one: always a pair of name and
  21. pointer into the data area. */
  22. uint32_t name_ptr[0];
  23. };
  24. /* This structure will be filled after loading the catalog. */
  25. typedef struct catalog_info
  26. {
  27. enum { mmapped, malloced } status;
  28. size_t plane_size;
  29. size_t plane_depth;
  30. uint32_t *name_ptr;
  31. const char *strings;
  32. struct catalog_obj *file_ptr;
  33. size_t file_size;
  34. } *__nl_catd;
  35. /* The magic number to signal we really have a catalog file. */
  36. #define CATGETS_MAGIC 0x960408deU
  37. /* Prototypes for helper functions. */
  38. extern int __open_catalog (const char *cat_name, const char *nlspath,
  39. const char *env_var, __nl_catd __catalog);
  40. libc_hidden_proto (__open_catalog)