Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
config_purple.h
Go to the documentation of this file.
00001 /*
00002 
00003   Copyright (C) 2000, 2001 Silicon Graphics, Inc.  All Rights Reserved.
00004 
00005   This program is free software; you can redistribute it and/or modify it
00006   under the terms of version 2 of the GNU General Public License as
00007   published by the Free Software Foundation.
00008 
00009   This program is distributed in the hope that it would be useful, but
00010   WITHOUT ANY WARRANTY; without even the implied warranty of
00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
00012 
00013   Further, this software is distributed without any warranty that it is
00014   free of the rightful claim of any third person regarding infringement 
00015   or the like.  Any license provided herein, whether implied or 
00016   otherwise, applies only to this software file.  Patent licenses, if 
00017   any, provided herein do not apply to combinations of this program with 
00018   other software, or any other product whatsoever.  
00019 
00020   You should have received a copy of the GNU General Public License along
00021   with this program; if not, write the Free Software Foundation, Inc., 59
00022   Temple Place - Suite 330, Boston MA 02111-1307, USA.
00023 
00024   Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pky,
00025   Mountain View, CA 94043, or:
00026 
00027   http://www.sgi.com
00028 
00029   For further information regarding this notice, see:
00030 
00031   http://oss.sgi.com/projects/GenInfo/NoticeExplan
00032 
00033 */
00034 
00035 
00036 /* ====================================================================
00037  * ====================================================================
00038  *
00039  *
00040  * Revision history:
00041  *  25-Mar-97 - Original Version
00042  *
00043  * Description:
00044  *
00045  * Define the external interface to the internal flags representing the
00046  * -PURPLE group options.  It is a single struct, so that addition of
00047  * flags for new options does not require additions to the be Exported
00048  * file.  Since these options do not change on a per region basis,
00049  * there is no need for push/pop operations like other groups (such
00050  * as -LNO) support.
00051  *
00052  * NOTE:  Only the standard group option reader, and routines in the
00053  * associated file config_purple.c, should modify the structs declared
00054  * here.  By following this discipline, leaving a few undefined flags
00055  * at the end of the struct, and adding new flags there, we can avoid 
00056  * serious version incompatibilities between be.so and its clients.
00057  *
00058  * ====================================================================
00059  *
00060  * To add a new option:
00061  *
00062  * (On conversion from the old PURPLE implementation, I tried to use
00063  * naming which was mostly like what had been used before, but
00064  * consistent.  The instructions below reflect the results.)
00065  *
00066  *   1) In the PURPLE_FLAGS options struct defined below, add a field to
00067  *      receive the new option value.  If you need a flag indicating
00068  *      whether the option was set explicitly on the command line, add
00069  *      a BOOL for that as well, with an appended "_set" in its name.
00070  *      (You might also need another field if the option will be used
00071  *      in a different form after configuration, i.e. the option value
00072  *      is a string that is converted to a number.  If so, add another
00073  *      field.)
00074  *
00075  *      The fields are starting out in alphabetical order by option
00076  *      name.  When adding new ones, keep in mind that adding them in
00077  *      the middle will create a required correspondence between the
00078  *      new be.so and lno.so (for purposes of using the later options).
00079  *      That may be alright, but if you want to avoid it, add the new
00080  *      fields just before the buffer at the end (and you can move
00081  *      them into place later when it doesn't matter, if you care).
00082  *
00083  *   2) Below the PURPLE_FLAGS definition are #defines for the
00084  *      "PURPLE_Option_Name" pseudo-variables that everyone will use to
00085  *      reference them.  Add #defines for your new ones.  Note that
00086  *      they all have PURPLE_ prefixes.
00087  *
00088  *   3) There is only one instances of PURPLE_FLAGS in config_purple.c.
00089  *      We do not support pushing/popping of flag values based on
00090  *      region boundaries (will we ever want to?).
00091  *
00092  *   4) The option group descriptor is also in config_purple.c.  Add your
00093  *      new option there.
00094  *
00095  * ====================================================================
00096  * ====================================================================
00097  */
00098 
00099 #ifndef config_purple_INCLUDED
00100 #define config_purple_INCLUDED
00101 
00102 #ifdef _KEEP_RCS_ID
00103 /*REFERENCED*/
00104 #endif /* _KEEP_RCS_ID */
00105 
00106 #ifdef __cplusplus
00107 extern "C" {
00108 #endif /* __cplusplus */
00109 
00110 /* ====================================================================
00111  *
00112  * -PURPLE: option group
00113  *
00114  * Define the global structure containing -PURPLE option group flags.
00115  *
00116  * WARNING:  Most of the fields in this struct must be addressable by
00117  * an option group descriptor -- hence BOOL instead of mBOOL.
00118  *
00119  * ====================================================================
00120  */
00121 
00122 
00123 typedef struct purple_flags 
00124 {
00125    BOOL        enabled;             /* Enabled? */
00126    const char *orignsrc_filename;   /* Call-trace outfile */
00127    const char *callemit_filename;   /* Call-trace outfile */
00128    const char *valueemit_filename;  /* Value-trace outfile */
00129    const char *srcemit_filename;    /* Srcs-fragment outfile */
00130    const char *inclemit_filename;   /* Srcs-included outfile */
00131    const char *calltrace_filename;  /* Call-trace infile */
00132    BOOL        language_c;          /* Original in C */
00133    BOOL        language_ftn;        /* Original in Fortran */
00134    BOOL        warn;                /* Warn about constructs not handled */
00135    BOOL        verbose;             /* Show progress */
00136    BOOL        keep;                /* Keep call-graph file */
00137 
00138   /* This buffer area allows references to new fields to be added in
00139    * later revisions, from other DSOs, without requiring a new be.so
00140    * or running the risk of referencing illegal data.  Assuming that
00141    * the buffer is initialized to zeroes, any such references will
00142    * simply pick up FALSE values (for the Booleans):
00143    */
00144   INT32 buffer[16];     /* Buffer space -- initialize to FALSE */
00145 } PURPLE_FLAGS;
00146 
00147 
00148 /* ====================================================================
00149  *
00150  * -PURPLE: option group
00151  *
00152  * Global data "objects" and manipulation functions.
00153  *
00154  * ====================================================================
00155  */
00156 
00157 /* This is always the current set of option values: */
00158 extern PURPLE_FLAGS *Current_PURPLE;
00159 
00160 /* Define pseudo-variables for general usage: */
00161 #define PURPLE_enabled             Current_PURPLE->enabled
00162 #define PURPLE_orignsrc_filename   Current_PURPLE->orignsrc_filename
00163 #define PURPLE_callemit_filename   Current_PURPLE->callemit_filename
00164 #define PURPLE_valueemit_filename  Current_PURPLE->valueemit_filename
00165 #define PURPLE_srcemit_filename    Current_PURPLE->srcemit_filename
00166 #define PURPLE_inclemit_filename   Current_PURPLE->inclemit_filename
00167 #define PURPLE_calltrace_filename  Current_PURPLE->calltrace_filename
00168 #define PURPLE_language_c          Current_PURPLE->language_c
00169 #define PURPLE_language_ftn        Current_PURPLE->language_ftn
00170 #define PURPLE_warn                Current_PURPLE->warn
00171 #define PURPLE_verbose             Current_PURPLE->verbose
00172 #define PURPLE_keep                Current_PURPLE->keep
00173 
00174 
00175 #ifdef __cplusplus
00176 }
00177 #endif /* __cplusplus */
00178     
00179 #endif /* config_purple_INCLUDED */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines