Back to index

cell-binutils  2.17cvs20070401
binemul.c
Go to the documentation of this file.
00001 /* Binutils emulation layer.
00002    Copyright 2002, 2003 Free Software Foundation, Inc.
00003    Written by Tom Rix, Red Hat Inc.
00004 
00005    This file is part of GNU Binutils.
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 2 of the License, or
00010    (at your option) any later version.
00011 
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016 
00017    You should have received a copy of the GNU General Public License
00018    along with this program; if not, write to the Free Software
00019    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00020 
00021 #include "binemul.h"
00022 
00023 extern bin_emulation_xfer_type bin_dummy_emulation;
00024 
00025 void
00026 ar_emul_usage (FILE *fp)
00027 {
00028   if (bin_dummy_emulation.ar_usage)
00029     bin_dummy_emulation.ar_usage (fp);
00030 }
00031 
00032 void
00033 ar_emul_default_usage (FILE *fp)
00034 {
00035   AR_EMUL_USAGE_PRINT_OPTION_HEADER (fp);
00036   /* xgettext:c-format */
00037   fprintf (fp, _("  No emulation specific options\n"));
00038 }
00039 
00040 bfd_boolean
00041 ar_emul_append (bfd **after_bfd, char *file_name, bfd_boolean verbose)
00042 {
00043   if (bin_dummy_emulation.ar_append)
00044     return bin_dummy_emulation.ar_append (after_bfd, file_name, verbose);
00045 
00046   return FALSE;
00047 }
00048 
00049 bfd_boolean
00050 ar_emul_default_append (bfd **after_bfd, char *file_name,
00051                      bfd_boolean verbose)
00052 {
00053   bfd *temp;
00054 
00055   temp = *after_bfd;
00056   *after_bfd = bfd_openr (file_name, NULL);
00057 
00058   AR_EMUL_ELEMENT_CHECK (*after_bfd, file_name);
00059   AR_EMUL_APPEND_PRINT_VERBOSE (verbose, file_name);
00060 
00061   (*after_bfd)->next = temp;
00062 
00063   return TRUE;
00064 }
00065 
00066 bfd_boolean
00067 ar_emul_replace (bfd **after_bfd, char *file_name, bfd_boolean verbose)
00068 {
00069   if (bin_dummy_emulation.ar_replace)
00070     return bin_dummy_emulation.ar_replace (after_bfd, file_name, verbose);
00071 
00072   return FALSE;
00073 }
00074 
00075 bfd_boolean
00076 ar_emul_default_replace (bfd **after_bfd, char *file_name,
00077                       bfd_boolean verbose)
00078 {
00079   bfd *temp;
00080 
00081   temp = *after_bfd;
00082   *after_bfd = bfd_openr (file_name, NULL);
00083 
00084   AR_EMUL_ELEMENT_CHECK (*after_bfd, file_name);
00085   AR_EMUL_REPLACE_PRINT_VERBOSE (verbose, file_name);
00086 
00087   (*after_bfd)->next = temp;
00088 
00089   return TRUE;
00090 }
00091 
00092 bfd_boolean
00093 ar_emul_parse_arg (char *arg)
00094 {
00095   if (bin_dummy_emulation.ar_parse_arg)
00096     return bin_dummy_emulation.ar_parse_arg (arg);
00097 
00098   return FALSE;
00099 }
00100 
00101 bfd_boolean
00102 ar_emul_default_parse_arg (char *arg ATTRIBUTE_UNUSED)
00103 {
00104   return FALSE;
00105 }