Back to index

cell-binutils  2.17cvs20070401
binemul.h
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 #ifndef BINEMUL_H
00022 #define BINEMUL_H
00023 
00024 #include "bfd.h"
00025 #include "bucomm.h"
00026 
00027 extern void ar_emul_usage (FILE *);
00028 extern void ar_emul_default_usage (FILE *);
00029 extern bfd_boolean ar_emul_append (bfd **, char *, bfd_boolean);
00030 extern bfd_boolean ar_emul_default_append (bfd **, char *, bfd_boolean);
00031 extern bfd_boolean ar_emul_replace (bfd **, char *, bfd_boolean);
00032 extern bfd_boolean ar_emul_default_replace (bfd **, char *, bfd_boolean);
00033 extern bfd_boolean ar_emul_parse_arg (char *);
00034 extern bfd_boolean ar_emul_default_parse_arg (char *);
00035 
00036 /* Macros for common output.  */
00037 
00038 #define AR_EMUL_USAGE_PRINT_OPTION_HEADER(fp) \
00039   /* xgettext:c-format */                     \
00040   fprintf (fp, _(" emulation options: \n"))
00041 
00042 #define AR_EMUL_ELEMENT_CHECK(abfd, file_name) \
00043   do { if ((abfd) == NULL) bfd_fatal (file_name); } while (0)
00044 
00045 #define AR_EMUL_APPEND_PRINT_VERBOSE(verbose, file_name) \
00046   do { if (verbose) printf ("a - %s\n", file_name); } while (0)
00047 
00048 #define AR_EMUL_REPLACE_PRINT_VERBOSE(verbose, file_name) \
00049   do { if (verbose) printf ("r - %s\n", file_name); } while (0)
00050 
00051 typedef struct bin_emulation_xfer_struct
00052 {
00053   /* Print out the extra options.  */
00054   void (* ar_usage) (FILE *fp);
00055   bfd_boolean (* ar_append) (bfd **, char *, bfd_boolean);
00056   bfd_boolean (* ar_replace) (bfd **, char *, bfd_boolean);
00057   bfd_boolean (* ar_parse_arg) (char *);
00058 }
00059 bin_emulation_xfer_type;
00060 
00061 #endif