import.c 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* import.c: Routines for object file imports
  2. Copyright (C) 2002-2003 Sebastian Reichelt
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 2, or (at your option)
  6. any later version.
  7. This program 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
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software Foundation,
  13. Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
  14. #include "import.h"
  15. #ifdef COFF_SUPPORT
  16. #include "../formats/coff.h"
  17. #include "imp_coff.h"
  18. #endif /* COFF_SUPPORT */
  19. #ifdef AMIGAOS_SUPPORT
  20. #include "../formats/amigaos.h"
  21. #include "imp_amig.h"
  22. #endif /* AMIGAOS_SUPPORT */
  23. // Import an object file with an arbitrary format.
  24. BOOLEAN ImportObjectFile (PROGRAM *Program, const I1 *File, SIZE FileSize, const char *FileName)
  25. {
  26. #ifdef COFF_SUPPORT
  27. if (IsCOFFFile (File, FileSize))
  28. return (ImportCOFFFile (Program, File, FileSize, FileName));
  29. else
  30. #endif /* COFF_SUPPORT */
  31. #ifdef AMIGAOS_SUPPORT
  32. if (IsAmigaOSFile (File, FileSize))
  33. return (ImportAmigaOSFile (Program, File, FileSize, FileName));
  34. else
  35. #endif /* AMIGAOS_SUPPORT */
  36. {
  37. Error (FileName, "Unknown object file format.");
  38. return FALSE;
  39. }
  40. }