file-find.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* Prototypes and data structures used for implementing functions for
  2. finding files relative to GCC binaries.
  3. Copyright (C) 1992-2019 Free Software Foundation, Inc.
  4. This file is part of GCC.
  5. GCC is free software; you can redistribute it and/or modify it under
  6. the terms of the GNU General Public License as published by the Free
  7. Software Foundation; either version 3, or (at your option) any later
  8. version.
  9. GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  12. for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with GCC; see the file COPYING3. If not see
  15. <http://www.gnu.org/licenses/>. */
  16. #ifndef GCC_FILE_FIND_H
  17. #define GCC_FILE_FIND_H
  18. /* Structure to hold all the directories in which to search for files to
  19. execute. */
  20. struct prefix_list
  21. {
  22. const char *prefix; /* String to prepend to the path. */
  23. struct prefix_list *next; /* Next in linked list. */
  24. };
  25. struct path_prefix
  26. {
  27. struct prefix_list *plist; /* List of prefixes to try */
  28. int max_len; /* Max length of a prefix in PLIST */
  29. const char *name; /* Name of this list (used in config stuff) */
  30. };
  31. extern void find_file_set_debug (bool);
  32. extern char *find_a_file (struct path_prefix *, const char *, int);
  33. extern void add_prefix (struct path_prefix *, const char *);
  34. extern void add_prefix_begin (struct path_prefix *, const char *);
  35. extern void prefix_from_env (const char *, struct path_prefix *);
  36. extern void prefix_from_string (const char *, struct path_prefix *);
  37. #endif /* GCC_FILE_FIND_H */