Main Page ? Class Hierarchy ? Compound List ? File List ? Compound Members ? File Members ?

Cmt Class Reference

#include

Collaboration diagram for Cmt:

[legend]
List of all members.

Static Public Methods

void? build_config (const cmt_string& prefix, cmt_string& config)
? Append "CONFIG" to the prefix. More...

void? build_makefile (const cmt_string& target)
void? build_msdev_file (const cmt_string& target)
void? build_vsnet_file (const cmt_string& target)
? Visual Studio.net Support. More...

bool? build_nmake ()
void? build_OS9_makefile (const cmt_string& target)
void? build_prefix (const cmt_string& package, cmt_string& prefix)
? Convert a package name to its upper case copy. More...

void? clear ()
void? configure ()
void? configure_cmt_path (Use* use)
void? configure_config_tag ()
void? configure_current_cmtpath ()
void? configure_current_dir ()
void? configure_current_package ()
void? configure_current_structuring_style ()
void? configure_default_path ()
void? configure_home (Use* use)
void? configure_user_context (Use* use)
void? configure_hosttype_tag ()
void? configure_site_tag (Use* use)
void? configure_tags (Use* use)
void? configure_uname_tag ()
void? configure_version_tag ()
void? do_awk (const CmtSystem::cmt_string_vector& arguments)
void? do_broadcast (const CmtSystem::cmt_string_vector& arguments, int argc, char* argv[])
void? do_build_constituent_makefile (const CmtSystem::cmt_string_vector& arguments, int argc, char* argv[])
void? do_build_constituents_makefile (const CmtSystem::cmt_string_vector& arguments, int argc, char* argv[])
void? do_build_dependencies (const CmtSystem::cmt_string_vector& arguments, int argc, char* argv[])
void? do_build_library_links ()
void? do_build_make_setup ()
? Here we expect that only the base name of the library is given : ie it should not contain the "lib" prefix, nor the suffix .so, nor any path prefix. More...

void? do_build_msdev (const CmtSystem::cmt_string_vector& arguments)
void? do_build_vsnet (const CmtSystem::cmt_string_vector& arguments)
void? do_build_os9_makefile (const CmtSystem::cmt_string_vector& arguments)
void? do_build_prototype (const CmtSystem::cmt_string_vector& arguments)
void? do_build_readme (const CmtSystem::cmt_string_vector& arguments)
void? do_build_tag_makefile ()
void? do_build_temporary_name ()
void? do_build_triggers (const CmtSystem::cmt_string_vector& arguments)
void? do_build_windefs (const CmtSystem::cmt_string_vector& arguments)
void? do_check_configuration ()
void? do_check_files (const CmtSystem::cmt_string_vector& arguments)
void? do_check_version (const CmtSystem::cmt_string_vector& arguments)
void? do_checkout (const CmtSystem::cmt_string_vector& arguments)
void? do_cleanup (PrintMode& mode)
void? do_config ()
void? do_create (const CmtSystem::cmt_string_vector& arguments)
void? do_cvsbranches (const CmtSystem::cmt_string_vector& arguments)
void? do_cvssubpackages (const CmtSystem::cmt_string_vector& arguments)
void? do_cvstags (const CmtSystem::cmt_string_vector& arguments)
void? do_expand_model (const CmtSystem::cmt_string_vector& arguments)
void? do_filter (const CmtSystem::cmt_string_vector& arguments)
? Handle free filtering of text files containing or ${xxx} patterns. More...

void? do_help (ActionType help_action = action_none)
void? do_lock (const cmt_string& package, const cmt_string& version, const cmt_string& path)
void? do_remove (const cmt_string& package, const cmt_string& version, const cmt_string& path)
void? do_remove_library_links ()
void? do_run (const CmtSystem::cmt_string_vector& arguments)
? Here we expect that only the base name of the library is given : ie it should not contain the "lib" prefix, nor the suffix .so, nor any path prefix. More...

void? do_run_sequence (const CmtSystem::cmt_string_vector& arguments)
void? do_set_version (const CmtSystem::cmt_string_vector& arguments)
void? do_set_versions (const CmtSystem::cmt_string_vector& arguments)
void? do_setup (PrintMode& mode)
void? do_show_all_tags ()
void? do_show_applied_patterns ()
void? do_show_author ()
void? do_show_branches (PrintMode& mode)
void? do_show_clients (const CmtSystem::cmt_string_vector& arguments)
void? do_show_cmtpath_patterns ()
void? do_show_constituent (const CmtSystem::cmt_string_vector& arguments)
void? do_show_constituent_names ()
void? do_show_constituents ()
void? do_show_cycles ()
void? do_show_fragment (const CmtSystem::cmt_string_vector& arguments)
void? do_show_fragments ()
void? do_show_groups ()
void? do_show_include_dirs ()
void? do_show_language (const CmtSystem::cmt_string_vector& arguments)
void? do_show_languages ()
void? do_show_macro (const CmtSystem::cmt_string_vector& arguments, PrintMode& mode)
void? do_show_macro_names (const CmtSystem::cmt_string_vector& arguments, PrintMode& mode)
void? do_show_macro_value (const CmtSystem::cmt_string_vector& arguments, PrintMode& mode)
void? do_show_macros (const CmtSystem::cmt_string_vector& arguments, PrintMode& mode)
void? do_show_manager ()
void? do_show_packages (const CmtSystem::cmt_string_vector& arguments)
void? do_show_path ()
void? do_show_pattern (const CmtSystem::cmt_string_vector& arguments)
void? do_show_pattern_names ()
void? do_show_patterns ()
void? do_show_projects ()
void? do_show_pwd ()
void? do_show_setup ()
void? do_show_set (const CmtSystem::cmt_string_vector& arguments, PrintMode& mode)
void? do_show_set_names (const CmtSystem::cmt_string_vector& arguments, PrintMode& mode)
void? do_show_set_value (const CmtSystem::cmt_string_vector& arguments, PrintMode& mode)
void? do_show_sets (const CmtSystem::cmt_string_vector& arguments, PrintMode& mode)
void? do_show_strategies ()
void? do_show_tags ()
void? do_show_use_paths (const CmtSystem::cmt_string_vector& arguments)
void? do_show_uses ()
void? do_show_version ()
void? do_show_versions (const CmtSystem::cmt_string_vector& arguments)
void? do_show_system ()
void? do_unlock (const cmt_string& package, const cmt_string& version, const cmt_string& path)
void? do_version ()
const cmt_string&? filter_dir (const cmt_string& dir)
ActionType? get_action ()
const CmtSystem::cmt_string_vector&? get_cmt_path ()
const CmtSystem::cmt_string_vector&? get_cmt_path_sources ()
const cmt_string&? get_cmt_home ()
const cmt_string&? get_cmt_user_context ()
const cmt_string&? get_current_dir ()
const cmt_string&? get_current_package ()
const cmt_string&? get_current_cmtpath ()
const cmt_string&? get_current_offset ()
AccessMode? get_current_access ()
int? get_current_build_strategy ()
int? get_current_setup_strategy ()
VersionStrategy? get_current_strategy ()
CmtStructuringStyle? get_current_structuring_style ()
const cmt_string&? get_current_version ()
const cmt_string&? get_current_target ()
bool? get_debug ()
bool? get_quiet ()
bool? get_recursive ()
ScopeType? get_scope ()
CmtScopeFilteringMode? get_scope_filtering_mode ()
void? install_cleanup_scripts ()
void? install_setup_scripts ()
void? install_test_cleanup_scripts ()
void? install_test_setup_scripts ()
bool? load (const cmt_string& path, const cmt_string& package, const cmt_string& version, const cmt_string& tag_name = "")
? load is only called from the Windows GUI which pretends to access directly the internal data model. More...

bool? need_prototypes ()
? See reach_current_package for an explanation of this call. More...

void? parse_arguments (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments, cmt_string& extra_line, cmt_string& extra_file, PrintMode& mode)
int? parser (const cmt_string& command_line)
int? parser (int argc, char* argv[])
void? print (PrintMode mode)
? Format as one single line a set of 'setenv' statements joined with semi-colons to form one shell command. More...

void? print_clean (PrintMode mode)
? Format as one single line a set of 'unsetenv' statements joined with semi-colons to form one shell command. More...

void? print_context (Use& use, PrintMode mode, const cmt_string& tag)
void? print_macros (PrintMode mode, const cmt_string& pattern = "")
? Format a set of make macro definitions (one per line) Each macro value is provided enclosed in single quotes. More...

void? print_symbol_names (PrintMode mode, const cmt_string& pattern = "")
? Format a set of make macro definitions (one per line) Each macro value is provided enclosed in single quotes. More...

void? print_tabs (int tabs)
int? reach_current_package ()
void? restore_all_tags (Use* use)
void? set_current_access (AccessMode mode)
void? set_current_build_strategy (int strategy)
void? set_current_setup_strategy (int strategy)
void? set_current_strategy (VersionStrategy strategy)
void? set_scope (ScopeType scope)
void? set_scope_filtering_mode (CmtScopeFilteringMode mode)
void? set_standard_macros ()
void? use_cmt ()
? Macros implied or required to manage constituents. More...

void? use_home_requirements ()
void? use_user_context_requirements ()
cmt_string? vector_to_string (const CmtSystem::cmt_string_vector& v)
void? vector_to_string (const CmtSystem::cmt_string_vector& v, const cmt_string& separator, cmt_string& result)

Static Private Attributes

ActionType? m_action
? All Attributes are private. More...

ActionType? m_help_action
bool? m_build_nmake
cmt_string? m_cmt_config
CmtSystem::cmt_string_vector? m_cmt_path
CmtSystem::cmt_string_vector? m_cmt_path_pwds
CmtSystem::cmt_string_vector? m_cmt_path_sources
cmt_string? m_cmt_root
cmt_string? m_cmt_home
cmt_string? m_cmt_user_context
cmt_string? m_cmt_site
cmt_string? m_cmt_version
int? m_current_build_strategy = DefaultBuildStrategy
int? m_current_setup_strategy = DefaultSetupStrategy
cmt_string? m_current_dir
cmt_string? m_current_package
cmt_string? m_current_config
cmt_string? m_current_path
cmt_string? m_current_prefix
cmt_string? m_current_cmtpath
cmt_string? m_current_offset
AccessMode? m_current_access = UserMode
VersionStrategy? m_current_strategy = BestFit
CmtDirStyle? m_current_style = cmt_style
CmtStructuringStyle? m_current_structuring_style = with_version_directory
cmt_string? m_current_tag
cmt_string? m_current_target
cmt_string? m_current_version
cmt_string? m_extra_tags
cmt_string? m_configure_error
bool? m_debug
cmt_string? m_default_path
bool? m_quiet
bool? m_recursive
ScopeType? m_scope
CmtScopeFilteringMode? m_scope_filtering_mode
bool? m_simulation
bool? m_standard_macros_done

Member Function Documentation

void Cmt::build_OS9_makefile ( const cmt_string & target?) [static]
?

Definition at line 807 of file cmt_parser.cxx.

Referenced by do_build_os9_makefile().

00808 {
00809   build_makefile (target);
00810 }

void Cmt::build_config ( const cmt_string & prefix,
cmt_string & config?) [static]
?

Append "CONFIG" to the prefix.

Definition at line 708 of file cmt_parser.cxx.

Referenced by configure_current_package(), and load().

00710 {
00711   /*
00712     Building the config from  
00713   */
00714 
00715   config = prefix;
00716   config += "CONFIG";
00717 }

void Cmt::build_makefile ( const cmt_string & target?) [static]
?

Definition at line 720 of file cmt_parser.cxx.

Referenced by build_OS9_makefile().

00721 {
00722   Constituent* constituent = 0;
00723 
00724   if (target.size () > 0)
00725     {
00726       /*
00727         Do genmake for one specific target.
00728       */
00729       constituent = Constituent::find (target);
00730       if (constituent != 0)
00731         {
00732           constituent->build_makefile (m_simulation);
00733         }
00734     }
00735   else
00736     {
00737       /*
00738         Do genmake for all possible targets.
00739       */
00740       Constituent::build_all_makefiles (m_simulation);
00741     }
00742 }

void Cmt::build_msdev_file ( const cmt_string & target?) [static]
?

Definition at line 745 of file cmt_parser.cxx.

Referenced by do_build_msdev().

00746 {
00747   Constituent* constituent = 0;
00748 
00749   set_standard_macros ();
00750 
00751   if (target != "")
00752     {
00753       /*
00754         Do genmsdev for one specific target.
00755       */
00756       constituent = Constituent::find (target);
00757       if (constituent != 0)
00758         {
00759           constituent->build_msdev_file (m_simulation);
00760         }
00761     }
00762   else
00763     {
00764       /*
00765         Do genmsdev for all possible targets.
00766       */
00767       Constituent::build_all_msdev_files (m_simulation);
00768     }
00769 }

bool Cmt::build_nmake ( ) [static]
?

Definition at line 801 of file cmt_parser.cxx.

Referenced by LibraryGenerator::analyze_file(), DependencyGenerator::build(), ConstituentsMakefileGenerator::build(), MakeSetupGenerator::build(), Fragment::locate(), and CmtGenerator::prepare_output().

00802 {
00803   return (m_build_nmake);
00804 }

void Cmt::build_prefix ( const cmt_string & package,
cmt_string & prefix?) [static]
?

Convert a package name to its upper case copy.

Definition at line 815 of file cmt_parser.cxx.

Referenced by configure_current_package(), load(), and Use::set().

00816 {
00817   int pos;
00818   char c;
00819 
00820   /*
00821     Building the prefix from  
00822   */
00823 
00824   prefix = package;
00825 
00826   for (pos = 0; pos < package.size (); pos++)
00827     {
00828       c = package[pos];
00829       prefix[pos] = toupper (c);
00830     }
00831 }

void Cmt::build_vsnet_file ( const cmt_string & target?) [static]
?

Visual Studio.net Support.

Definition at line 774 of file cmt_parser.cxx.

Referenced by do_build_vsnet().

00775 {                                                            
00776   Constituent* constituent = 0;                              
00777                                                              
00778   set_standard_macros ();                                    
00779                                                              
00780   if (target != "")                                          
00781     {                                                        
00782       /*                                                     
00783         Do genvsnet for one specific target.                 
00784       */                                                     
00785       constituent = Constituent::find (target);              
00786       if (constituent != 0)                                  
00787         {                                                    
00788           constituent->build_vsnet_file (m_simulation);        
00789         }                                                    
00790     }                                                        
00791   else                                                       
00792     {                                                        
00793       /*                                                     
00794         Do genvsnet for all possible targets.                
00795       */                                                     
00796       Constituent::build_all_vsnet_files (m_simulation);       
00797     }                                                        
00798 }

void Cmt::clear ( ) [static]
?

Definition at line 834 of file cmt_parser.cxx.

Referenced by do_show_clients(), load(), and parser().

00835 {
00836   m_action         = action_none;
00837   m_help_action    = action_none;
00838   m_build_nmake    = false;
00839   m_cmt_config     = "";
00840   m_cmt_path.clear ();
00841   m_cmt_path_pwds.clear ();
00842   m_cmt_path_sources.clear ();
00843   m_cmt_root       = "";
00844   m_cmt_version    = "";
00845   m_current_build_strategy = DefaultBuildStrategy;
00846   m_current_setup_strategy = DefaultSetupStrategy;
00847   m_current_dir     = "";
00848   m_current_package = "";
00849   m_current_config  = "";
00850   m_current_path    = "";
00851   m_current_prefix  = "";
00852   m_current_cmtpath = "";
00853   m_current_offset  = "";
00854 
00855   m_current_access   = DeveloperMode;
00856   m_current_strategy = BestFit;
00857 
00858   m_current_tag      = "";
00859   m_current_target   = "";
00860   m_current_version  = "";
00861   m_default_path     = "";
00862   m_quiet            = false;
00863   m_recursive        = false;
00864 
00865   m_scope            = ScopePublic;
00866   m_scope_filtering_mode = default_filtering_mode;
00867   m_simulation       = false;
00868 
00869   m_standard_macros_done = false;
00870 
00871   Database::clear ();
00872   Include::clear_all ();
00873   Script::clear_all ();
00874   CmtError::clear ();
00875 }

void Cmt::configure ( ) [static]
?

Definition at line 878 of file cmt_parser.cxx.

Referenced by do_show_clients(), load(), and parser().

00879 {
00880   static bool configured = false;
00881 
00882   if (configured) return;
00883 
00884   m_cmt_version   = "";
00885   m_current_dir     = "";
00886   m_current_package = "";
00887   m_current_prefix  = "";
00888   m_current_config  = "";
00889   m_current_path    = "";
00890   m_current_cmtpath = "";
00891   m_current_offset  = "";
00892 
00893   m_current_tag     = "";
00894   m_current_version = "";
00895 
00896   m_configure_error = "";
00897 
00898   m_debug = false;
00899   if (getenv ("CMTDEBUG") != 0) m_debug = true;
00900 
00901   m_default_path    = "";
00902 
00903   configure_default_path ();
00904   configure_version_tag ();
00905   configure_uname_tag ();
00906   configure_hosttype_tag ();
00907   configure_config_tag ();
00908   configure_site_tag (0);
00909   configure_cmt_path (0);
00910   configure_current_dir ();
00911   configure_current_package ();
00912   configure_current_structuring_style ();
00913   configure_home (0);
00914   configure_user_context (0);
00915 
00916   Use& use = Use::current();
00917 
00918   use.set (m_current_package,
00919            m_current_version,
00920            m_current_path,
00921            "",
00922            "");
00923 
00924   use.style = m_current_style;
00925 
00926   use.change_path (m_current_path);
00927 
00928   if (CmtError::has_pending_error ()) 
00929     {
00930       m_configure_error = CmtError::get_last_error ();
00931     }
00932 }

void Cmt::configure_cmt_path ( Use * use?) [static]
?

Definition at line 935 of file cmt_parser.cxx.

Referenced by Symbol::action(), and configure().

00936 {
00937   cmt_string s;
00938 
00939   Symbol* symbol = Symbol::find ("CMTPATH");
00940   if (symbol != 0)
00941     {
00942       bool show_set_hidden = false;
00943 
00944       if (Cmt::m_action == action_show_set)
00945         {
00946           show_set_hidden = true;
00947           Cmt::m_action = action_none;
00948         }
00949 
00950       s = symbol->build_macro_value ();
00951       Symbol::expand (s);
00952 
00953       if (show_set_hidden)
00954         {
00955           show_set_hidden = false;
00956           Cmt::m_action = action_show_set;
00957         }
00958     }
00959 
00960   CmtSystem::get_cmt_paths (m_cmt_path, 
00961                             m_cmt_path_pwds, 
00962                             m_cmt_path_sources, s);
00963 }

void Cmt::configure_config_tag ( ) [static]
?

Definition at line 966 of file cmt_parser.cxx.

Referenced by configure(), and parse_arguments().

00967 {
00968   m_cmt_config = CmtSystem::get_cmt_config ();
00969   if (m_cmt_config != "")
00970     {
00971       Tag* tag;
00972 
00973       tag = Tag::add (m_cmt_config, PriorityConfig, "CMTCONFIG", 0);
00974       tag->mark ();
00975     }
00976 }

void Cmt::configure_current_cmtpath ( ) [static]
?

Definition at line 979 of file cmt_parser.cxx.

Referenced by StandardMacroBuilder::fill_for_branches().

00980 {
00981   const CmtSystem::cmt_string_vector& cp = Cmt::get_cmt_path ();
00982 
00983   Use& current_use = Use::current ();
00984 
00985   m_current_cmtpath = "";
00986   m_current_offset = "";
00987 
00988   int i;
00989 
00990   for (i = 0; i < cp.size (); ++i)
00991     {
00992       const cmt_string& p = cp[i];
00993       
00994       if (current_use.path.find (p) == 0)
00995         {
00996           m_current_cmtpath = p;
00997           
00998           static const cmt_string empty_string;
00999           static const cmt_string fs = CmtSystem::file_separator ();
01000 
01001           m_current_offset = current_use.path;
01002           m_current_offset.replace (p, empty_string);
01003           if (m_current_offset[0] == CmtSystem::file_separator ())
01004             {
01005               m_current_offset.replace (fs, empty_string);
01006             }
01007 
01008           break;
01009         }
01010     }
01011 }

void Cmt::configure_current_dir ( ) [static]
?

Definition at line 1014 of file cmt_parser.cxx.

Referenced by configure(), load(), and reach_current_package().

01015 {
01016   cmt_string file_name;
01017 
01018   /*
01019     Building current_dir :
01020 
01021     o we first get the physical value (using getwd)
01022     o then this value is possibly filtered using the
01023     cmt_mount_filter file.
01024   */
01025 
01026   m_current_dir.erase (0);
01027 
01028   file_name = m_default_path;
01029   if (file_name != "")
01030     {
01031       file_name += CmtSystem::file_separator ();
01032       file_name += "CMT";
01033       file_name += CmtSystem::file_separator ();
01034       file_name += m_cmt_version;
01035       file_name += CmtSystem::file_separator ();
01036       file_name += "mgr";
01037       file_name += CmtSystem::file_separator ();
01038     }
01039 
01040   file_name += "cmt_mount_filter";
01041 
01042   m_current_dir = CmtSystem::pwd ();
01043 
01044   {
01045     cmt_string text;
01046     cmt_string line;
01047     CmtSystem::cmt_string_vector words;
01048 
01049     text.read (file_name);
01050 
01051     int pos = 0;
01052     int max_pos = text.size ();
01053 
01054     for (pos = 0; pos < max_pos; )
01055       {
01056         int cr = text.find (pos, "\r\n");
01057         int nl = text.find (pos, '\n');
01058         int first = nl;
01059         int length = 1;
01060 
01061         if (cr != cmt_string::npos)
01062           {
01063             if (nl == cmt_string::npos)
01064               {
01065                 first = cr;
01066                 length = 2;
01067               }
01068             else
01069               {
01070                 first = (nl < cr) ? nl : cr;
01071                 length = (nl < cr) ? 1 : 2;
01072               }
01073           }
01074         
01075         if (first == cmt_string::npos)
01076           {
01077             text.substr (pos, line);
01078             pos = max_pos;
01079           }
01080         else if (first > pos)
01081           {
01082             text.substr (pos, first - pos, line);
01083             pos = first + length;
01084           }
01085         else
01086           {
01087             line.erase (0);
01088             pos += length;
01089           }
01090 
01091         CmtSystem::split (line, " \t", words);
01092 
01093         if (words.size () >= 2)
01094           {
01095             cmt_string& path_name = words[0];
01096             cmt_string& replacement = words[1];
01097 
01098             if (m_current_dir.find (path_name) != cmt_string::npos)
01099               {
01100                 m_current_dir.replace (path_name, replacement);
01101                 break;
01102               }
01103           }
01104       }
01105   }
01106 }

void Cmt::configure_current_package ( ) [static]
?

Definition at line 1109 of file cmt_parser.cxx.

Referenced by configure(), and do_config().

01110 {
01111   /*
01112     Build current_package and current_prefix.
01113 
01114     This is only possible if we are within the cmt/mgr branch of a
01115     standard directory tree (i.e. //cmt or mgr)
01116   */
01117 
01118   cmt_string req = "..";
01119   req += CmtSystem::file_separator ();
01120   req += "cmt";
01121   req += CmtSystem::file_separator ();
01122   req += "requirements";
01123 
01124   if (CmtSystem::test_file (req))
01125     {
01126       m_current_style = cmt_style;
01127     }
01128   else
01129     {
01130       cmt_string req = "..";
01131       req += CmtSystem::file_separator ();
01132       req += "mgr";
01133       req += CmtSystem::file_separator ();
01134       req += "requirements";
01135 
01136       if (CmtSystem::test_file (req))
01137         {
01138           m_current_style = mgr_style;
01139         }
01140       else
01141         {
01142           // This package is probably a standalone one
01143           m_current_style = none_style;
01144         }
01145     }
01146 
01147 
01148   if (m_current_style != none_style)
01149     {
01150       //
01151       //  Here there is a ../cmt or ../mgr branch in front of us
01152       //  and there is a requirements file there
01153       //
01154 
01155       cmt_string up_dir;
01156       cmt_string up_branch;
01157 
01158       CmtSystem::dirname (m_current_dir, up_dir);
01159       CmtSystem::basename (up_dir, up_branch);
01160 
01161       cmt_string version_file = "..";
01162       version_file += CmtSystem::file_separator ();
01163       version_file += "cmt";
01164       version_file += CmtSystem::file_separator ();
01165       version_file += "version.cmt";
01166 
01167       if (CmtSystem::test_file (version_file))
01168         {
01169           // 
01170           // There is an explicit version descriptor. This one takes precedence
01171           // and forces the structuring style to no directory
01172           //
01173 
01174           m_current_package = up_branch;
01175           CmtSystem::dirname (up_dir, m_current_path);
01176 
01177           if (m_current_version.read (version_file))
01178             {
01179               int pos;
01180 
01181               pos = m_current_version.find ('\n');
01182               if (pos != cmt_string::npos) m_current_version.erase (pos);
01183               pos = m_current_version.find ('\r');
01184               if (pos != cmt_string::npos) m_current_version.erase (pos);
01185             }
01186           else
01187             {
01188               m_current_version = "v*";
01189             }
01190 
01191           if (m_debug)
01192             {
01193               cout << "Cmt::configure_current_package>" << endl
01194                    << " m_current_package " << m_current_package << endl
01195                    << " m_current_version " << m_current_version << endl
01196                    << " m_current_dir " << m_current_dir << endl
01197                    << " pwd " << CmtSystem::pwd ()
01198                    << endl;
01199             }
01200 
01201           m_current_style = no_version_style;
01202         }
01203       else if (CmtSystem::is_version_directory (up_branch))
01204         {
01205           // The up branch IS a version directory.
01206 
01207           m_current_version = up_branch;
01208           CmtSystem::dirname (up_dir, up_dir);
01209           CmtSystem::basename (up_dir, m_current_package);
01210           CmtSystem::dirname (up_dir, m_current_path);
01211         }
01212       else
01213         {
01214           // No version descriptor
01215           // No version directory. The version is defaulted to v*
01216  
01217           CmtSystem::basename (up_dir, m_current_package);
01218           m_current_version = "v*";
01219           CmtSystem::dirname (up_dir, m_current_path);
01220 
01221           m_current_style = no_version_style;
01222         }
01223 
01224       build_prefix (m_current_package, m_current_prefix);
01225       build_config (m_current_prefix, m_current_config);
01226     }
01227   else
01228     {
01229       m_current_package = "cmt_standalone";
01230       m_current_version = "";
01231       m_current_path = m_current_dir;
01232       build_prefix (m_current_package, m_current_prefix);
01233       build_config (m_current_prefix, m_current_config);
01234       m_current_style = none_style;
01235     }
01236 
01237   //cout << "configure_current_package> current style=" << m_current_style << endl;
01238 }

void Cmt::configure_current_structuring_style ( ) [static]
?

Definition at line 1241 of file cmt_parser.cxx.

Referenced by configure().

01242 {
01243   cmt_string s;
01244 
01245   s = CmtSystem::getenv ("CMTSTRUCTURINGSTYLE");
01246   if (s == "without_version_directory")
01247     {
01248       m_current_structuring_style = without_version_directory;
01249     }
01250 }

void Cmt::configure_default_path ( ) [static]
?

Definition at line 1253 of file cmt_parser.cxx.

Referenced by configure().

01254 {
01255   m_default_path = CmtSystem::get_cmt_root ();
01256   CmtSystem::get_cmt_version (m_cmt_version);
01257   m_cmt_root = m_default_path;
01258   m_cmt_root += CmtSystem::file_separator ();
01259   m_cmt_root += "CMT";
01260   m_cmt_root += CmtSystem::file_separator ();
01261   m_cmt_root += m_cmt_version;
01262 }

void Cmt::configure_home ( Use * use?) [static]
?

Definition at line 1265 of file cmt_parser.cxx.

Referenced by Symbol::action(), and configure().

01266 {
01267   m_cmt_home = "";
01268 
01269   Symbol* symbol = Symbol::find ("CMTHOME");
01270   if (symbol != 0)
01271     {
01272       m_cmt_home = symbol->build_macro_value ();
01273     }
01274   else if (CmtSystem::testenv ("CMTHOME"))
01275     {
01276       m_cmt_home = CmtSystem::getenv ("CMTHOME");
01277     }
01278 
01279   if ((m_cmt_home != "") && !CmtSystem::test_directory (m_cmt_home))
01280     {
01281       m_cmt_home = "";
01282     }
01283 }

void Cmt::configure_hosttype_tag ( ) [static]
?

Definition at line 1307 of file cmt_parser.cxx.

Referenced by configure(), load(), and parse_arguments().

01308 {
01309   cmt_string hosttype;
01310 
01311   CmtSystem::get_hosttype (hosttype);
01312 
01313   if (hosttype != "")
01314     {
01315       Tag* tag;
01316 
01317       tag = Tag::add (hosttype, PriorityUname, "HOSTTYPE", 0);
01318       tag->mark ();
01319     }
01320 }

void Cmt::configure_site_tag ( Use * use?) [static]
?

Definition at line 1323 of file cmt_parser.cxx.

Referenced by Symbol::action(), configure(), load(), and parse_arguments().

01324 {
01325   Symbol* symbol = Symbol::find ("CMTSITE");
01326   if (symbol != 0)
01327     {
01328       m_cmt_site = symbol->build_macro_value ();
01329     }
01330   else
01331     {
01332       m_cmt_site = CmtSystem::get_cmt_site ();
01333     }
01334 
01335   if (m_cmt_site != "")
01336     {
01337       cmt_string s = "CMTSITE";
01338 
01339       if (use != 0)
01340         {
01341           s += " in ";
01342         }
01343 
01344       Tag* tag;
01345 
01346       tag = Tag::add (m_cmt_site, PrioritySite, s, use);
01347       tag->mark ();
01348     }
01349 }

void Cmt::configure_tags ( Use * use?) [static]
?

Definition at line 1395 of file cmt_parser.cxx.

Referenced by Symbol::action(), and restore_all_tags().

01396 {
01397   cmt_string config_tag;
01398   
01399   if (m_debug) cout << "configure_tags0> current_tag=" << m_current_tag << endl;
01400 
01401   Symbol* symbol = Symbol::find ("CMTCONFIG");
01402   if (symbol != 0)
01403     {
01404       bool show_set_hidden = false;
01405 
01406       if (Cmt::m_action == action_show_set)
01407         {
01408           show_set_hidden = true;
01409           Cmt::m_action = action_none;
01410         }
01411 
01412       config_tag = symbol->build_macro_value ();
01413 
01414       if (show_set_hidden)
01415         {
01416           show_set_hidden = false;
01417           Cmt::m_action = action_show_set;
01418         }
01419     }
01420   else if (CmtSystem::testenv ("CMTCONFIG"))
01421     {
01422       config_tag = CmtSystem::getenv ("CMTCONFIG");
01423     }
01424   else if (CmtSystem::testenv ("CMTBIN"))
01425     {
01426       config_tag = CmtSystem::getenv ("CMTBIN");
01427     }
01428 
01429   if (config_tag == "")
01430     {
01431       CmtSystem::get_uname (config_tag);
01432     }
01433 
01434   if (m_debug) cout << "configure_tags> current_tag=" << m_current_tag << endl;
01435 
01436   cmt_string s = "CMTCONFIG";
01437 
01438   if (use != 0)
01439     {
01440       s += " in ";
01441     }
01442 
01443   Tag* tag;
01444 
01445   tag = Tag::add (config_tag, PriorityConfig, s, use);
01446   tag->mark ();
01447 
01448     //m_current_tag = config_tag;
01449 }

void Cmt::configure_uname_tag ( ) [static]
?

Definition at line 1452 of file cmt_parser.cxx.

Referenced by configure(), load(), and parse_arguments().

01453 {
01454   cmt_string uname;
01455 
01456   CmtSystem::get_uname (uname);
01457 
01458   if (uname != "")
01459     {
01460       Tag* tag;
01461 
01462       tag = Tag::add (uname, PriorityUname, "uname", 0);
01463       tag->mark ();
01464     }
01465 }

void Cmt::configure_user_context ( Use * use?) [static]
?

Definition at line 1286 of file cmt_parser.cxx.

Referenced by Symbol::action(), and configure().

01287 {
01288   m_cmt_user_context = "";
01289 
01290   Symbol* symbol = Symbol::find ("CMTUSERCONTEXT");
01291   if (symbol != 0)
01292     {
01293       m_cmt_user_context = symbol->build_macro_value ();
01294     }
01295   else if (CmtSystem::testenv ("CMTUSERCONTEXT"))
01296     {
01297       m_cmt_user_context = CmtSystem::getenv ("CMTUSERCONTEXT");
01298     }
01299 
01300   if ((m_cmt_user_context != "") && !CmtSystem::test_directory (m_cmt_user_context))
01301     {
01302       m_cmt_user_context = "";
01303     }
01304 }

void Cmt::configure_version_tag ( ) [static]
?

Definition at line 1468 of file cmt_parser.cxx.

Referenced by configure(), load(), and parse_arguments().

01469 {
01470   int v = 0;
01471   int r = 0;
01472   int p = 0;
01473 
01474   CmtSystem::is_version_directory (CMTVERSION, v, r, p);
01475 
01476   Tag* tag;
01477 
01478   static char temp[80];
01479 
01480   sprintf (temp, "CMTv%d", v);
01481 
01482   tag = Tag::add (temp, PriorityVersion, "CMTVERSION", 0);
01483   tag->mark ();
01484 
01485   sprintf (temp, "CMTr%d", r);
01486 
01487   tag = Tag::add (temp, PriorityVersion, "CMTVERSION", 0);
01488   tag->mark ();
01489 
01490   sprintf (temp, "CMTp%d", p);
01491 
01492   tag = Tag::add (temp, PriorityVersion, "CMTVERSION", 0);
01493   tag->mark ();
01494 
01495 }

void Cmt::do_awk ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 1514 of file cmt_parser.cxx.

Referenced by parser().

01515 {
01516   if (arguments.size () < 1)
01517     {
01518       cout << "> cmt broadcast  " << endl;
01519       return;
01520     }
01521 
01522   const cmt_string& file = arguments[0];
01523   const cmt_string& pattern = arguments[1];
01524   cmt_string text;
01525 
01526   text.read (file);
01527 
01528   static AwkActor a;
01529 
01530   cmt_regexp exp (pattern);
01531 
01532   a.run (text, exp);
01533 }

void Cmt::do_broadcast ( const CmtSystem::cmt_string_vector & arguments,
int argc,
char * argv[]?) [static]
?

Definition at line 1536 of file cmt_parser.cxx.

Referenced by do_set_versions(), and parser().

01539 {
01540   Use::UsePtrVector& Uses = Use::get_ordered_uses ();
01541 
01542   CmtSystem::cmt_string_vector uses;
01543   CmtSystem::cmt_string_vector packages;
01544   CmtSystem::cmt_string_vector versions;
01545   CmtSystem::cmt_string_vector path_selections;
01546   CmtSystem::cmt_string_vector selections;
01547   CmtSystem::cmt_string_vector exclusions;
01548   cmt_string begin;
01549   cmt_string command;
01550   bool is_cmt = false;
01551   int first = 0;
01552   int i;
01553   bool ignore_errors = false;
01554   bool all_packages = false;
01555 
01556   bool local = true;
01557 
01558   for (i = 0; i < arguments.size (); i++)
01559     {
01560       const cmt_string& w = arguments[i];
01561 
01562       if (command == "")
01563         {
01564           if (w.substr (0, 13) == "-all_packages")
01565             {
01566               local = false;
01567               all_packages = true;
01568             }
01569           else if (w.substr (0, 7) == "-depth=")
01570             {
01571               local = false;
01572 
01573               cmt_string depth_str;
01574               int depth_value = 0;
01575                           
01576               w.substr (7, depth_str);
01577               if ((sscanf (depth_str.c_str (), "%d", &depth_value) < 1) ||
01578                   (depth_value < 1))
01579                 {
01580                   // Syntax error
01581                   //  We shall restrict to packages found within 
01582                   // the  first elements of CMTPATH.
01583                   //  If CMTPATH is empty, nothing is selected.
01584                   // depth=1 is equivalent to local
01585                 }
01586 
01587               int i = 0;
01588               while (i < m_cmt_path.size ())
01589                 {
01590                   cmt_string& p = m_cmt_path[i];
01591                   cmt_string& pwd = m_cmt_path_pwds[i];
01592                   cmt_string& src = m_cmt_path_sources[i];
01593 
01594                   if (src == "current package")
01595                     {
01596                       cmt_string& s1 = path_selections.add ();
01597                       s1 = p;
01598                       cmt_string& s2 = path_selections.add ();
01599                       s2 = pwd;
01600                     }
01601                   else if (src != "default path")
01602                     {
01603                       if (depth_value > 0)
01604                         {
01605                           cmt_string& s1 = path_selections.add ();
01606                           s1 = p;
01607                           cmt_string& s2 = path_selections.add ();
01608                           s2 = pwd;
01609                           depth_value--;
01610                         }
01611                     }
01612                   i++;
01613                 }
01614             }
01615           else if (w.substr (0, 9) == "-exclude=")
01616             {
01617               cmt_string exclusion;
01618 
01619               w.substr (9, exclusion);
01620 
01621               int size = exclusion.size ();
01622               
01623               if (size >= 2)
01624                 {
01625                   if (((exclusion[0] == '"') && (exclusion[size - 1] == '"')) ||
01626                       ((exclusion[0] == '\'') && (exclusion[size - 1] == '\'')))
01627                     {
01628                       exclusion.erase (size - 1);
01629                       exclusion.erase (0, 1);
01630                     }
01631 
01632                   CmtSystem::split (exclusion, " \t", exclusions);
01633                 }
01634             }
01635           else if (w.substr (0, 7) == "-global")
01636             {
01637               path_selections.clear ();
01638 
01639               local = false;
01640             }
01641           else if (w.substr (0, 6) == "-local")
01642             {
01643               local = true;
01644             }
01645           else if (w.substr (0, 8) == "-select=")
01646             {
01647               cmt_string selection;
01648 
01649               w.substr (8, selection);
01650 
01651               int size = selection.size ();
01652               
01653               if (size >= 2)
01654                 {
01655                   if (((selection[0] == '"') && (selection[size - 1] == '"')) ||
01656                       ((selection[0] == '\'') && (selection[size - 1] == '\'')))
01657                     {
01658                       selection.erase (size - 1);
01659                       selection.erase (0, 1);
01660                     }
01661 
01662                   CmtSystem::split (selection, " \t", selections);
01663                 }
01664             }
01665           else if (w.substr (0, 7) == "-begin=")
01666             {
01667               w.substr (7, begin);
01668             }
01669           else
01670             {
01671               command = w;
01672             }
01673         }
01674       else
01675         {
01676           command += " ";
01677           command += w;
01678         }
01679 
01680     }
01681 
01682   if (local)
01683     {
01684       int depth_value = 1;
01685 
01686       int i = 0;
01687       while (i < m_cmt_path.size ())
01688         {
01689           cmt_string& p = m_cmt_path[i];
01690           cmt_string& pwd = m_cmt_path_pwds[i];
01691           cmt_string& src = m_cmt_path_sources[i];
01692 
01693           if (src == "current package")
01694             {
01695               cmt_string& s1 = path_selections.add ();
01696               s1 = p;
01697               cmt_string& s2 = path_selections.add ();
01698               s2 = pwd;
01699             }
01700           else if (src != "default path")
01701             {
01702               if (depth_value > 0)
01703                 {
01704                   cmt_string& s1 = path_selections.add ();
01705                   s1 = p;
01706                   cmt_string& s2 = path_selections.add ();
01707                   s2 = pwd;
01708                   depth_value--;
01709                 }
01710             }
01711           i++;
01712         }
01713     }
01714 
01715   if (command[0] == '-')
01716     {
01717       ignore_errors = true;
01718       command.erase (0, 1);
01719     }
01720 
01721   //if (command.substr (0, 3) == "cmt") is_cmt = true;
01722 
01723   if (all_packages)
01724     {
01725       PackageSelector selector (uses);
01726       FileScanner scanner;
01727           
01728       for (i = 0; i < m_cmt_path.size (); i++)
01729         {
01730           cmt_string& p = m_cmt_path[i];
01731           scanner.scan_path (p, selector);
01732         }
01733     }
01734   else
01735     {
01736       for (i = Uses.size () - 1; i >= 0; i--)
01737         {
01738           Use* use = Uses[i];
01739                   
01740           if (use->discarded) continue;
01741 
01742           if (!use->located ())
01743             {
01744               if (!Cmt::m_quiet)
01745                 {
01746                   cout << "# package " << use->get_package_name () <<
01747                       " " << use->version << " " << use->path <<
01748                       " not found" <<
01749                       endl;
01750                 }
01751             }
01752           else
01753             {
01754               if (use->get_package_name () != "CMT")
01755                 {
01756                   cmt_string& s = uses.add ();
01757 
01758                   use->get_full_path (s);
01759 
01760                   s += CmtSystem::file_separator ();
01761                   if (use->style == mgr_style) s += "mgr";
01762                   else s += "cmt";
01763 
01764                   cmt_string& v = versions.add ();
01765                   v = use->version;
01766 
01767                   cmt_string& p = packages.add ();
01768                   p = use->get_package_name ();
01769 
01770                   //cout << ">>> adding " << s << " to selection" << endl;
01771                 }
01772             }
01773         }
01774           
01775       {
01776         cmt_string& s = uses.add ();
01777                   
01778         Use* use = &(Use::current ());
01779 
01780         if (use->get_package_name ().find ("cmt_standalone") != cmt_string::npos)
01781           {
01782             s = CmtSystem::pwd ();
01783           }
01784         else
01785           {
01786             use->get_full_path (s);
01787 
01788             s += CmtSystem::file_separator ();
01789                   
01790             if (use->style == mgr_style) s += "mgr";
01791             else s += "cmt";
01792           }
01793 
01794         cmt_string& v = versions.add ();
01795         v = use->version;
01796 
01797         cmt_string& p = packages.add ();
01798         p = use->get_package_name ();
01799 
01800         //cout << ">>> adding current " << s << " to selection" << endl;
01801       }
01802     }
01803 
01804   bool started = false;
01805 
01806   if (begin == "") started = true;
01807 
01808   Symbol::all_set ();
01809 
01810   for (i = 0; i < uses.size (); i++)
01811     {
01812       const cmt_string& s = uses[i];
01813       const cmt_string& v = versions[i];
01814       const cmt_string& p = packages[i];
01815       cmt_string cmtpath;
01816 
01817       bool ok = true;
01818       bool selected = true;
01819       bool excluded = false;
01820 
01821       if (path_selections.size () > 0)
01822         {
01823           selected = false;
01824 
01825           for (int j = 0; j < path_selections.size (); j++)
01826             {
01827               const cmt_string& sel = path_selections[j];
01828               
01829               if (s.find (sel) != cmt_string::npos) 
01830                 {
01831                   cmtpath = sel;
01832                   selected = true;
01833                   break;
01834                 }
01835             }
01836 
01837           ok = selected;
01838         }
01839 
01840       if (ok)
01841         {
01842           if (selections.size () > 0)
01843             {
01844               selected = false;
01845               
01846               for (int j = 0; j < selections.size (); j++)
01847                 {
01848                   const cmt_string& sel = selections[j];
01849                   
01850                   if (s.find (sel) != cmt_string::npos) 
01851                     {
01852                       selected = true;
01853                       break;
01854                     }
01855                 }
01856               
01857               ok = selected;
01858             }
01859         }
01860 
01861       if (ok && !started)
01862         {
01863           if (s.find (begin) != cmt_string::npos)
01864             {
01865               started = true;
01866               ok = true;
01867             }
01868           else
01869             {
01870               ok = false;
01871             }
01872         }
01873 
01874 
01875       if (ok)
01876         {
01877           excluded = false;
01878 
01879           for (int j = 0; j < exclusions.size (); j++)
01880             {
01881               const cmt_string& exc = exclusions[j];
01882               
01883               if (s.find (exc) != cmt_string::npos) 
01884                 {
01885                   excluded = true;
01886                   break;
01887                 }
01888             }
01889 
01890           if (excluded) ok = false;
01891         }
01892 
01893       if (!ok) 
01894         {
01895           continue;
01896         }
01897 
01898 
01899 
01900       if (!CmtSystem::cd (s))
01901         {
01902           if (s.find ("cmt_standalone") != cmt_string::npos)
01903             {
01904               cout << "# Currently not in a CMT package" << endl;
01905             }
01906           else
01907             {
01908               cout << "# Cannot move to the package in " << s << " (" << i+1 << "/" 
01909                    << uses.size () << ")"<< endl;
01910             }
01911 
01912           if (!ignore_errors) break;
01913 
01914           continue;
01915         }
01916 
01917       if (CmtLock::check () == CmtLock::locked_by_another_user)
01918         {
01919           cout << "# Ignore locked package in " << s << " (" << i+1 << "/" 
01920                << uses.size () << ")" << endl;
01921           continue;
01922         }
01923 
01924       if (cmtpath == "")
01925         {
01926           const CmtSystem::cmt_string_vector& cmtpaths = Cmt::get_cmt_path ();
01927 
01928           for (int j = 0; j < cmtpaths.size (); j++)
01929             {
01930               const cmt_string& sel = cmtpaths[j];
01931               
01932               if (s.find (sel) != cmt_string::npos) 
01933                 {
01934                   cmtpath = sel;
01935                   break;
01936                 }
01937             }
01938         }
01939 
01940       cmt_string cmd = command;
01941       static const cmt_string version_template = "";
01942       cmd.replace_all (version_template, v);
01943 
01944       static const cmt_string package_template = "";
01945       cmd.replace_all (package_template, p);
01946 
01947       static const cmt_string cmtpath_template = "";
01948       cmd.replace_all (cmtpath_template, cmtpath);
01949 
01950       static const cmt_string offset_template = "";
01951 
01952       static const cmt_string empty_string;
01953       static const cmt_string fs = CmtSystem::file_separator ();
01954       cmt_string offset = s;
01955       offset.replace (cmtpath, empty_string);
01956       if (offset[0] == CmtSystem::file_separator ())
01957         {
01958           offset.replace (fs, empty_string);
01959         }
01960       CmtSystem::dirname (offset, offset);
01961 
01962       cmt_string n;
01963       CmtSystem::basename (offset, n);
01964       if (n == p)
01965         {
01966           CmtSystem::dirname (offset, offset);
01967         }
01968       else
01969         {
01970           CmtSystem::dirname (offset, offset);
01971           CmtSystem::dirname (offset, offset);
01972         }
01973 
01974       cmd.replace_all (offset_template, offset);
01975 
01976 
01977       cout << "#--------------------------------------------------------------" << endl;
01978       cout << "# Now trying [" << cmd << "] in " << s << " (" << i+1 << "/" << uses.size () 
01979            << ")" << endl;
01980       cout << "#--------------------------------------------------------------" << endl;
01981 
01982       if (is_cmt)
01983         {
01984           //
01985           //  There is a bug in the recursive use of the parser. Macros are not set correctly.
01986           //  Thus the recursive optimization is now discarded.
01987           //
01988           if (parser (cmd) != 0)
01989             {
01990               CmtError::set (CmtError::execution_error, cmd);
01991               break;
01992             }
01993         }
01994       else
01995         {
01996           int status = CmtSystem::execute (cmd);
01997 
01998           //cerr << "do_broadcast> status=" << status << " ignore_errors=" << ignore_errors << endl;
01999 
02000           if (((status != 0) && !ignore_errors) || (status == 2))
02001               //if ((status != 0) && !ignore_errors)
02002             {
02003               if (status != 2) CmtError::set (CmtError::execution_error, cmd);
02004               break;
02005             }
02006         }
02007     }
02008 }

void Cmt::do_build_constituent_makefile ( const CmtSystem::cmt_string_vector & arguments,
int argc,
char * argv[]?) [static]
?

Definition at line 2011 of file cmt_parser.cxx.

Referenced by parser().

02014 {
02015   if (CmtLock::check () == CmtLock::locked_by_another_user)
02016     {
02017       CmtError::set (CmtError::conflicting_lock, "build_constituent_makefile>");
02018       return;
02019     }
02020   if (arguments.size () > 0) 
02021     {
02022       set_standard_macros ();
02023       Generator::build_constituent_makefile (arguments[0]);
02024     }
02025 }

void Cmt::do_build_constituents_makefile ( const CmtSystem::cmt_string_vector & arguments,
int argc,
char * argv[]?) [static]
?

Definition at line 2028 of file cmt_parser.cxx.

Referenced by parser().

02031 {
02032   if (CmtLock::check () == CmtLock::locked_by_another_user)
02033     {
02034       CmtError::set (CmtError::conflicting_lock, "build_constituents_makefile>");
02035       return;
02036     }
02037   set_standard_macros ();
02038   Generator::build_constituents_makefile (m_current_package);
02039 }

void Cmt::do_build_dependencies ( const CmtSystem::cmt_string_vector & arguments,
int argc,
char * argv[]?) [static]
?

Definition at line 2042 of file cmt_parser.cxx.

Referenced by parser().

02045 {
02046   if (CmtLock::check () == CmtLock::locked_by_another_user)
02047     {
02048       CmtError::set (CmtError::conflicting_lock, "build_dependencies>");
02049       return;
02050     }
02051   if (arguments.size () > 0)
02052     {
02053       set_standard_macros ();
02054 
02055       while (argc > 0)
02056         {
02057           if (strcmp (argv[0], "dependencies") != 0)
02058             {
02059               argc--;
02060               argv++;
02061             }
02062           else
02063             {
02064               argc--;
02065               argv++;
02066               argc--;
02067               argv++;
02068 
02069               Generator::build_dependencies (arguments[0], argc, argv);
02070 
02071               break;
02072             }
02073         }
02074     }
02075 }

void Cmt::do_build_library_links ( ) [static]
?

Definition at line 2078 of file cmt_parser.cxx.

Referenced by parser().

02079 {
02080   if (CmtLock::check () == CmtLock::locked_by_another_user)
02081     {
02082       CmtError::set (CmtError::conflicting_lock, "build_library_links>");
02083       return;
02084     }
02085 
02086   set_standard_macros ();
02087 
02088   Use::UsePtrVector& Uses = Use::get_ordered_uses ();
02089   Use& current_use = Use::current ();
02090   int i;
02091   cmt_string shlibsuffix;
02092   cmt_string bin;
02093   cmt_string symlinkcmd;
02094 
02095   {
02096     Symbol* macro = Symbol::find ("shlibsuffix");
02097     if (macro == 0) return;
02098     shlibsuffix = macro->build_macro_value ();
02099   }
02100 
02101   {
02102     Symbol* macro = Symbol::find ("cmt_symlink_command");
02103     if (macro != 0)
02104       {
02105         symlinkcmd = macro->build_macro_value ();
02106       }
02107   }
02108 
02109   if ((get_current_build_strategy () & InstallAreaMask) == WithInstallArea)
02110     {
02111       const CmtInstallAreaMgr& ia_mgr = CmtInstallAreaMgr::instance ();
02112       
02113       cmt_string s1 = ia_mgr.get_install_area ();
02114 
02115       {
02116         Symbol* symbol = Symbol::find ("CMTINSTALLAREA");
02117         if (symbol != 0)
02118           {
02119             s1 = symbol->build_macro_value ();
02120           }
02121       }
02122                   
02123       cmt_string s2;
02124 
02125       {
02126         Symbol* macro = Symbol::find ("tag");
02127         if (macro != 0)
02128           {
02129             s2 = macro->build_macro_value ();
02130           }
02131       }
02132 
02133       cmt_string s = s1;
02134       s += CmtSystem::file_separator ();
02135       s += s2;
02136       s += CmtSystem::file_separator ();
02137       s += "lib";
02138 
02139       CmtSystem::mkdir (s);
02140     }
02141 
02142   for (i = 0; i < Uses.size (); i++)
02143     {
02144       Use* use = Uses[i];
02145 
02146       if (use->discarded) continue;
02147 
02148       if (!use->located ())
02149         {
02150           if (!m_quiet)
02151             {
02152               cout << "# package " << use->get_package_name () <<
02153                   " " << use->version << " " << use->path << 
02154                   " not found" <<
02155                   endl;
02156             }
02157         }
02158       else
02159         {
02160           if (use->get_package_name () == "CMT") continue;
02161           if (use->get_package_name () == current_use.get_package_name ()) continue;
02162 
02163           cmt_string s;
02164 
02165           s = use->get_package_name ();
02166           s += "_libraries";
02167 
02168           Symbol* libraries_macro = Symbol::find (s);
02169 
02170           if (libraries_macro == 0) continue;
02171 
02172           cmt_string libraries = libraries_macro->build_macro_value ();
02173           static CmtSystem::cmt_string_vector values;
02174 
02175           CmtSystem::split (libraries, " \t", values);
02176 
02177           for (int j = 0; j < values.size (); j++)
02178             {
02179               const cmt_string& library = values[j];
02180 
02181               static cmt_string libname;
02182               static cmt_string name;
02183 
02184               // Is it a simple name or a complete path?
02185 
02186               libname = library;
02187               Symbol::expand (libname);
02188 
02189               if (CmtSystem::absolute_path (libname))
02190                 {
02196                   cmt_string suffix;
02197                   CmtSystem::basename (library, name);
02198                 }
02199               else
02200                 {
02207                   libname = "${";
02208                   libname += use->prefix;
02209                   libname += "ROOT}/${";
02210                   libname += use->get_package_name ();
02211                   libname += "_tag}/lib";
02212                   libname += library;
02213                   libname += ".";
02214                   libname += shlibsuffix;
02215 
02216                   name = "lib";
02217                   name += library;
02218                   name += ".";
02219                   name += shlibsuffix;
02220                 }
02221 
02222               Symbol::expand (libname);
02223 
02224               if ((get_current_build_strategy () & InstallAreaMask) == WithInstallArea)
02225                 {
02226                   const CmtInstallAreaMgr& ia_mgr = CmtInstallAreaMgr::instance ();
02227 
02228                   cmt_string s1 = ia_mgr.get_install_area ();
02229 
02230                   {
02231                     Symbol* symbol = Symbol::find ("CMTINSTALLAREA");
02232                     if (symbol != 0)
02233                       {
02234                         s1 = symbol->build_macro_value ();
02235                       }
02236                   }
02237                   
02238                   cmt_string s2;
02239 
02240                   {
02241                     Symbol* macro = Symbol::find ("tag");
02242                     if (macro != 0)
02243                       {
02244                         s2 = macro->build_macro_value ();
02245                       }
02246                   }
02247 
02248                   s = s1;
02249                   s += CmtSystem::file_separator ();
02250                   s += s2;
02251                   s += CmtSystem::file_separator ();
02252                   s += "lib";
02253                   s += CmtSystem::file_separator ();
02254                   s += name;
02255 
02256                     // Now creating the reference file
02257 
02258                   cmt_string ref_file = s;
02259                   ref_file += ".cmtref";
02260 
02261                   cmt_string text = libname;
02262                   text += "\n";
02263 
02264                   Symbol::expand (ref_file);
02265                   Symbol::expand (text);
02266 
02267                   text.write (ref_file);
02268                   if (!m_quiet) cout << "   Creating the reference file " << ref_file << endl;
02269                 }
02270               else
02271                 {
02272                   s = "../$(";
02273                   s += current_use.get_package_name ();
02274                   s += "_tag)/";
02275                   s += name;
02276                 }
02277 
02278               Symbol::expand (s);
02279 
02280               if (!m_quiet) cout << "   Symlinking " << libname << " to " << s << endl;
02281 
02282               if (symlinkcmd == "")
02283                 {
02284                   if (!CmtSystem::create_symlink (libname, s))
02285                     {
02286                       cout << "Cannot create a symbolic link to " << libname << endl;
02287                       break;
02288                     }
02289                 }
02290               else
02291                 {
02292                   cmt_string cmd = symlinkcmd;
02293                   cmd += " ";
02294                   cmd += libname;
02295                   cmd += " ";
02296                   cmd += s;
02297 
02298                   int status = CmtSystem::execute (cmd);
02299 
02300                   if (status != 0)
02301                     {
02302                       cout << "Cannot create a symbolic link to " << libname << endl;
02303                       break;
02304                     }
02305                 }
02306             }
02307         }
02308     }
02309 }

void Cmt::do_build_make_setup ( ) [static]
?

Here we expect that only the base name of the library is given : ie it should not contain the "lib" prefix, nor the suffix .so, nor any path prefix.

This of course should generally correspond to a constituent name.

Definition at line 2312 of file cmt_parser.cxx.

Referenced by parser().

02313 {
02314   if (CmtLock::check () == CmtLock::locked_by_another_user)
02315     {
02316       CmtError::set (CmtError::conflicting_lock, "build_make_setup>");
02317       return;
02318     }
02319   set_standard_macros ();
02320   Generator::build_make_setup (m_current_package);
02321 }

void Cmt::do_build_msdev ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 2324 of file cmt_parser.cxx.

Referenced by parser().

02325 {
02326   if (CmtLock::check () == CmtLock::locked_by_another_user)
02327     {
02328       CmtError::set (CmtError::conflicting_lock, "build_msdev>");
02329       return;
02330     }
02331 
02332   if (true)
02333     {
02334       set_standard_macros ();
02335       if (arguments.size () > 0) build_msdev_file (arguments[0]);
02336       else build_msdev_file ("");
02337     }
02338 }

void Cmt::do_build_os9_makefile ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 2359 of file cmt_parser.cxx.

Referenced by parser().

02360 {
02361   if (CmtLock::check () == CmtLock::locked_by_another_user)
02362     {
02363       CmtError::set (CmtError::conflicting_lock, "build_os9_makefile>");
02364       return;
02365     }
02366 
02367   if (arguments.size () > 0) 
02368     {
02369       set_standard_macros ();
02370       build_OS9_makefile (arguments[0]);
02371     }
02372 }

void Cmt::do_build_prototype ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 2375 of file cmt_parser.cxx.

Referenced by parser().

02376 {
02377   if (CmtLock::check () == CmtLock::locked_by_another_user)
02378     {
02379       CmtError::set (CmtError::conflicting_lock, "build_prototype>");
02380       return;
02381     }
02382 
02383   if (arguments.size () > 0) 
02384     {
02385       set_standard_macros ();
02386       Generator::build_prototype (arguments[0]);
02387     }
02388 }

void Cmt::do_build_readme ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 2391 of file cmt_parser.cxx.

Referenced by parser().

02392 {
02393   if (CmtLock::check () == CmtLock::locked_by_another_user)
02394     {
02395       CmtError::set (CmtError::conflicting_lock, "build_readme>");
02396       return;
02397     }
02398 
02399   set_standard_macros ();
02400   Generator::build_readme (arguments);
02401 }

void Cmt::do_build_tag_makefile ( ) [static]
?

Definition at line 2404 of file cmt_parser.cxx.

Referenced by parser().

02405 {
02406   if (CmtLock::check () == CmtLock::locked_by_another_user)
02407     {
02408       CmtError::set (CmtError::conflicting_lock, "build_tag_makefile>");
02409       return;
02410     }
02411 
02412   print_macros (Make);
02413 }

void Cmt::do_build_temporary_name ( ) [static]
?

Definition at line 2416 of file cmt_parser.cxx.

Referenced by parser().

02417 {
02418   cmt_string name = CmtSystem::get_temporary_name ();
02419   cout << name << endl;
02420 }

void Cmt::do_build_triggers ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 2423 of file cmt_parser.cxx.

Referenced by parser().

02424 {
02425   if (CmtLock::check () == CmtLock::locked_by_another_user)
02426     {
02427       CmtError::set (CmtError::conflicting_lock, "build_tag_makefile>");
02428       return;
02429     }
02430 
02431   if (arguments.size () > 0) 
02432     {
02433       set_standard_macros ();
02434       TriggerGenerator::run (arguments[0]);
02435     }
02436 }

void Cmt::do_build_vsnet ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 2342 of file cmt_parser.cxx.

Referenced by parser().

02343 {                                                                            
02344   if (CmtLock::check () == CmtLock::locked_by_another_user)                  
02345     {                                                                        
02346       CmtError::set (CmtError::conflicting_lock, "build_vsnet>");            
02347       return;                                                                
02348     }                                                                        
02349                                                                              
02350   if (true)                                                                  
02351     {                                                                        
02352       set_standard_macros ();                                                
02353       if (arguments.size () > 0) build_vsnet_file (arguments[0]);            
02354       else build_vsnet_file ("");                                            
02355     }                                                                        
02356 }

void Cmt::do_build_windefs ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 2439 of file cmt_parser.cxx.

Referenced by parser().

02440 {
02441   if (CmtLock::check () == CmtLock::locked_by_another_user)
02442     {
02443       CmtError::set (CmtError::conflicting_lock, "build_windefs>");
02444       return;
02445     }
02446 
02447   if (arguments.size () > 0) 
02448     {
02449       set_standard_macros ();
02450       Generator::build_windefs (arguments[0]);
02451     }
02452 }

void Cmt::do_check_configuration ( ) [static]
?

Definition at line 2455 of file cmt_parser.cxx.

Referenced by parser().

02456 {
02457 }

void Cmt::do_check_files ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 2460 of file cmt_parser.cxx.

Referenced by parser().

02461 {
02462   if (arguments.size () >= 2) 
02463     {
02464       cmt_string first_file = arguments[0];
02465       cmt_string second_file = arguments[1];
02466           
02467       if (first_file == "") return;
02468       if (second_file == "") return;
02469           
02470       CmtSystem::compare_and_update_files (first_file, second_file);
02471     }
02472 }

void Cmt::do_check_version ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 2475 of file cmt_parser.cxx.

Referenced by parser().

02476 {
02477   if (arguments.size () > 0)
02478     {
02479       cmt_string name = arguments[0];
02480           
02481       if (name == "") return;
02482       int v = 0;
02483       int r = 0;
02484       int p = 0;
02485           
02486       bool ok = CmtSystem::is_version_directory (name, v, r, p);
02487           
02488       if (ok)
02489         {
02490           cout << "# " << name << " is version " << v << " release " << r << " patch " << p << endl;
02491         }
02492       else
02493         {
02494           cout << "# " << name << " is not a version tag" << endl;
02495         }
02496     }
02497 }

void Cmt::do_checkout ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 2500 of file cmt_parser.cxx.

Referenced by parser().

02501 {
02502   Cvs::checkout (arguments);
02503 }

void Cmt::do_cleanup ( PrintMode & mode?) [static]
?

Definition at line 2506 of file cmt_parser.cxx.

Referenced by parser().

02507 {
02508   print_clean (mode);
02509 }

void Cmt::do_config ( ) [static]
?

Definition at line 2512 of file cmt_parser.cxx.

Referenced by do_create(), and parser().

02513 {
02514   if (CmtLock::check () == CmtLock::locked_by_another_user)
02515     {
02516       CmtError::set (CmtError::conflicting_lock, "config>");
02517       return;
02518     }
02519 
02520     //Use::UsePtrVector& Uses = Use::get_ordered_uses ();
02521 
02522   if (m_debug)
02523     {
02524       cout << "Cmt::do_config> " << endl;
02525       cout << "pwd " << CmtSystem::pwd () << endl;
02526       cout << "current_dir " << m_current_dir << endl;
02527       cout << "default_path " << m_default_path << endl;
02528       cout << "cmt config " <<
02529           m_current_package << " " <<
02530           m_current_version << " " <<
02531           m_current_path << endl;
02532     }
02533 
02534   if (m_current_package == "CMT") return;
02535   if (m_current_package == "methods") return;
02536 
02537   cmt_string branch;
02538 
02539   CmtSystem::basename (m_current_dir, branch);
02540 
02541   if ((branch != "mgr") && (branch != "cmt"))
02542     {
02543 
02544         //
02545         // Here we are in a standalone package (ie completely unstructured)
02546         //
02547 
02548       if (CmtSystem::test_file ("requirements"))
02549         {
02550           cout << "------------------------------------------" << endl;
02551           cout << "Configuring environment for standalone package." << endl;
02552           cout << "CMT version " << m_cmt_version << "." << endl;
02553           cout << "System is " << m_cmt_config << endl;
02554           cout << "------------------------------------------" << endl;
02555 
02556           install_test_setup_scripts ();
02557           install_test_cleanup_scripts ();
02558 
02559           Generator::build_default_makefile ();
02560         }
02561       else
02562         {
02563           cout << "==============================================" << endl;
02564           cout << "cmt config must be operated either upon "
02565             "an existing package" << endl;
02566           cout << " (ie. when a requirements file already exists)" << endl;
02567           cout << "   > cd ..." << endl;
02568           cout << "   > cmt config" << endl;
02569           cout << "or to create a new package" << endl;
02570           cout << "   > cmt config   []" << endl;
02571           cout << "==============================================" << endl;
02572         }
02573 
02574       return;
02575     }
02576 
02577   configure_current_package ();
02578 
02579   Generator::build_default_makefile ();
02580 
02581   CmtSystem::cmt_string_vector makes;
02582   cmt_regexp expression ("[.]n?make(sav)?$");
02583 
02584   CmtSystem::scan_dir (".", expression, makes);
02585 
02586   if (makes.size () > 0)
02587     {
02588       cout << "Removing all previous make fragments from " << branch << endl;
02589 
02590       for (int i = 0; i < makes.size (); i++)
02591         {
02592           const cmt_string& s = makes[i];
02593           CmtSystem::remove_file (s);
02594         }
02595     }
02596 
02597   CmtSystem::cd ("..");
02598 
02599   CmtSystem::scan_dir (m_cmt_config, expression, makes); 
02600     
02601   if (makes.size () > 0) 
02602     {
02603       cout << "Removing all previous make fragments from "
02604            << m_cmt_config << endl; 
02605 
02606       for (int i = 0; i < makes.size (); i++) 
02607         { 
02608           const cmt_string& s = makes[i]; 
02609           CmtSystem::remove_file (s); 
02610         }    
02611     } 
02612 
02613   // cout << "Try a cleanup of the installation area " << endl;
02614 
02615     //
02616     //  Try a cleanup of the installation area
02617     //
02618   if ((get_current_build_strategy () & InstallAreaMask) == WithInstallArea)
02619     {
02620       CmtInstallAreaMgr& ia_mgr = CmtInstallAreaMgr::instance ();
02621 
02622       if ((get_current_setup_strategy () & SetupCleanupMask) == SetupCleanup)
02623         {
02624           ia_mgr.config ();
02625         }
02626     }
02627 
02628   CmtSystem::cd (branch); 
02629 
02630   Use& use = Use::current ();
02631 
02632   use.set (m_current_package,
02633            m_current_version,
02634            m_current_path,
02635            "",
02636            "");
02637 
02638   use.change_path (m_current_path);
02639   use.style     = m_current_style;
02640 
02641   //cout << "do_config> current style=" << m_current_style << endl;
02642 
02643   if (!reach_current_package ())
02644     {
02645       cout << "Cannot read the requirements file" << endl;
02646       return;
02647     }
02648 
02649   install_setup_scripts ();
02650   install_cleanup_scripts ();
02651 
02652   CmtSystem::cd ("..");
02653 
02654   Branch::BranchVector& branches = Branch::branches ();
02655 
02656   int i;
02657 
02658   for (i = 0; i < branches.size (); i++)
02659     {
02660       const Branch& branch = branches[i];
02661       const cmt_string& branch_name = branch.name ();
02662 
02663       if (!CmtSystem::test_directory (branch_name))
02664         {
02665           if (!CmtSystem::mkdir (branch_name))
02666             {
02667               cout << "Cannot create the " << branch_name <<" branch" << endl;
02668             }
02669           else
02670             {
02671               cout << "Installing the " << branch_name << " directory" << endl;
02672             }
02673         }
02674       else
02675         {
02676           cout << branch_name << " directory already installed" << endl;
02677         }
02678     }
02679 }

void Cmt::do_create ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 2682 of file cmt_parser.cxx.

Referenced by parser().

02683 {
02684   if (arguments.size () < 2) return;
02685 
02686   const cmt_string& package = arguments[0];
02687   const cmt_string& version = arguments[1];
02688   cmt_string offset;
02689   if (arguments.size () >= 3) offset = arguments[2];
02690 
02691   if (m_debug)
02692     {
02693       cout << "do_create>m_current_package=" << m_current_package << endl;
02694       cout << "do_create>package=" << package << endl;
02695     }
02696 
02697     //if (m_current_package == "CMT") return;
02698     //if (m_current_package == "methods") return;
02699 
02700   cmt_string the_path;
02701 
02702   the_path = CmtSystem::pwd ();
02703 
02704   if (offset != "")
02705     {
02706       if (!CmtSystem::absolute_path (offset))
02707         {
02708           // offset is really a relative offset
02709           the_path += CmtSystem::file_separator ();
02710           the_path += offset;
02711         }
02712       else // absolute path
02713         {
02714           the_path = offset;
02715         }
02716     }
02717 
02718   CmtSystem::compress_path (the_path);
02719 
02720   // Now 'the_path' contains the complete path where the package will be created
02721 
02722   cout << "------------------------------------------" << endl;
02723   cout << "Configuring environment for package " << package <<
02724     " version " << version << "." << endl;
02725   cout << "CMT version " << m_cmt_version << "." << endl;
02726   cout << "Root set to " << the_path << "." << endl;
02727   cout << "System is " << m_cmt_config << endl;
02728   cout << "------------------------------------------" << endl;
02729 
02730   if (!CmtSystem::test_directory (the_path))
02731     {
02732       if (!CmtSystem::mkdir (the_path))
02733         {
02734           cout << "Cannot create the path directory" << endl;
02735           return;
02736         }
02737       else
02738         {
02739           cout << "Installing the path directory" << endl;
02740         }
02741     }
02742 
02743   CmtSystem::cd (the_path);
02744 
02745   if (!CmtSystem::test_directory (package))
02746     {
02747       if (!CmtSystem::mkdir (package))
02748         {
02749           cout << "Cannot create the package directory" << endl;
02750           return;
02751         }
02752       else
02753         {
02754           cout << "Installing the package directory" << endl;
02755         }
02756     }
02757   else
02758     {
02759       cout << "Package directory already installed" << endl;
02760     }
02761 
02762   CmtSystem::cd (package);
02763 
02764   if (m_current_structuring_style == with_version_directory)
02765     {
02766       if (!CmtSystem::test_directory (version))
02767         {
02768           if (!CmtSystem::mkdir (version))
02769             {
02770               cout << "Cannot create the version directory" << endl;
02771               return;
02772             }
02773           else
02774             {
02775               cout << "Installing the version directory" << endl;
02776             }
02777         }
02778       else
02779         {
02780           cout << "Version directory already installed" << endl;
02781         }
02782 
02783       CmtSystem::cd (version);
02784     }
02785   else
02786     {
02787       cout << "Version directory will not be created due to structuring style" << endl;
02788     }
02789 
02790   if (!CmtSystem::test_directory ("cmt"))
02791     {
02792       if (!CmtSystem::test_directory ("mgr"))
02793         {
02794           if (!CmtSystem::mkdir ("cmt"))
02795             {
02796               cout << "Cannot create the cmt directory" << endl;
02797               return;
02798             }
02799           else
02800             {
02801               if (m_current_structuring_style == with_version_directory)
02802                 {
02803                   m_current_style = cmt_style;
02804                 }
02805               else
02806                 {
02807                   m_current_style = no_version_style;
02808                 }
02809 
02810               cout << "Installing the cmt directory" << endl;
02811             }
02812         }
02813       else
02814         {
02815           if (m_current_structuring_style == with_version_directory)
02816             {
02817               m_current_style = mgr_style;
02818             }
02819           else
02820             {
02821               m_current_style = no_version_style;
02822             }
02823           
02824           cout << "Mgr directory already installed" << endl;
02825         }
02826     }
02827   else
02828     {
02829       if (m_current_structuring_style == with_version_directory)
02830         {
02831           m_current_style = cmt_style;
02832         }
02833       else
02834         {
02835           m_current_style = no_version_style;
02836         }
02837 
02838       cout << "Cmt directory already installed" << endl;
02839     }
02840 
02841   if (!CmtSystem::test_directory ("src"))
02842     {
02843       if (!CmtSystem::mkdir ("src"))
02844         {
02845           cout << "Cannot create the src directory" << endl;
02846           return;
02847         }
02848       else
02849         {
02850           cout << "Installing the src directory" << endl;
02851         }
02852     }
02853   else
02854     {
02855       cout << "src directory already installed" << endl;
02856     }
02857 
02858   switch (m_current_style)
02859     {
02860     case cmt_style:
02861     case no_version_style:
02862       CmtSystem::cd ("cmt");
02863       break;
02864     case mgr_style:
02865       CmtSystem::cd ("mgr");
02866       break;
02867     }
02868 
02869   Generator::build_default_makefile ();
02870 
02871   if (!CmtSystem::test_file ("requirements"))
02872     {
02873       // create an empty requirement file.
02874       ofstream f ("requirements");
02875       if (f)
02876         {
02877           f << "package " << package << endl;
02878           f << endl;
02879           f.close ();
02880         }
02881     }
02882 
02883   if (m_current_structuring_style == without_version_directory)
02884     {
02885       ofstream f ("version.cmt");
02886       if (f)
02887         {
02888           f << version << endl;
02889           f.close ();
02890         }
02891     }
02892 
02893   m_current_package = package;
02894   m_current_version = version;
02895   m_current_path    = the_path;
02896   m_current_dir     = CmtSystem::pwd ();
02897 
02898   do_config ();
02899 }

void Cmt::do_cvsbranches ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 2902 of file cmt_parser.cxx.

Referenced by parser().

02903 {
02904   Cvs::branches (arguments[0]);
02905 }

void Cmt::do_cvssubpackages ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 2908 of file cmt_parser.cxx.

Referenced by parser().

02909 {
02910   Cvs::subpackages (arguments[0]);
02911 }

void Cmt::do_cvstags ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 2914 of file cmt_parser.cxx.

Referenced by parser().

02915 {
02916   Cvs::tags (arguments);
02917 }

void Cmt::do_expand_model ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 2920 of file cmt_parser.cxx.

Referenced by parser().

02921 {
02922   set_standard_macros ();
02923   CmtModel::expand (arguments[0]);
02924 }

void Cmt::do_filter ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Handle free filtering of text files containing or ${xxx} patterns.

Substitution is performed against CMT macros and environment variables.

Arguments:

cmt filter input-file-name output-file-name

Definition at line 2936 of file cmt_parser.cxx.

Referenced by parser().

02937 {
02938   if (arguments.size () < 2) return;
02939 
02940   cmt_string& input = arguments[0];
02941   cmt_string& output = arguments[1];
02942 
02943   if (!CmtSystem::test_file (input))
02944     {
02945       cout << "#CMT> File " << input << " not found" << endl;
02946       return;
02947     }
02948 
02949   cmt_string text;
02950 
02951   text.read (input);
02952 
02953   set_standard_macros ();
02954 
02955   Symbol::expand (text);
02956 
02957   FILE* file = fopen (output, "wb");
02958   if (file == NULL)
02959     {
02960       cout << "#CMT> Cannot write filtered file " << output << endl;
02961     }
02962   else
02963     {
02964       text.write (file);
02965       fclose (file);
02966     }
02967 }

void Cmt::do_help ( ActionType help_action = action_none?) [static]
?

Definition at line 2970 of file cmt_parser.cxx.

Referenced by parser().

02971 {
02972   if (help_action == action_none)
02973     {
02974       CommandParser::show_all ();
02975     }
02976   else
02977     {
02978       CommandParser::show (help_action);
02979     }
02980 }

void Cmt::do_lock ( const cmt_string & package,
const cmt_string & version,
const cmt_string & path?) [static]
?

Definition at line 2983 of file cmt_parser.cxx.

Referenced by parser().

02986 {
02987   //(unsused) Use& use = Use::current();
02988 
02989   cout << "try to lock package " << package << " in " << CmtSystem::pwd () << endl;
02990 
02991   set_standard_macros ();
02992 
02993   CmtLock::status status = CmtLock::lock ();
02994 }

void Cmt::do_remove ( const cmt_string & package,
const cmt_string & version,
const cmt_string & path?) [static]
?

Definition at line 2997 of file cmt_parser.cxx.

Referenced by parser().

03000 {
03001     //Use::UsePtrVector& Uses = Use::get_ordered_uses ();
03002 
03003   if (m_current_package == "CMT") return;
03004   if (m_current_package == "methods") return;
03005 
03006   cmt_string the_path;
03007 
03008   //the_path = m_default_path;
03009   the_path = CmtSystem::pwd ();
03010 
03011   if (path != "")
03012     {
03013       if (!CmtSystem::absolute_path (path))
03014         {
03015           // path is just a suffix
03016           the_path += CmtSystem::file_separator ();
03017           the_path += path;
03018         }
03019       else // absolute path
03020         {
03021           the_path = path;
03022         }
03023     }
03024 
03025   CmtSystem::compress_path (the_path);
03026 
03027   cout << "------------------------------------------" << endl;
03028   cout << "Removing package " << package <<
03029     " version " << version << "." << endl;
03030   cout << "CMT version " << m_cmt_version << "." << endl;
03031   cout << "Root set to " << the_path << "." << endl;
03032   cout << "System is " << m_cmt_config << endl;
03033   cout << "------------------------------------------" << endl;
03034 
03035   the_path += CmtSystem::file_separator ();
03036   the_path += package;
03037 
03038   if (!CmtSystem::cd (the_path))
03039     {
03040       cout << "Path " << the_path << " not reachable" << endl;
03041       return;
03042     }
03043 
03044   if (CmtSystem::test_directory (version))
03045     {
03046       if (CmtSystem::remove_directory (version))
03047         {
03048           cout << "Version " << version << " has been removed from " << the_path << endl;
03049           CmtSystem::cmt_string_vector contents;
03050           CmtSystem::scan_dir (".", contents);
03051           if (contents.size () == 0)
03052             {
03053               CmtSystem::cd ("..");
03054               if (CmtSystem::remove_directory (package))
03055                 {
03056                   cout << "Package " << package << " has no more versions. Thus it has been removed."<< endl;
03057                 }
03058             }
03059         }
03060       else
03061         {
03062           cout << "Impossible to remove version " << version << " from " << the_path << endl;
03063         }
03064     }
03065   else if (CmtSystem::test_directory ("cmt"))
03066     {
03067       CmtSystem::cd ("cmt");
03068 
03069       cmt_string v;
03070 
03071       v.read ("version.cmt");
03072       if (v == version)
03073         {
03074           CmtSystem::cd ("..");
03075           if (!CmtSystem::remove_directory ("cmt"))
03076             {
03077               cout << "Unstructured version " << version
03078                    << " has been removed from " << the_path << endl;
03079             }
03080           else
03081             {
03082               cout << "Impossible to remove unstructured version " << version
03083                    << " from " << the_path << endl;
03084             }
03085         }
03086       else
03087         {
03088           cout << "Version " << version << " not found" << endl;
03089         }
03090     }
03091   else
03092     {
03093       cout << "Version " << version << " not found" << endl;
03094     }
03095 }

void Cmt::do_remove_library_links ( ) [static]
?

Definition at line 3098 of file cmt_parser.cxx.

Referenced by parser().

03099 {
03100   if (CmtLock::check () == CmtLock::locked_by_another_user)
03101     {
03102       CmtError::set (CmtError::conflicting_lock, "remove_library_links>");
03103       return;
03104     }
03105 
03106   set_standard_macros ();
03107 
03108   Use::UsePtrVector& Uses = Use::get_ordered_uses ();
03109   Use& current_use = Use::current ();
03110   int i;
03111   cmt_string shlibsuffix;
03112   cmt_string symunlink;
03113 
03114   {
03115     Symbol* macro = Symbol::find ("shlibsuffix");
03116     if (macro == 0) return;
03117     shlibsuffix = macro->build_macro_value ();
03118   }
03119 
03120   {
03121     Symbol* macro = Symbol::find ("symunlink");
03122     if (macro == 0) return;
03123     symunlink = macro->build_macro_value ();
03124   }
03125 
03126   for (i = 0; i < Uses.size (); i++)
03127     {
03128       Use* use = Uses[i];
03129 
03130       if (use->discarded) continue;
03131 
03132       if (!use->located ())
03133         {
03134           if (!m_quiet)
03135             {
03136               cout << "# package " << use->get_package_name () <<
03137                   " " << use->version << " " << use->path << 
03138                   " not found" <<
03139                   endl;
03140             }
03141         }
03142       else
03143         {
03144           if (use->get_package_name () == "CMT") continue;
03145           if (use->get_package_name () == current_use.get_package_name ()) continue;
03146 
03147           cmt_string s;
03148 
03149           s = use->get_package_name ();
03150           s += "_libraries";
03151 
03152           Symbol* libraries_macro = Symbol::find (s);
03153 
03154           if (libraries_macro == 0) continue;
03155 
03156           cmt_string libraries = libraries_macro->build_macro_value ();
03157           static CmtSystem::cmt_string_vector values;
03158 
03159           CmtSystem::split (libraries, " \t", values);
03160 
03161           for (int j = 0; j < values.size (); j++)
03162             {
03163               const cmt_string& library = values[j];
03164 
03165               static cmt_string libname;
03166               static cmt_string name;
03167 
03168               // Is it a simple name or a complete path?
03169 
03170               libname = library;
03171               Symbol::expand (libname);
03172 
03173               if (CmtSystem::absolute_path (libname))
03174                 {
03180                   cmt_string suffix;
03181                   CmtSystem::basename (library, name);
03182                 }
03183               else
03184                 {
03192                   name = "lib";
03193                   name += libname;
03194                   name += ".";
03195                   name += shlibsuffix;
03196                 }
03197 
03198               Symbol::expand (libname);
03199 
03200               if ((get_current_build_strategy () & InstallAreaMask) == WithInstallArea)
03201                 {
03202                   const CmtInstallAreaMgr& ia_mgr = CmtInstallAreaMgr::instance ();
03203 
03204                   cmt_string s1 = ia_mgr.get_install_area ();
03205 
03206                   {
03207                     Symbol* symbol = Symbol::find ("CMTINSTALLAREA");
03208                     if (symbol != 0)
03209                       {
03210                         s1 = symbol->build_macro_value ();
03211                       }
03212                   }
03213                   
03214                   cmt_string s2;
03215 
03216                   {
03217                     Symbol* macro = Symbol::find ("tag");
03218                     if (macro != 0)
03219                       {
03220                         s2 = macro->build_macro_value ();
03221                       }
03222                   }
03223 
03224                     // Now deleting the reference file
03225 
03226                   s = symunlink;
03227                   s += " ";
03228                   s += s1;
03229                   s += CmtSystem::file_separator ();
03230                   s += s2;
03231                   s += CmtSystem::file_separator ();
03232                   s += "lib";
03233                   s += CmtSystem::file_separator ();
03234                   s += name;
03235                   s += ".cmtref";
03236                   s += " ";
03237                   s += s1;
03238                   s += CmtSystem::file_separator ();
03239                   s += s2;
03240                   s += CmtSystem::file_separator ();
03241                   s += "lib";
03242                   s += CmtSystem::file_separator ();
03243                   s += name;
03244                 }
03245               else
03246                 {
03247                   s = symunlink;
03248                   s += " ../$(";
03249                   s += current_use.get_package_name ();
03250                   s += "_tag)/";
03251                   s += name;
03252                 }
03253 
03254               Symbol::expand (s);
03255 
03256               if (!m_quiet) cout << s << endl;
03257               int status = CmtSystem::execute (s);
03258 
03259               if (status != 0)
03260                 {
03261                   if (status != 2) CmtError::set (CmtError::execution_error, s);
03262 
03263                   cout << "Cannot remove the symbolic link " << s << endl;
03264 
03265                   break;
03266                 }
03267             }
03268         }
03269     }
03270 }

void Cmt::do_run ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Here we expect that only the base name of the library is given : ie it should not contain the "lib" prefix, nor the suffix .so, nor any path prefix.

This of course should generally correspond to a constituent name.

Definition at line 3273 of file cmt_parser.cxx.

Referenced by parser().

03274 {
03275   if (arguments.size () > 0) 
03276     {
03277       set_standard_macros ();
03278       Symbol::all_set ();
03279       CmtSystem::execute (arguments[0]);
03280     }
03281 }

void Cmt::do_run_sequence ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 3284 of file cmt_parser.cxx.

Referenced by parser().

03285 {
03286   if (arguments.size () == 0) cout << "# cmt run_sequence: no sequence specified" << endl;
03287 
03288   SequenceRunner runner;
03289 
03290   cout << "# cmt run_sequence: sequence " << arguments[0] << endl;
03291 
03292   runner.run (arguments[0]);
03293 }

void Cmt::do_set_version ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 3296 of file cmt_parser.cxx.

Referenced by parser().

03297 {
03298   if (arguments.size () == 0) cout << "# cmt set version: no version specified" << endl;
03299 
03300   const cmt_string& version = arguments[0];
03301 
03302   int v, r, p;
03303 
03304   if (!CmtSystem::is_version_directory (version, v, r, p))
03305     {
03306       cout << "# cmt set version " << version << " is not a correct version syntax" << endl;
03307       return;
03308     }
03309 
03310   if ((v == -1) || (r == -1) || (p == -1))
03311     {
03312       cout << "# cmt set version " << version
03313            << " You cannot use wild card to set a version" << endl;
03314       return;
03315     }
03316 
03317   // We want to install the version.cmt file
03318 
03319   // We first check we are in a cmt branch
03320   cmt_string h = CmtSystem::pwd ();
03321   cmt_string branch;
03322   CmtSystem::basename (h, branch);
03323 
03324   if (branch != "cmt")
03325     {
03326       cout << "# cmt set version " << version << " must be applied in a cmt directory" 
03327            << endl;
03328       return;
03329     }
03330 
03331   CmtSystem::dirname (h, h);
03332   CmtSystem::basename (h, branch);
03333 
03334   if (branch == version)
03335     {
03336       cout << "# cmt set version " << version << " is already available as a version directory" 
03337            << endl;
03338       return;
03339     }
03340 
03341   cout << "Writing version file : " << version << endl;
03342 
03343   version.write ("version.cmt");
03344 }

void Cmt::do_set_versions ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 3347 of file cmt_parser.cxx.

Referenced by parser().

03348 {
03349   CmtSystem::cmt_string_vector args;
03350 
03351   args = arguments;
03352   {
03353     cmt_string& s = args.add ();
03354     s = "cmt";
03355   }
03356   {
03357     cmt_string& s = args.add ();
03358     s = "set";
03359   }
03360   {
03361     cmt_string& s = args.add ();
03362     s = "version";
03363   }
03364   {
03365     cmt_string& s = args.add ();
03366     s = "";
03367   }
03368 
03369   m_action = action_broadcast;
03370 
03371   do_broadcast (args, 0, 0);
03372 }

void Cmt::do_setup ( PrintMode & mode?) [static]
?

Definition at line 3375 of file cmt_parser.cxx.

Referenced by parser().

03376 {
03377   print (mode);
03378 
03379     //
03380     //  Try a cleanup of the installation area
03381     //
03382   if ((get_current_build_strategy () & InstallAreaMask) == WithInstallArea)
03383     {
03384       CmtInstallAreaMgr& ia_mgr = CmtInstallAreaMgr::instance ();
03385 
03386       if ((get_current_setup_strategy () & SetupCleanupMask) == SetupCleanup)
03387         {
03388           const cmt_string& installarea = ia_mgr.get_install_area ();
03389 
03390           if (installarea != "")
03391             {
03392               cmt_string q;
03393               
03394               switch (mode)
03395                 {
03396                 case Sh :
03397                 case Csh :
03398                   q = "\'";
03399                   break;
03400                 default :
03401                   break;
03402                 }
03403               
03404               if (!m_quiet)
03405                 {
03406                   cout << "echo "  << q 
03407                        << "# Doing cleanup in the installation area " << installarea 
03408                        << q << endl;
03409                 }
03410             }
03411 
03412           ia_mgr.config ();
03413         }
03414     }
03415 }

void Cmt::do_show_all_tags ( ) [static]
?

Definition at line 3418 of file cmt_parser.cxx.

Referenced by parser().

03419 {
03420   Tag::TagPtrVector tags = Tag::tags ();
03421   int index;
03422 
03423   set_standard_macros ();
03424 
03425   for (index = 0; index < tags.size (); index++)
03426     {
03427       const Tag* tag = tags[index];
03428       if (tag != 0)
03429         {
03430           tag->show_definition (true);
03431         }
03432     }
03433 }

void Cmt::do_show_applied_patterns ( ) [static]
?

Definition at line 3436 of file cmt_parser.cxx.

Referenced by parser().

03437 {
03438   Pattern::show_all_applied_patterns ();
03439 }

void Cmt::do_show_author ( ) [static]
?

Definition at line 3442 of file cmt_parser.cxx.

Referenced by parser().

03443 {
03444   Use& use = Use::current();
03445 
03446   cout << use.author << endl;
03447 }

void Cmt::do_show_branches ( PrintMode & mode?) [static]
?

Definition at line 3450 of file cmt_parser.cxx.

Referenced by parser().

03451 {
03452   Branch::print_all (mode);
03453 }

void Cmt::do_show_clients ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 3456 of file cmt_parser.cxx.

Referenced by parser().

03457 {
03458   cmt_string package;
03459   cmt_string version;
03460   cmt_string path_name;
03461 
03462   if (arguments.size () >= 1) package = arguments[0];
03463   if (arguments.size () >= 2) version = arguments[1];
03464   if (arguments.size () >= 3) path_name = arguments[2];
03465 
03466   FileScanner scanner;
03467   PackageCollector collector (package, version);
03468 
03469   clear ();
03470   configure ();
03471 
03472   cout << "# ----------- Clients of " << package <<
03473     " " << version <<
03474     " " << path_name <<
03475     endl;
03476 
03477   if (path_name == "")
03478     {
03479       int path_index;
03480 
03481       for (path_index = 0; path_index < m_cmt_path.size (); path_index++)
03482         {
03483           const cmt_string& path = m_cmt_path[path_index];
03484 
03485           scanner.scan_path (path, collector);
03486         }
03487     }
03488   else
03489     {
03490       scanner.scan_path (path_name, collector);
03491     }
03492   cout << "# ----------- " << collector.count () << " clients found." << endl;
03493 }

void Cmt::do_show_cmtpath_patterns ( ) [static]
?

Definition at line 3496 of file cmt_parser.cxx.

Referenced by parser().

03497 {
03498   set_standard_macros ();
03499   CmtPathPattern::show_all ();
03500 }

void Cmt::do_show_constituent ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 3503 of file cmt_parser.cxx.

Referenced by parser().

03504 {
03505   if (arguments.size () > 0) 
03506     {
03507       set_standard_macros ();
03508       Constituent::show (arguments[0]);
03509     }
03510 }

void Cmt::do_show_constituent_names ( ) [static]
?

Definition at line 3513 of file cmt_parser.cxx.

Referenced by parser().

03514 {
03515   set_standard_macros ();
03516   Constituent::show_names ();
03517 }

void Cmt::do_show_constituents ( ) [static]
?

Definition at line 3520 of file cmt_parser.cxx.

Referenced by parser().

03521 {
03522   set_standard_macros ();
03523   Constituent::show_all ();
03524 }

void Cmt::do_show_cycles ( ) [static]
?

Definition at line 3527 of file cmt_parser.cxx.

Referenced by parser().

03528 {
03529   set_standard_macros ();
03530   Use& use = Use::current();
03531 
03532   use.show_cycles ();
03533 }

void Cmt::do_show_fragment ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 3536 of file cmt_parser.cxx.

Referenced by parser().

03537 {
03538   if (arguments.size () > 0) Fragment::show (arguments[0]);
03539 }

void Cmt::do_show_fragments ( ) [static]
?

Definition at line 3542 of file cmt_parser.cxx.

Referenced by parser().

03543 {
03544   Fragment::show_all ();
03545 }

void Cmt::do_show_groups ( ) [static]
?

Definition at line 3548 of file cmt_parser.cxx.

Referenced by parser().

03549 {
03550   Group::show_all ();
03551 }

void Cmt::do_show_include_dirs ( ) [static]
?

Definition at line 3554 of file cmt_parser.cxx.

Referenced by parser().

03555 {
03556   cmt_string temp;
03557 
03558   Use& use = Use::current();
03559 
03560   set_standard_macros ();
03561 
03562   if (use.include_path == "")
03563     {
03564       temp += "$(src) ";
03565     }
03566   else if (use.include_path != "none")
03567     {
03568       temp += use.include_path;
03569       temp += " ";
03570     }
03571 
03572   for (int include_number = 0;
03573        include_number < use.includes.size ();
03574        include_number++)
03575     {
03576       Include& incl = use.includes[include_number];
03577       
03578       temp += incl.name;
03579       temp += " ";
03580     }
03581 
03582   cout << temp << endl;
03583 }

void Cmt::do_show_language ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 3586 of file cmt_parser.cxx.

Referenced by parser().

03587 {
03588   if (arguments.size () > 0) 
03589     {
03590       set_standard_macros ();
03591       Language::show (arguments[0]);
03592     }
03593 }

void Cmt::do_show_languages ( ) [static]
?

Definition at line 3596 of file cmt_parser.cxx.

Referenced by parser().

03597 {
03598   set_standard_macros ();
03599   Language::show_all ();
03600 }

void Cmt::do_show_macro ( const CmtSystem::cmt_string_vector & arguments,
PrintMode & mode?) [static]
?

Definition at line 3603 of file cmt_parser.cxx.

Referenced by do_show_macro_value(), do_show_set(), do_show_set_value(), and parser().

03605 {
03606   cmt_string target;
03607 
03608   if (arguments.size () > 0) target = arguments[0];
03609 
03610   Symbol* symbol;
03611 
03612   set_standard_macros ();
03613 
03614   symbol = Symbol::find (target);
03615 
03616   if (symbol == 0) 
03617     {
03618       cmt_string t = " ";
03619       t += target;
03620       t += " is not defined ";
03621 
03622       CmtError::set (CmtError::symbol_not_found, t);
03623 
03624       return;
03625     }
03626   else
03627     {
03628       cmt_string t = target;
03629       t += " is a ";
03630 
03631       if ((m_action == action_show_macro) ||
03632           (m_action == action_show_macro_value))
03633         {
03634           if ((symbol->command != CommandMacro) &&
03635               (symbol->command != CommandMacroAppend) &&
03636               (symbol->command != CommandMacroPrepend) &&
03637               (symbol->command != CommandMacroRemove) &&
03638               (symbol->command != CommandMacroRemoveAll))
03639             {
03640               t += "set";
03641 
03642               CmtError::set (CmtError::warning, t);
03643             }
03644         }
03645       else if ((m_action == action_show_set) ||
03646                (m_action == action_show_set_value))
03647         {
03648           if ((symbol->command != CommandSet) &&
03649               (symbol->command != CommandSetAppend) &&
03650               (symbol->command != CommandSetPrepend) &&
03651               (symbol->command != CommandSetRemove) &&
03652               (symbol->command != CommandPath) &&
03653               (symbol->command != CommandPathAppend) &&
03654               (symbol->command != CommandPathPrepend) &&
03655               (symbol->command != CommandPathRemove))
03656             {
03657               t += "macro";
03658 
03659               CmtError::set (CmtError::warning, t);
03660             }
03661         }
03662     }
03663 
03664   if (symbol->value_lists.size () < 1) return;
03665 
03666   symbol->show_macro (mode);
03667 }

void Cmt::do_show_macro_names ( const CmtSystem::cmt_string_vector & arguments,
PrintMode & mode?) [static]
?

Definition at line 3670 of file cmt_parser.cxx.

Referenced by parser().

03672 {
03673   if (arguments.size () > 0)
03674     {
03675       const cmt_string& pattern = arguments[0];
03676       print_symbol_names (mode, pattern);
03677     }
03678   else
03679     {
03680       print_symbol_names (mode);
03681     }
03682 }

void Cmt::do_show_macro_value ( const CmtSystem::cmt_string_vector & arguments,
PrintMode & mode?) [static]
?

Definition at line 3685 of file cmt_parser.cxx.

Referenced by parser().

03687 {
03688   do_show_macro (arguments, mode);
03689 }

void Cmt::do_show_macros ( const CmtSystem::cmt_string_vector & arguments,
PrintMode & mode?) [static]
?

Definition at line 3692 of file cmt_parser.cxx.

Referenced by parser().

03694 {
03695   if (arguments.size () > 0)
03696     {
03697       const cmt_string& pattern = arguments[0];
03698       print_macros (mode, pattern);
03699     }
03700   else
03701     {
03702       print_macros (mode);
03703     }
03704 }

void Cmt::do_show_manager ( ) [static]
?

Definition at line 3707 of file cmt_parser.cxx.

Referenced by parser().

03708 {
03709   Use& use = Use::current();
03710 
03711   cout << use.manager << endl;
03712 }

void Cmt::do_show_packages ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 3715 of file cmt_parser.cxx.

Referenced by parser().

03716 {
03717   cmt_string path_name;
03718 
03719   if (arguments.size () > 0) path_name = arguments[0];
03720 
03721   FileScanner scanner;
03722   PackageViewer viewer;
03723 
03724   if (path_name == "")
03725     {
03726       int path_index;
03727 
03728       for (path_index = 0; path_index < m_cmt_path.size (); path_index++)
03729         {
03730           const cmt_string& path = m_cmt_path[path_index];
03731 
03732           scanner.scan_path (path, viewer);
03733         }
03734     }
03735   else
03736     {
03737       scanner.scan_path (path_name, viewer);
03738     }
03739 }

void Cmt::do_show_path ( ) [static]
?

Definition at line 3742 of file cmt_parser.cxx.

Referenced by do_show_setup(), and parser().

03743 {
03744   int path_index;
03745 
03746   if (!m_quiet)
03747     {
03748       for (path_index = 0; path_index < m_cmt_path.size (); path_index++)
03749         {
03750           const cmt_string& path   = m_cmt_path[path_index];
03751           const cmt_string& source = m_cmt_path_sources[path_index];
03752 
03753           cout << "# Add path " << path << " from " << source << endl;
03754         }
03755 
03756       cout << "#" << endl;
03757     }
03758 
03759   for (path_index = 0; path_index < m_cmt_path.size (); path_index++)
03760     {
03761       const cmt_string& path   = m_cmt_path[path_index];
03762       const cmt_string& source = m_cmt_path_sources[path_index];
03763 
03764       if (path_index > 0) cout << CmtSystem::path_separator ();
03765 
03766       cout << path;
03767     }
03768 
03769   cout << endl;
03770 }

void Cmt::do_show_pattern ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 3773 of file cmt_parser.cxx.

Referenced by parser().

03774 {
03775   cmt_string name;
03776   if (arguments.size () > 0) name = arguments[0];
03777   Pattern::show (name);
03778 }

void Cmt::do_show_pattern_names ( ) [static]
?

Definition at line 3781 of file cmt_parser.cxx.

Referenced by parser().

03782 {
03783   Pattern::show_all_names ();
03784 }

void Cmt::do_show_patterns ( ) [static]
?

Definition at line 3787 of file cmt_parser.cxx.

Referenced by parser().

03788 {
03789   Pattern::show_all ();
03790 }

void Cmt::do_show_projects ( ) [static]
?

Definition at line 3793 of file cmt_parser.cxx.

Referenced by parser().

03794 {
03795   Project::show_all ();
03796 }

void Cmt::do_show_pwd ( ) [static]
?

Definition at line 3799 of file cmt_parser.cxx.

Referenced by parser().

03800 {
03801   cout << m_current_dir << endl;
03802 }

void Cmt::do_show_set ( const CmtSystem::cmt_string_vector & arguments,
PrintMode & mode?) [static]
?

Definition at line 3818 of file cmt_parser.cxx.

Referenced by parser().

03820 {
03821   do_show_macro (arguments, mode);
03822 }

void Cmt::do_show_set_names ( const CmtSystem::cmt_string_vector & arguments,
PrintMode & mode?) [static]
?

Definition at line 3825 of file cmt_parser.cxx.

Referenced by parser().

03827 {
03828   if (arguments.size () > 0)
03829     {
03830       const cmt_string& pattern = arguments[0];
03831       print_symbol_names (mode, pattern);
03832     }
03833   else
03834     {
03835       print_symbol_names (mode);
03836     }
03837 }

void Cmt::do_show_set_value ( const CmtSystem::cmt_string_vector & arguments,
PrintMode & mode?) [static]
?

Definition at line 3840 of file cmt_parser.cxx.

Referenced by parser().

03842 {
03843   do_show_macro (arguments, mode);
03844 }

void Cmt::do_show_sets ( const CmtSystem::cmt_string_vector & arguments,
PrintMode & mode?) [static]
?

Definition at line 3847 of file cmt_parser.cxx.

Referenced by parser().

03849 {
03850   if (arguments.size () > 0)
03851     {
03852       const cmt_string& pattern = arguments[0];
03853       print_macros (mode, pattern);
03854     }
03855   else
03856     {
03857       print_macros (mode);
03858     }
03859 }

void Cmt::do_show_setup ( ) [static]
?

Definition at line 3805 of file cmt_parser.cxx.

Referenced by parser().

03806 {
03807   cout << "----------> uses" << endl;
03808   do_show_uses ();
03809 
03810   cout << "----------> tags" << endl;
03811   do_show_tags ();
03812 
03813   cout << "----------> CMTPATH" << endl;
03814   do_show_path ();
03815 }

void Cmt::do_show_strategies ( ) [static]
?

Definition at line 3862 of file cmt_parser.cxx.

Referenced by parser().

03863 {
03864   cout << "Structuring style : ";
03865 
03866   switch (m_current_structuring_style)
03867     {
03868     case without_version_directory:
03869       cout << "without_version_directory";
03870       break;
03871     case with_version_directory:
03872       cout << "with_version_directory";
03873       break;
03874     }
03875 
03876   cout << endl;
03877 
03878   cout << "Version strategy  : ";
03879 
03880   switch (m_current_strategy)
03881     {
03882     case BestFit :
03883       cout << "BestFit";
03884       break;
03885     case BestFitNoCheck :
03886       cout << "BestFitNoCheck";
03887       break;
03888     case FirstChoice :
03889       cout << "FirstChoice";
03890       break;
03891     case LastChoice :
03892       cout << "LastChoice";
03893       break;
03894     case KeepAll :
03895       cout << "KeepAll";
03896       break;
03897     default :
03898       cout << "BestFit";
03899       break;
03900     }
03901   
03902   cout << endl;
03903   
03904   cout << "Build strategy    : ";
03905   
03906   if ((m_current_build_strategy & PrototypesMask) == Prototypes)
03907     {
03908       cout << "prototypes";
03909     }
03910   else
03911     {
03912       cout << "no_prototypes";
03913     }
03914   
03915   if ((m_current_build_strategy & KeepMakefilesMask) == KeepMakefiles)
03916     {
03917       cout << " keep_makefiles";
03918     }
03919   else
03920     {
03921       cout << " rebuild_makefiles";
03922     }
03923   
03924   if ((m_current_build_strategy & InstallAreaMask) == WithInstallArea)
03925     {
03926       cout << " with_install_area";
03927     }
03928   else
03929     {
03930       cout << " without_install_area";
03931     }
03932   
03933   cout << endl;
03934 
03935   cout << "Setup strategy    : ";
03936   
03937   if ((m_current_setup_strategy & SetupConfigMask) == SetupConfig)
03938     {
03939       cout << "config";
03940     }
03941   else
03942     {
03943       cout << "no_config";
03944     }
03945   
03946   if ((m_current_setup_strategy & SetupRootMask) == SetupRoot)
03947     {
03948       cout << " root";
03949     }
03950   else
03951     {
03952       cout << " no_root";
03953     }
03954   
03955   if ((m_current_setup_strategy & SetupCleanupMask) == SetupCleanup)
03956     {
03957       cout << " cleanup";
03958     }
03959   else
03960     {
03961       cout << " no_cleanup";
03962     }
03963   
03964   cout << endl;
03965 }

void Cmt::do_show_system ( ) [static]
?

Definition at line 4027 of file cmt_parser.cxx.

Referenced by parser().

04028 {
04029   cout << CmtSystem::get_cmt_config () << endl;
04030 }

void Cmt::do_show_tags ( ) [static]
?

Definition at line 3968 of file cmt_parser.cxx.

Referenced by do_show_setup(), and parser().

03969 {
03970   Tag::TagPtrVector tags = Tag::tags ();
03971   int index;
03972 
03973   set_standard_macros ();
03974 
03975   for (index = 0; index < tags.size (); index++)
03976     {
03977       const Tag* tag = tags[index];
03978       if (tag != 0)
03979         {
03980           tag->show (m_quiet);
03981         }
03982     }
03983 }

void Cmt::do_show_use_paths ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 3986 of file cmt_parser.cxx.

Referenced by parser().

03987 {
03988   const cmt_string& to_name = arguments[0];
03989 
03990   Use* current = &(Use::current());
03991 
03992   current->get_all_clients (to_name);
03993 }

void Cmt::do_show_uses ( ) [static]
?

Definition at line 3996 of file cmt_parser.cxx.

Referenced by do_show_setup(), and parser().

03997 {
03998   Use::show_all ();
03999 }

void Cmt::do_show_version ( ) [static]
?

Definition at line 4002 of file cmt_parser.cxx.

Referenced by parser().

04003 {
04004   cout << m_current_version << endl;
04005 }

void Cmt::do_show_versions ( const CmtSystem::cmt_string_vector & arguments?) [static]
?

Definition at line 4008 of file cmt_parser.cxx.

Referenced by parser().

04009 {
04010   cmt_string package_name;
04011 
04012   if (arguments.size () > 0) package_name = arguments[0];
04013 
04014   FileScanner scanner;
04015 
04016   int path_index;
04017 
04018   for (path_index = 0; path_index < m_cmt_path.size (); path_index++)
04019     {
04020       const cmt_string& path   = m_cmt_path[path_index];
04021 
04022       scanner.scan_package (path, package_name);
04023     }
04024 }

void Cmt::do_unlock ( const cmt_string & package,
const cmt_string & version,
const cmt_string & path?) [static]
?

Definition at line 4033 of file cmt_parser.cxx.

Referenced by parser().

04036 {
04037   // (unused??) Use& use = Use::current();
04038 
04039   cout << "try to unlock package " << package << " in " << CmtSystem::pwd () << endl;
04040 
04041   set_standard_macros ();
04042 
04043   CmtLock::status status = CmtLock::unlock ();
04044 }

void Cmt::do_version ( ) [static]
?

Definition at line 4047 of file cmt_parser.cxx.

Referenced by parser().

04048 {
04049   cout << CMTVERSION << endl;
04050 }

const cmt_string & Cmt::filter_dir ( const cmt_string & dir?) [static]
?

Definition at line 4168 of file cmt_parser.cxx.

Referenced by Include::print_filters().

04169 {
04170   static cmt_string newdir;
04171 
04172   CmtSystem::compress_path (dir, newdir);
04173 
04174   return (newdir);
04175 }

ActionType Cmt::get_action ( ) [static]
?

Definition at line 4055 of file cmt_parser.cxx.

Referenced by KwdVersionStrategy::action(), KwdSetupStrategy::action(), KwdBuildStrategy::action(), MacroBuilder::build(), PathBuilder::build(), SetBuilder::build(), Symbol::create(), SyntaxParser::do_parse_requirements_text(), use_action_iterator::get_use(), Use::need_new(), SymbolValueList::show(), and Symbol::show_macro().

04056 {
04057   return (m_action);
04058 }

const cmt_string & Cmt::get_cmt_home ( ) [static]
?

Definition at line 4070 of file cmt_parser.cxx.

Referenced by Use::show_all().

04071 {
04072   return (m_cmt_home);
04073 }

const CmtSystem::cmt_string_vector & Cmt::get_cmt_path ( ) [static]
?

Definition at line 4060 of file cmt_parser.cxx.

Referenced by CmtPathPattern::apply(), CmtInstallAreaMgr::build_current_install_area(), configure_current_cmtpath(), do_broadcast(), and Use::move_to().

04061 {
04062   return (m_cmt_path);
04063 }

const CmtSystem::cmt_string_vector & Cmt::get_cmt_path_sources ( ) [static]
?

Definition at line 4065 of file cmt_parser.cxx.

Referenced by CmtPathPattern::apply(), and CmtInstallAreaMgr::build_current_install_area().

04066 {
04067   return (m_cmt_path_sources);
04068 }

const cmt_string & Cmt::get_cmt_user_context ( ) [static]
?

Definition at line 4075 of file cmt_parser.cxx.

Referenced by Use::show_all().

04076 {
04077   return (m_cmt_user_context);
04078 }

AccessMode Cmt::get_current_access ( ) [static]
?

Definition at line 4100 of file cmt_parser.cxx.

Referenced by Symbol::action(), Fragment::action(), and SyntaxParser::parse_requirements_text().

04101 {
04102   return (m_current_access);
04103 }

int Cmt::get_current_build_strategy ( ) [static]
?

Definition at line 4105 of file cmt_parser.cxx.

Referenced by do_build_library_links(), do_config(), do_remove_library_links(), do_setup(), and set_standard_macros().

04106 {
04107   return (m_current_build_strategy);
04108 }

const cmt_string & Cmt::get_current_cmtpath ( ) [static]
?

Definition at line 4090 of file cmt_parser.cxx.

Referenced by StandardMacroBuilder::fill_for_branches().

04091 {
04092   return (m_current_cmtpath);
04093 }

const cmt_string & Cmt::get_current_dir ( ) [static]
?

Definition at line 4080 of file cmt_parser.cxx.

04081 {
04082   return (m_current_dir);
04083 }

const cmt_string & Cmt::get_current_offset ( ) [static]
?

Definition at line 4095 of file cmt_parser.cxx.

Referenced by StandardMacroBuilder::fill_for_branches().

04096 {
04097   return (m_current_offset);
04098 }

const cmt_string & Cmt::get_current_package ( ) [static]
?

Definition at line 4085 of file cmt_parser.cxx.

Referenced by ReadmeGenerator::build(), Generator::build_constituent_makefile(), VSNETGenerator::build_project(), MSDEVGenerator::build_project(), VSNETGenerator::build_workspace(), and MSDEVGenerator::build_workspace().

04086 {
04087   return (m_current_package);
04088 }

int Cmt::get_current_setup_strategy ( ) [static]
?

Definition at line 4110 of file cmt_parser.cxx.

Referenced by do_config(), and do_setup().

04111 {
04112   return (m_current_setup_strategy);
04113 }

VersionStrategy Cmt::get_current_strategy ( ) [static]
?

Definition at line 4115 of file cmt_parser.cxx.

Referenced by VersionSelector::instance().

04116 {
04117   return (m_current_strategy);
04118 }

CmtStructuringStyle Cmt::get_current_structuring_style ( ) [static]
?

Definition at line 4120 of file cmt_parser.cxx.

Referenced by CvsImplementation::build_version_directory(), dos_script_prefix(), and CvsImplementation::really_checkout_package().

04121 {
04122   return (m_current_structuring_style);
04123 }

const cmt_string & Cmt::get_current_target ( ) [static]
?

Definition at line 4130 of file cmt_parser.cxx.

Referenced by MacroBuilder::build(), PathBuilder::build(), and SetBuilder::build().

04131 {
04132   return (m_current_target);
04133 }

const cmt_string & Cmt::get_current_version ( ) [static]
?

Definition at line 4125 of file cmt_parser.cxx.

Referenced by ReadmeGenerator::build().

04126 {
04127   return (m_current_version);
04128 }

bool Cmt::get_debug ( ) [static]
?

Definition at line 4135 of file cmt_parser.cxx.

Referenced by Package::Package(), CmtPathPattern::action(), Package::add(), Use::add(), Symbol::all_set(), LibraryGenerator::analyze_file(), Pattern::apply(), CmtPathPattern::apply(), DefaultMakefileGenerator::build(), build_deps(), build_deps_stream(), CmtInstallAreaMgr::config(), SyntaxParser::do_parse_requirements_line(), StandardMacroBuilder::fill_for_all_constituents(), StandardMacroBuilder::fill_for_use_includes(), CmtGenerator::fill_outputs(), Use::find_index(), CmtGenerator::get_all_files(), Use::get_paths(), use_action_iterator::get_use(), Use::move_to(), Use::need_new(), Use::reach_package(), Package::remove_use(), Use::reorder(), resolve_value(), resolve_value_for_macros(), Use::select_alternate(), Use::set_auto_imports(), Use::set_auto_imports_state(), Use::show_all(), Symbol::show_macro(), and suppress_OS_delimiters().

04136 {
04137   return (m_debug);
04138 }

bool Cmt::get_quiet ( ) [static]
?

Definition at line 4140 of file cmt_parser.cxx.

Referenced by KwdDefault::action(), KwdVersionStrategy::action(), KwdSetupStrategy::action(), KwdBuildStrategy::action(), Use::add(), MacroBuilder::build(), PathBuilder::build(), SetBuilder::build(), CmtInstallAreaMgr::config(), Symbol::create(), SyntaxParser::do_parse(), DependencyAnalyzer::filter(), TriggerAnalyzer::filter(), Use::need_new(), BestFitNoCheckSelector::operate(), Use::show_all(), and Symbol::show_macro().

04141 {
04142   return (m_quiet);
04143 }

bool Cmt::get_recursive ( ) [static]
?

Definition at line 4145 of file cmt_parser.cxx.

Referenced by Use::add().

04146 {
04147   return (m_recursive);
04148 }

ScopeType Cmt::get_scope ( ) [static]
?

Definition at line 4150 of file cmt_parser.cxx.

Referenced by Symbol::action(), Fragment::action(), Use::add(), Use::clear(), use_action_iterator::get_use(), SyntaxParser::parse_requirements_text(), Use::set(), and Symbol::valid().

04151 {
04152   return (m_scope);
04153 }

CmtScopeFilteringMode Cmt::get_scope_filtering_mode ( ) [static]
?

Definition at line 4155 of file cmt_parser.cxx.

Referenced by use_action_iterator::get_use().

04156 {
04157   if (m_scope_filtering_mode == default_filtering_mode)
04158     {
04159       return (block_private_uses);
04160     }
04161   else
04162     {
04163       return (m_scope_filtering_mode);
04164     }
04165 }

void Cmt::install_cleanup_scripts ( ) [static]
?

Definition at line 4222 of file cmt_parser.cxx.

Referenced by do_config().

04223 {
04224 #ifdef WIN32
04225   static const int modes = 1;
04226   static const cmt_string suffix[1]   = {"bat"};
04227   static const PrintMode  mode[1]     = {Bat};
04228 #else
04229   static const int modes = 2;
04230   static const cmt_string suffix[2]   = {"csh", "sh"};
04231   static const PrintMode  mode[2]     = {Csh, Sh};
04232 #endif
04233 
04234   cout << "Creating cleanup scripts." << endl;
04235 
04236   cmt_string temp;
04237   int i;
04238 
04239   cmt_string version = m_current_version;
04240   if (version == "v*") version = "";
04241 
04242   for (i = 0; i < modes; i++)
04243     {
04244       cmt_string file_name = "cleanup";
04245       file_name += ".";
04246       file_name += suffix[i];
04247       file_name += ".";
04248       file_name += "new";
04249 
04250       FILE* f = fopen (file_name.c_str (), "wb");
04251       if (f != NULL)
04252         {
04253           if (mode[i] == Csh)
04254             {
04255               fprintf (f, "if ( $?CMTROOT == 0 ) then\n");
04256               fprintf (f, "  setenv CMTROOT %s\n", m_cmt_root.c_str ());
04257               fprintf (f, "endif\n");
04258               fprintf (f, "source ${CMTROOT}/mgr/setup.csh\n");
04259               fprintf (f, "set tempfile=`${CMTROOT}/mgr/cmt build temporary_name -quiet`\n");
04260               fprintf (f, "if $status != 0 then\n  set tempfile=/tmp/cmt.$$\nendif\n");
04261               fprintf (f, "${CMTROOT}/mgr/cmt -quiet cleanup -%s "
04262                        "-pack=%s -version=%s -path=%s $* >${tempfile}; "
04263                        "source ${tempfile}\n",
04264                        suffix[i].c_str (),
04265                        m_current_package.c_str (),
04266                        version.c_str (),
04267                        m_current_path.c_str ());
04268               fprintf (f, "/bin/rm -f ${tempfile}\n");
04269             }
04270           else if (mode[i] == Sh)
04271             {
04272               fprintf (f, "if test \"${CMTROOT}\" = \"\"; then\n");
04273               fprintf (f, "  CMTROOT=%s; export CMTROOT\n", m_cmt_root.c_str ());
04274               fprintf (f, "fi\n");
04275               fprintf (f, ". ${CMTROOT}/mgr/setup.sh\n");
04276               fprintf (f, "tempfile=`${CMTROOT}/mgr/cmt build temporary_name -quiet`\n");
04277               fprintf (f, "if test ! $? = 0 ; then tempfile=/tmp/cmt.$$; fi\n");
04278               fprintf (f, "${CMTROOT}/mgr/cmt -quiet cleanup -%s "
04279                        "-pack=%s -version=%s -path=%s $* >${tempfile}; "
04280                        ". ${tempfile}\n",
04281                        suffix[i].c_str (),
04282                        m_current_package.c_str (),
04283                        version.c_str (),
04284                        m_current_path.c_str ());
04285               fprintf (f, "/bin/rm -f ${tempfile}\n");
04286             }
04287           else if (mode[i] == Bat)
04288             {
04289               dos_script_prefix (f, m_cmt_root, 
04290                                  m_current_package, version, m_current_path,
04291                                  "cleanup");
04292             }
04293 
04294           fprintf (f, "\n");
04295 
04296           fclose (f);
04297 
04298           cmt_string old_file_name = "cleanup";
04299           old_file_name += ".";
04300           old_file_name += suffix[i];
04301 
04302           CmtSystem::compare_and_update_files (file_name, old_file_name);
04303         }
04304     }
04305 }

void Cmt::install_setup_scripts ( ) [static]
?

Definition at line 4308 of file cmt_parser.cxx.

Referenced by do_config().

04309 {
04310 #ifdef WIN32
04311   static const int modes = 1;
04312   static const cmt_string suffix[1]   = {"bat"};
04313   static const PrintMode  mode[1]     = {Bat};
04314 #else
04315   static const int modes = 2;
04316   static const cmt_string suffix[2]   = {"csh", "sh"};
04317   static const PrintMode  mode[2]     = {Csh, Sh};
04318 #endif
04319 
04320   cout << "Creating setup scripts." << endl;
04321 
04322   
04323   cmt_string no_cleanup_opt;
04324 
04325   if ((m_current_setup_strategy & SetupCleanupMask) != SetupCleanup)
04326     {
04327       no_cleanup_opt = " -no_cleanup";
04328     }
04329 
04330   cmt_string temp;
04331   int i;
04332 
04333   cmt_string version = m_current_version;
04334   if (version == "v*") version = "";
04335 
04336   for (i = 0; i < modes; i++)
04337     {
04338       cmt_string file_name = "setup";
04339       file_name += ".";
04340       file_name += suffix[i];
04341       file_name += ".";
04342       file_name += "new";
04343 
04344       FILE* f = fopen (file_name.c_str (), "wb");
04345       if (f != NULL)
04346         {
04347           if (mode[i] == Csh)
04348             {
04349               fprintf (f, "# echo \"Setting %s %s in %s\"\n",
04350                        m_current_package.c_str (),
04351                        version.c_str (),
04352                        m_current_path.c_str ());
04353               fprintf (f, "\n");
04354 
04355               fprintf (f, "if ( $?CMTROOT == 0 ) then\n");
04356               fprintf (f, "  setenv CMTROOT %s\n", m_cmt_root.c_str ());
04357               fprintf (f, "endif\n");
04358               fprintf (f, "source ${CMTROOT}/mgr/setup.csh\n");
04359               fprintf (f, "\n");
04360               fprintf (f, "set tempfile=`${CMTROOT}/mgr/cmt build temporary_name -quiet`\n");
04361               fprintf (f, "if $status != 0 then\n  set tempfile=/tmp/cmt.$$\nendif\n");
04362               fprintf (f, "${CMTROOT}/mgr/cmt -quiet setup -%s "
04363                        "-pack=%s -version=%s -path=%s %s $* >${tempfile}; "
04364                        "source ${tempfile}\n",
04365                        suffix[i].c_str (),
04366                        m_current_package.c_str (),
04367                        version.c_str (),
04368                        m_current_path.c_str (),
04369                        no_cleanup_opt.c_str ());
04370               fprintf (f, "/bin/rm -f ${tempfile}\n");
04371             }
04372           else if (mode[i] == Sh)
04373             {
04374               fprintf (f, "# echo \"Setting %s %s in %s\"\n",
04375                        m_current_package.c_str (),
04376                        version.c_str (),
04377                        m_current_path.c_str ());
04378               fprintf (f, "\n");
04379 
04380               fprintf (f, "if test \"${CMTROOT}\" = \"\"; then\n");
04381               fprintf (f, "  CMTROOT=%s; export CMTROOT\n", m_cmt_root.c_str ());
04382               fprintf (f, "fi\n");
04383               fprintf (f, ". ${CMTROOT}/mgr/setup.sh\n");
04384               fprintf (f, "\n");
04385               fprintf (f, "tempfile=`${CMTROOT}/mgr/cmt build temporary_name -quiet`\n");
04386               fprintf (f, "if test ! $? = 0 ; then tempfile=/tmp/cmt.$$; fi\n");
04387               fprintf (f, "${CMTROOT}/mgr/cmt -quiet setup -%s "
04388                        "-pack=%s -version=%s -path=%s %s $* >${tempfile}; "
04389                        ". ${tempfile}\n",
04390                        suffix[i].c_str (),
04391                        m_current_package.c_str (),
04392                        version.c_str (),
04393                        m_current_path.c_str (),
04394                        no_cleanup_opt.c_str ());
04395               fprintf (f, "/bin/rm -f ${tempfile}\n");
04396             }
04397           else if (mode[i] == Bat)
04398             {
04399               fprintf (f, "rem Setting %s %s in %%~d0%%~p0\n",
04400                        m_current_package.c_str (),
04401                        version.c_str ());
04402               dos_script_prefix (f, m_cmt_root, 
04403                                  m_current_package, version, m_current_path,
04404                                  "setup", no_cleanup_opt);
04405             }
04406 
04407           fprintf (f, "\n");
04408 
04409           fclose (f);
04410 
04411           cmt_string old_file_name = "setup";
04412           old_file_name += ".";
04413           old_file_name += suffix[i];
04414 
04415           CmtSystem::compare_and_update_files (file_name, old_file_name);
04416         }
04417     }
04418 }

void Cmt::install_test_cleanup_scripts ( ) [static]
?

Definition at line 4421 of file cmt_parser.cxx.

Referenced by do_config().

04422 {
04423 #ifdef WIN32
04424   static const int modes = 1;
04425   static const cmt_string suffix[1]   = {"bat"};
04426   static const PrintMode  mode[1]     = {Bat};
04427 #else
04428   static const int modes = 2;
04429   static const cmt_string suffix[2]   = {"csh", "sh"};
04430   static const PrintMode  mode[2]     = {Csh, Sh};
04431 #endif
04432 
04433   cout << "Creating cleanup scripts." << endl;
04434 
04435   cmt_string temp;
04436   int i;
04437 
04438   cmt_string version = m_current_version;
04439   if (version == "v*") version = "";
04440 
04441   for (i = 0; i < modes; i++)
04442     {
04443       cmt_string file_name = "cleanup";
04444       file_name += ".";
04445       file_name += suffix[i];
04446       file_name += ".";
04447       file_name += "new";
04448 
04449       FILE* f = fopen (file_name.c_str (), "wb");
04450       if (f != NULL)
04451         {
04452           if (mode[i] == Csh)
04453             {
04454               fprintf (f, "if ( $?CMTROOT == 0 ) then\n");
04455               fprintf (f, "  setenv CMTROOT %s\n", m_cmt_root.c_str ());
04456               fprintf (f, "endif\n");
04457               fprintf (f, "source ${CMTROOT}/mgr/setup.csh\n");
04458               fprintf (f, "set tempfile=`${CMTROOT}/mgr/cmt build temporary_name -quiet`\n");
04459               fprintf (f, "if $status != 0 then\n  set tempfile=/tmp/cmt.$$\nendif\n");
04460               fprintf (f, "${CMTROOT}/mgr/cmt -quiet cleanup -%s -pack=cmt_standalone -path=%s $* >${tempfile}; "
04461                        "source ${tempfile}\n",
04462                        suffix[i].c_str (),
04463                        m_current_path.c_str ());
04464               fprintf (f, "/bin/rm -f ${tempfile}\n");
04465             }
04466           else if (mode[i] == Sh)
04467             {
04468               fprintf (f, "if test \"${CMTROOT}\" = \"\"; then\n");
04469               fprintf (f, "  CMTROOT=%s; export CMTROOT\n", m_cmt_root.c_str ());
04470               fprintf (f, "fi\n");
04471               fprintf (f, ". ${CMTROOT}/mgr/setup.sh\n");
04472               fprintf (f, "tempfile=`${CMTROOT}/mgr/cmt build temporary_name -quiet`\n");
04473               fprintf (f, "if test ! $? = 0 ; then tempfile=/tmp/cmt.$$; fi\n");
04474               fprintf (f, "${CMTROOT}/mgr/cmt -quiet cleanup -%s -pack=cmt_standalone -path=%s $* >${tempfile}; "
04475                        ". ${tempfile}\n",
04476                        suffix[i].c_str (),
04477                        m_current_path.c_str ());
04478               fprintf (f, "/bin/rm -f ${tempfile}\n");
04479             }
04480           else
04481             {
04482               dos_script_prefix (f, m_cmt_root, 
04483                                  "cmt_standalone", "", m_current_path, 
04484                                  "cleanup");
04485             }
04486 
04487           fprintf (f, "\n");
04488 
04489           fclose (f);
04490 
04491           cmt_string old_file_name = "cleanup";
04492           old_file_name += ".";
04493           old_file_name += suffix[i];
04494 
04495           CmtSystem::compare_and_update_files (file_name, old_file_name);
04496         }
04497     }
04498 }

void Cmt::install_test_setup_scripts ( ) [static]
?

Definition at line 4501 of file cmt_parser.cxx.

Referenced by do_config().

04502 {
04503 #ifdef WIN32
04504   static const int modes = 1;
04505   static const cmt_string suffix[1]   = {"bat"};
04506   static const PrintMode  mode[1]     = {Bat};
04507 #else
04508   static const int modes = 2;
04509   static const cmt_string suffix[2]   = {"csh", "sh"};
04510   static const PrintMode  mode[2]     = {Csh, Sh};
04511 #endif
04512 
04513   cout << "Creating setup scripts." << endl;
04514 
04515   cmt_string no_cleanup_opt;
04516 
04517   if ((m_current_setup_strategy & SetupCleanupMask) != SetupCleanup)
04518     {
04519       no_cleanup_opt = " -no_cleanup";
04520     }
04521 
04522   cmt_string temp;
04523   int i;
04524 
04525   for (i = 0; i < modes; i++)
04526     {
04527       cmt_string file_name = "setup";
04528       file_name += ".";
04529       file_name += suffix[i];
04530       file_name += ".";
04531       file_name += "new";
04532 
04533       FILE* f = fopen (file_name.c_str (), "wb");
04534       if (f != NULL)
04535         {
04536           if (mode[i] == Csh)
04537             {
04538               fprintf (f, "# echo \"Setting standalone package\"\n");
04539               fprintf (f, "\n");
04540 
04541               fprintf (f, "if ( $?CMTROOT == 0 ) then\n");
04542               fprintf (f, "  setenv CMTROOT %s\n", m_cmt_root.c_str ());
04543               fprintf (f, "endif\n");
04544               fprintf (f, "source ${CMTROOT}/mgr/setup.csh\n");
04545               fprintf (f, "set tempfile=`${CMTROOT}/mgr/cmt build temporary_name -quiet`\n");
04546               fprintf (f, "if $status != 0 then\n  set tempfile=/tmp/cmt.$$\nendif\n");
04547               fprintf (f, "${CMTROOT}/mgr/cmt -quiet setup -%s -pack=cmt_standalone -path=%s %s $* >${tempfile}; "
04548                        "source ${tempfile}\n",
04549                        suffix[i].c_str (),
04550                        m_current_path.c_str (),
04551                        no_cleanup_opt.c_str ());
04552               fprintf (f, "/bin/rm -f ${tempfile}\n");
04553             }
04554           else if (mode[i] == Sh)
04555             {
04556               fprintf (f, "# echo \"Setting standalone package\"\n");
04557               fprintf (f, "\n");
04558 
04559               fprintf (f, "if test \"${CMTROOT}\" = \"\"; then\n");
04560               fprintf (f, "  CMTROOT=%s; export CMTROOT\n", m_cmt_root.c_str ());
04561               fprintf (f, "fi\n");
04562               fprintf (f, ". ${CMTROOT}/mgr/setup.sh\n");
04563               fprintf (f, "\n");
04564               fprintf (f, "tempfile=`${CMTROOT}/mgr/cmt build temporary_name -quiet`\n");
04565               fprintf (f, "if test ! $? = 0 ; then tempfile=/tmp/cmt.$$; fi\n");
04566               fprintf (f, "${CMTROOT}/mgr/cmt -quiet setup -%s -pack=cmt_standalone -path=%s %s $* >${tempfile}; "
04567                        ". ${tempfile}\n",
04568                        suffix[i].c_str (),
04569                        m_current_path.c_str (),
04570                        no_cleanup_opt.c_str ());
04571               fprintf (f, "/bin/rm -f ${tempfile}\n");
04572             }
04573           else
04574             {
04575               fprintf (f, "rem Setting standalone package\n");
04576               dos_script_prefix (f, m_cmt_root, 
04577                                  "cmt_standalone", "", m_current_path, 
04578                                  "setup", no_cleanup_opt);
04579             }
04580 
04581           fprintf (f, "\n");
04582 
04583           fclose (f);
04584 
04585           cmt_string old_file_name = "setup";
04586           old_file_name += ".";
04587           old_file_name += suffix[i];
04588 
04589           CmtSystem::compare_and_update_files (file_name, old_file_name);
04590         }
04591     }
04592 }

bool Cmt::load ( const cmt_string & path,
const cmt_string & package,
const cmt_string & version,
const cmt_string & tag_name = ""?) [static]
?

load is only called from the Windows GUI which pretends to access directly the internal data model.

This is considered to be rather unsafe, and should be replaced by query functions.

Definition at line 4599 of file cmt_parser.cxx.

04603 {
04604   clear ();
04605   configure ();
04606 
04607   m_action  = action_load;
04608   m_recursive = true;
04609 
04610   if (((package != "") && (version != "")) || (m_current_package == ""))
04611     {
04612       //
04613       //  Here we want to connect to a new package, or to the current package
04614       //  but with another tag.
04615       //
04616       //   the 'package' argument may include a directory offset. Thus 'path'
04617       //  is only expected to hold the base directory.
04618       //
04619       cmt_string offset;
04620       cmt_string package_name;
04621       
04622       CmtSystem::dirname (package, offset);
04623       CmtSystem::basename (package, package_name);
04624       
04625       if (offset != "")
04626         {
04627           m_current_path = path;
04628           m_current_path += CmtSystem::file_separator ();
04629           m_current_path += offset;
04630         }
04631       else
04632         {
04633           m_current_path = path;
04634         }
04635       
04636       m_current_package = package_name;
04637       m_current_version = version;
04638     }
04639 
04640   if (tag_name != "")
04641     {
04642       Tag* tag;
04643 
04644       Tag::unmark_all ();
04645       configure_version_tag ();
04646       configure_site_tag (0);
04647       configure_uname_tag ();
04648       configure_hosttype_tag ();
04649 
04650       m_current_tag = tag_name;
04651 
04652       //if (!m_quiet) cerr << "load1> current_tag=" << m_current_tag << endl;
04653 
04654       tag = Tag::add (tag_name, PriorityTag, "load", 0);
04655       tag->mark ();
04656     }
04657 
04658   /*
04659     Set to developer mode if positioned into the package
04660     (which is detected since we were able to retreive the
04661     Version, Package and Path)
04662   */
04663 
04664   if ((m_current_path == "") ||
04665       (m_current_package == "") ||
04666       (m_current_version == ""))
04667     {
04668       m_current_access = UserMode;
04669     }
04670   else
04671     {
04672       m_current_access = DeveloperMode;
04673     }
04674 
04675   use_cmt ();
04676 
04677   cmt_string dir;
04678 
04679   /*
04680     Try to access the package.
04681   */
04682 
04683   if (m_current_path != "")
04684     {
04685       dir = m_current_path;
04686     }
04687   else
04688     {
04689       dir = m_default_path;
04690     }
04691 
04692   if (!CmtSystem::cd (m_current_path))
04693     {
04694       if (!m_quiet)
04695         {
04696           cout << "#CMT> Cannot reach the directory " <<
04697             m_current_path << endl;
04698         }
04699       CmtError::set (CmtError::package_not_found, "Load> Cannot reach the path directory");
04700       CmtSystem::cd (m_current_dir);
04701 
04702       return (false);
04703     }
04704 
04705   dir += CmtSystem::file_separator ();
04706   dir += m_current_package;
04707 
04708   if (!CmtSystem::cd (m_current_package))
04709     {
04710       if (!m_quiet)
04711         {
04712           cout << "#CMT::load> Cannot reach the package " <<
04713             m_current_package << endl;
04714         }
04715       CmtError::set (CmtError::package_not_found, "Load> Cannot reach the package directory");
04716       CmtSystem::cd (m_current_dir);
04717 
04718       return (false);
04719     }
04720 
04721   dir += CmtSystem::file_separator ();
04722   dir += m_current_version;
04723 
04724   m_current_style = none_style;
04725 
04726   if (!CmtSystem::cd (m_current_version))
04727     {
04728       if (!CmtSystem::test_directory ("cmt"))
04729         {
04730           if (!m_quiet)
04731             {
04732               cout << "#CMT> Cannot reach the version " <<
04733                 m_current_version << endl;
04734             }
04735           CmtError::set (CmtError::package_not_found, "Load> Cannot reach the version directory");
04736           CmtSystem::cd (m_current_dir);
04737 
04738           return (false);
04739         }
04740       else
04741         {
04742           m_current_style = no_version_style;
04743         }
04744     }
04745 
04746   if (CmtSystem::cd ("cmt"))
04747     {
04748       dir += CmtSystem::file_separator ();
04749       dir += "cmt";
04750       if (m_current_style == none_style) m_current_style = cmt_style;
04751     }
04752   else
04753     {
04754       /*
04755         if (!m_quiet)
04756         {
04757         cout << "Cannot reach the cmt branch" << endl;
04758         }
04759       */
04760 
04761       if (CmtSystem::cd ("mgr"))
04762         {
04763           dir += CmtSystem::file_separator ();
04764           dir += "mgr";
04765           if (m_current_style == none_style) m_current_style = mgr_style;
04766         }
04767       else
04768         {
04769           if (!m_quiet)
04770             {
04771               cout << "#CMT> Cannot reach the mgr branch" << endl;
04772             }
04773 
04774           CmtError::set (CmtError::package_not_found,
04775                          "Load> Cannot reach the mgr/cmt directory");
04776           CmtSystem::cd (m_current_dir);
04777 
04778           return (false);
04779         }
04780     }
04781 
04782   /*
04783     Check Tag is always set up
04784   */
04785 
04786   if (m_current_tag == "")
04787     {
04788       char* env;
04789 
04790       env = getenv (m_current_config.c_str ());
04791       if (env != 0)
04792         {
04793           Tag* tag;
04794 
04795           tag = Tag::add (env, PriorityConfig, "load", 0);
04796           tag->mark ();
04797           m_current_tag = env;
04798 
04799           //if (!m_quiet) cerr << "load2> current_tag=" << m_current_tag << endl;
04800 
04801         }
04802       else
04803         {
04804           m_current_tag = m_cmt_config;
04805 
04806           //if (!m_quiet) cerr << "load3> current_tag=" << m_current_tag << endl;
04807 
04808         }
04809     }
04810 
04811   if (m_debug)
04812     {
04813       cout << "pwd = " << CmtSystem::pwd () << endl;
04814     }
04815 
04816   configure_current_dir ();
04817   build_prefix (m_current_package, m_current_prefix);
04818   build_config (m_current_prefix, m_current_config);
04819 
04820   Use* use = &(Use::current());
04821   use->path    = m_current_path;
04822   use->set_package_name (m_current_package);
04823   use->version = m_current_version;
04824   use->prefix  = m_current_prefix;
04825   use->done    = false;
04826   use->style   = m_current_style;
04827 
04828   /*
04829     Work on the requirements file.
04830   */
04831 
04832   dir += CmtSystem::file_separator ();
04833   dir += "requirements";
04834   SyntaxParser::parse_requirements (dir, use);
04835 
04836   if (CmtError::has_pending_error ()) return (false);
04837 
04841   Pattern::apply_all_globals ();
04842 
04843   /*
04844     Select all possible tags
04845   */
04846 
04847   Tag::restore_tree ();
04848 
04849   return (true);
04850 }

bool Cmt::need_prototypes ( ) [static]
?

See reach_current_package for an explanation of this call.

Definition at line 4853 of file cmt_parser.cxx.

Referenced by Constituent::add().

04854 {
04855   if ((m_current_build_strategy & PrototypesMask) == Prototypes) return (true);
04856   else return (false);
04857 }

void Cmt::parse_arguments ( int argc,
char * argv[],
CmtSystem::cmt_string_vector & arguments,
cmt_string & extra_line,
cmt_string & extra_file,
PrintMode & mode?) [static]
?

Definition at line 4860 of file cmt_parser.cxx.

Referenced by parser().

04865 {
04866   /*
04867     Decoding arguments.
04868 
04869     While decoding all arguments, no requirements analysis should
04870     occur. Every new option, or parameter should be saved and
04871     used later at actual analysis time.
04872   */
04873 
04874   cmt_string arg;
04875 
04876   m_action = action_none;
04877   m_help_action = action_none;
04878 
04879   arguments.clear ();
04880   extra_line.erase (0);
04881   extra_file.erase (0);
04882   mode = Csh;
04883 
04884     /*
04885       Tag management.
04886       ---------------
04887 
04888       Tag settings may come from :
04889 
04890       - existing environment variables:
04891 
04892           1) CMTCONFIG
04893 
04894           2) CMTEXTRATAGS for addons
04895 
04896       - arguments:
04897 
04898           -tag=
04899           -tag_add=
04900           -tag_remove=
04901 
04902        o Arguments should take precedence over environment variables.
04903        o when nothing is specified:
04904 
04905           - primary tag = CMTCONFIG
04906           - tag set is empty
04907 
04908 
04909      */
04910 
04911 
04912   restore_all_tags (0);
04913 
04914 #ifdef WIN32
04915   m_build_nmake = true;
04916 #endif
04917 
04918   while (argc > 1)
04919     {
04920       int lf;
04921 
04922       arg = argv[1];
04923       lf = arg.find ('\r');
04924       if (lf != cmt_string::npos) arg.erase (lf);
04925 
04926       if ((arg[0] == '\"') && (arg[arg.size () - 1] == '\"'))
04927         {
04928           arg.erase (0, 1);
04929           arg.erase (arg.size () - 1, 1);
04930         }
04931 
04932       //fprintf (stderr, "arg=[%s]\n", arg.c_str ());
04933 
04934       switch (arg[0])
04935         {
04936         case 'a' :
04937           if (arg == "awk")
04938             {
04939               argc--;
04940               argv++;
04941               while (argc > 1)
04942                 {
04943                   cmt_string& s = arguments.add ();
04944                   s = argv[1];
04945                   argc--;
04946                   argv++;
04947                 }
04948 
04949               m_action = action_awk;
04950             }
04951           break;
04952         case 'b' :
04953           if ((arg == "b") ||
04954               (arg == "br") ||
04955               (arg == "bro") ||
04956               (arg == "broa") ||
04957               (arg == "broad") ||
04958               (arg == "broadc") ||
04959               (arg == "broadca") ||
04960               (arg == "broadcas") ||
04961               (arg == "broadcast"))
04962             {
04963               argc--;
04964               argv++;
04965               while (argc > 1)
04966                 {
04967                   cmt_string& s = arguments.add ();
04968                   s = argv[1];
04969                   argc--;
04970                   argv++;
04971                 }
04972 
04973               m_action = action_broadcast;
04974 
04975               if (m_scope_filtering_mode == default_filtering_mode)
04976                 {
04977                   set_scope_filtering_mode (reach_private_uses);
04978                 }
04979             }
04980           else if (arg == "build")
04981             {
04982               argc--;
04983               argv++;
04984 
04985               if (argc > 1)
04986                 {
04987                   arg = argv[1];
04988 
04989                   if (arg == "-nmake")
04990                     {
04991                       m_build_nmake = true;
04992                       argc--;
04993                       argv++;
04994                     }
04995                 }
04996 
04997               if (argc > 1)
04998                 {
04999                   arg = argv[1];
05000 
05001                   if (arg == "-nmake")
05002                     {
05003                       argc--;
05004                       argv++;
05005                     }
05006 
05007                   if (arg == "constituent_makefile")
05008                     {
05009                       argc--;
05010                       argv++;
05011                       if (argc > 1)
05012                         {
05013                           cmt_string& s = arguments.add ();
05014                           s = argv[1];
05015 
05016                           m_action = action_build_constituent_makefile;
05017                         }
05018                       else
05019                         {
05020                           if (!m_quiet) cout << "#CMT> syntax error : constituent name missing" << endl;
05021                           m_action = action_build_constituent_makefile;
05022                           m_help_action = action_help;
05023                         }
05024                     }
05025                   else if (arg == "constituents_makefile")
05026                     {
05027                       m_action = action_build_constituents_makefile;
05028                     }
05029                   else if (arg == "dependencies")
05030                     {
05031                       argc--;
05032                       argv++;
05033                       if (argc > 1)
05034                         {
05035                           cmt_string& s = arguments.add ();
05036                           s = argv[1];
05037 
05038                           m_action = action_build_dependencies;
05039                         }
05040                       else
05041                         {
05042                           if (!m_quiet) cout << "#CMT> syntax error : arguments missing " << endl;
05043                           m_help_action = action_help;
05044                           m_action = action_build_dependencies;
05045                         }
05046 
05047                       argc = 0;
05048                     }
05049                   else if (arg == "library_links")
05050                     {
05051                       m_action = action_build_library_links;
05052                     }
05053                   else if (arg == "make_setup")
05054                     {
05055                       m_action = action_build_make_setup;
05056                     }
05057                   else if (arg == "msdev")
05058                     {
05059                       argc--;
05060                       argv++;
05061 
05062                       if (argc > 1)
05063                         {
05064                           cmt_string& s = arguments.add ();
05065                           s = argv[1];
05066                           if (s[0] == '-')
05067                             {
05068                               s = "";
05069                               argc++;
05070                               argv--;
05071                             }
05072                         }
05073 
05074                       m_action = action_build_msdev;
05075                     }
05076                 else if (arg == "vsnet") 
05077                     {                                              
05078                        argc--;                                      
05079                        argv++;                                      
05080                                                                     
05081                        if (argc > 1)                                
05082                          {                                          
05083                            cmt_string& s = arguments.add ();        
05084                            s = argv[1];                             
05085                            if (s[0] == '-')                         
05086                              {                                      
05087                                s = "";                              
05088                                argc++;                              
05089                                argv--;                              
05090                              }                                      
05091                          }                                          
05092                                                                     
05093                        m_action = action_build_vsnet;                 
05094                      }                                              
05095                   else if (arg == "os9_makefile")
05096                     {
05097                       argc--;
05098                       argv++;
05099                       if (argc > 1)
05100                         {
05101                           cmt_string& s = arguments.add ();
05102                           s = argv[1];
05103 
05104                           m_action = action_build_os9_makefile;
05105                         }
05106                       else
05107                         {
05108                           if (!m_quiet) cout << "#CMT> syntax error : arguments missing " << endl;
05109                           m_help_action = action_help;
05110                           m_action = action_build_os9_makefile;
05111                         }
05112                     }
05113                   else if (arg == "prototype")
05114                     {
05115                       argc--;
05116                       argv++;
05117                       if (argc > 1)
05118                         {
05119                           cmt_string& s = arguments.add ();
05120                           s = argv[1];
05121 
05122                           m_action = action_build_prototype;
05123                         }
05124                       else
05125                         {
05126                           if (!m_quiet) cout << "#CMT> syntax error : arguments missing" << endl;
05127                           m_help_action = action_help;
05128                           m_action = action_build_prototype;
05129                         }
05130                     }
05131                   else if (arg == "readme")
05132                     {
05133                       m_action = action_build_readme;
05134 
05135                       argc--;
05136                       argv++;
05137                       while (argc > 1)
05138                         {
05139                           cmt_string& s = arguments.add ();
05140                           s = argv[1];
05141                           argc--;
05142                           argv++;
05143                         }
05144                     }
05145                   else if (arg == "tag_makefile")
05146                     {
05147                       m_action = action_build_tag_makefile;
05148                     }
05149                   else if (arg == "temporary_name")
05150                     {
05151                       m_action = action_build_temporary_name;
05152                     }
05153                   else if (arg == "triggers")
05154                     {
05155                       argc--;
05156                       argv++;
05157                       if (argc > 1)
05158                         {
05159                           cmt_string& s = arguments.add ();
05160                           s = argv[1];
05161 
05162                           m_action = action_build_triggers;
05163                         }
05164                       else
05165                         {
05166                           if (!m_quiet) cout << "#CMT> syntax error : arguments missing" << endl;
05167                           m_help_action = action_help;
05168                           m_action = action_build_triggers;
05169                         }
05170                     }
05171                   else if (arg == "windefs")
05172                     {
05173                       argc--;
05174                       argv++;
05175                       if (argc > 1)
05176                         {
05177                           cmt_string& s = arguments.add ();
05178                           s = argv[1];
05179 
05180                           m_action = action_build_windefs;
05181                         }
05182                       else
05183                         {
05184                           if (!m_quiet) cout << "#CMT> syntax error : arguments missing" << endl;
05185                           m_help_action = action_help;
05186                           m_action = action_build_windefs;
05187                         }
05188                     }
05189                   else
05190                     {
05191                       if (!m_quiet) cout << "#CMT> syntax error : wrong argument" << endl;
05192                       m_help_action = action_help;
05193                       m_action = action_build;
05194                     }
05195                 }
05196               else
05197                 {
05198                   if (!m_quiet) cout << "#CMT> syntax error : don't know what to build" << endl;
05199                   m_help_action = action_help;
05200                   m_action = action_build;
05201                 }
05202             }
05203           else
05204             {
05205               if (!m_quiet) cout << "#CMT> syntax error : bad verb " << arg << endl;
05206               m_help_action = action_help;
05207             }
05208           break;
05209         case 'c' :
05210           if (arg == "check")
05211             {
05212               argc--;
05213               argv++;
05214 
05215               if (argc > 1)
05216                 {
05217                   arg = argv[1];
05218 
05219                   if (arg == "configuration")
05220                     {
05221                       m_action = action_check_configuration;
05222                     }
05223                   else if (arg == "files")
05224                     {
05225                       argc--;
05226                       argv++;
05227                       if (argc > 1)
05228                         {
05229                           cmt_string& s = arguments.add ();
05230                           s = argv[1];
05231                           argc--;
05232                           argv++;
05233                           if (argc > 1)
05234                             {
05235                               cmt_string& s = arguments.add ();
05236                               s = argv[1];
05237 
05238                               m_action = action_check_files;
05239                             }
05240                           else
05241                             {
05242                               if (!m_quiet) cout << "#CMT> syntax error : reference file name missing" 
05243                                                  << endl;
05244                               m_help_action = action_help;
05245                               m_action = action_check_files;
05246                             }
05247                         }
05248                       else
05249                         {
05250                           if (!m_quiet) cout << "#CMT> syntax error : file name missing" << endl;
05251                           m_help_action = action_help;
05252                           m_action = action_check_files;
05253                         }
05254                     }
05255                   else if (arg == "version")
05256                     {
05257                       argc--;
05258                       argv++;
05259                       if (argc > 1)
05260                         {
05261                           cmt_string& s = arguments.add ();
05262                           s = argv[1];
05263 
05264                           m_action = action_check_version;
05265                         }
05266                       else
05267                         {
05268                           if (!m_quiet) cout << "#CMT> syntax error : package name missing" << endl;
05269                           m_help_action = action_help;
05270                           m_action = action_check_version;
05271                         }
05272                     }
05273                   else
05274                     {
05275                       if (!m_quiet) cout << "#CMT> syntax error : bad check option" << endl;
05276                       m_help_action = action_help;
05277                       m_action = action_check;
05278                     }
05279                 }
05280               else
05281                 {
05282                   if (!m_quiet) cout << "#CMT> syntax error : don't know what to check" << endl;
05283                   m_help_action = action_help;
05284                   m_action = action_check;
05285                 }
05286             }
05287           else if (arg == "check_files")
05288             {
05289               argc--;
05290               argv++;
05291               if (argc > 1)
05292                 {
05293                   cmt_string& s = arguments.add ();
05294                   s = argv[1];
05295                   argc--;
05296                   argv++;
05297                   if (argc > 1)
05298                     {
05299                       cmt_string& s = arguments.add ();
05300                       s = argv[1];
05301 
05302                       m_action = action_check_files;
05303                     }
05304                   else
05305                     {
05306                       if (!m_quiet) cout << "#CMT> syntax error : reference file missing" << endl;
05307                       m_help_action = action_help;
05308                       m_action = action_check_files;
05309                     }
05310                 }
05311               else
05312                 {
05313                   if (!m_quiet) cout << "#CMT> syntax error : file name missing" << endl;
05314                   m_help_action = action_help;
05315                   m_action = action_check_files;
05316                 }
05317             }
05318           else if ((arg == "co") ||
05319                    (arg == "checkout"))
05320             {
05321               // handle all of the command line arguments in a vector
05322               argc--;
05323               argv++;
05324               if (argc > 1)
05325                 {
05326                   m_action = action_checkout;
05327 
05328                   while (argc > 1)
05329                     {
05330                       cmt_string& s = arguments.add ();
05331                       s = argv[1];
05332                       argc--;
05333                       argv++;
05334                     }
05335                 }
05336               else
05337                 {
05338                   if (!m_quiet) cout << "#CMT> syntax error : checkout arguments missing" << endl;
05339                   m_help_action = action_help;
05340                   m_action = action_checkout;
05341                 }
05342             }
05343           else if (arg == "cleanup")
05344             {
05345               m_action = action_cleanup;
05346             }
05347           else if (arg == "config")
05348             {
05349               argc--;
05350               argv++;
05351               if (argc > 1)
05352                 {
05353                   cout << "#---------------------------------------------------------" << endl;
05354                   cout << "# Warning : using 'cmt config ...' to create a package is "
05355                       "becoming obsolete" << endl;
05356                   cout << "# Please use 'cmt create ...' instead" << endl;
05357                   cout << "#---------------------------------------------------------" << endl;
05358 
05359                   m_current_package = argv[1];
05360                   m_current_version.erase (0);
05361                   m_current_path.erase (0);
05362 
05363                   argc--;
05364                   argv++;
05365                   if (argc > 1)
05366                     {
05367                       m_current_version = argv[1];
05368 
05369                       {
05370                         cmt_string& s = arguments.add ();
05371                         s = m_current_package;
05372                       }
05373                       {
05374                         cmt_string& s = arguments.add ();
05375                         s = m_current_version;
05376                       }
05377 
05378                       argc--;
05379                       argv++;
05380                       if (argc > 1)
05381                         {
05382                           m_current_path = argv[1];
05383                           if (m_current_path[0] == '-')
05384                             {
05385                               m_current_path.erase (0);
05386                             }
05387                         }
05388 
05389                       m_action = action_create;
05390                     }
05391                   else
05392                     {
05393                       if (!m_quiet) cout << "#CMT> syntax error : create arguments missing" << endl;
05394                       m_help_action = action_help;
05395                       m_action = action_create;
05396                     }
05397                 }
05398               else
05399                 {
05400                   m_action = action_config;
05401                 }
05402             }
05403           else if (arg == "create")
05404             {
05405               argc--;
05406               argv++;
05407 
05408               if (argc > 1)
05409                 {
05410                   while (argc > 1)
05411                     {
05412                       cmt_string& s = arguments.add ();
05413                       s = argv[1];
05414                       argc--;
05415                       argv++;
05416                     }
05417 
05418                   m_action = action_create;
05419                 }
05420               else
05421                 {
05422                   if (!m_quiet) cout << "#CMT> syntax error : create arguments missing" << endl;
05423                   m_help_action = action_help;
05424                   m_action = action_create;
05425                 }
05426             }
05427           else if (arg == "cvsbranches")
05428             {
05429               argc--;
05430               argv++;
05431               if (argc > 1)
05432                 {
05433                   cmt_string& s = arguments.add ();
05434                   s = argv[1];
05435                   argc--;
05436                   argv++;
05437 
05438                   m_action = action_cvsbranches;
05439                 }
05440               else
05441                 {
05442                   if (!m_quiet) cout << "#CMT> syntax error : cvsbranches arguments missing" << endl;
05443                   m_help_action = action_help;
05444                   m_action = action_cvsbranches;
05445                 }
05446             }
05447           else if (arg == "cvssubpackages")
05448             {
05449               argc--;
05450               argv++;
05451               if (argc > 1)
05452                 {
05453                   cmt_string& s = arguments.add ();
05454                   s = argv[1];
05455                   argc--;
05456                   argv++;
05457 
05458                   m_action = action_cvssubpackages;
05459                 }
05460               else
05461                 {
05462                   if (!m_quiet) cout << "#CMT> syntax error : cvssubpackages arguments missing" << endl;
05463                   m_help_action = action_help;
05464                   m_action = action_cvssubpackages;
05465                 }
05466             }
05467           else if (arg == "cvstags")
05468             {
05469               argc--;
05470               argv++;
05471               if (argc > 1)
05472                 {
05473                   while (argc > 1)
05474                     {
05475                       cmt_string& s = arguments.add ();
05476                       s = argv[1];
05477                       argc--;
05478                       argv++;
05479                     }
05480 
05481                   m_action = action_cvstags;
05482                 }
05483               else
05484                 {
05485                   if (!m_quiet) cout << "#CMT> syntax error : package name missing" << endl;
05486                   m_help_action = action_help;
05487                   m_action = action_cvstags;
05488                 }
05489             }
05490           else
05491             {
05492               if (!m_quiet) cout << "#CMT> syntax error : bad verb " << arg << endl;
05493               m_help_action = action_help;
05494             }
05495           break;
05496         case 'e' :
05497           if (arg == "expand")
05498             {
05499               argc--;
05500               argv++;
05501 
05502               if (argc > 1)
05503                 {
05504                   arg = argv[1];
05505 
05506                   if (arg == "model")
05507                     {
05508                       argc--;
05509                       argv++;
05510 
05511                       if (argc > 1)
05512                         {
05513                           while (argc > 1)
05514                             {
05515                               cmt_string& s = arguments.add ();
05516                               s = argv[1];
05517                               argc--;
05518                               argv++;
05519                             }
05520 
05521                           m_action = action_expand_model;
05522                         }
05523                       else
05524                         {
05525                           if (!m_quiet) cout << "#CMT> syntax error : model not specified" << endl;
05526                           m_help_action = action_help;
05527                           m_action = action_expand_model;
05528                         }
05529                     }
05530                   else
05531                     {
05532                       if (!m_quiet) cout << "#CMT> syntax error : bad expand option" << endl;
05533                       m_help_action = action_help;
05534                       m_action = action_expand_model;
05535                     }
05536                 }
05537               else
05538                 {
05539                   if (!m_quiet) cout << "#CMT> syntax error : don't know what to expand" << endl;
05540                   m_help_action = action_help;
05541                   m_action = action_expand_model;
05542                 }
05543             }
05544           else
05545             {
05546               if (!m_quiet) cout << "#CMT> syntax error : bad verb " << arg << endl;
05547               m_help_action = action_help;
05548             }
05549           break;
05550         case 'f' :
05551           if ((arg == "f") ||
05552               (arg == "fi") ||
05553               (arg == "fil") ||
05554               (arg == "filt") ||
05555               (arg == "filte") ||
05556               (arg == "filter"))
05557             {
05558               // handle all of the command line arguments in a vector
05559               argc--;
05560               argv++;
05561               while (argc > 1)
05562                 {
05563                   cmt_string& s = arguments.add ();
05564                   s = argv[1];
05565                   argc--;
05566                   argv++;
05567                 }
05568 
05569               m_action = action_filter;
05570             }
05571           else
05572             {
05573               if (!m_quiet) cout << "#CMT> syntax error : bad verb " << arg << endl;
05574               m_help_action = action_help;
05575             }
05576           break;
05577         case 'h' :
05578           if ((arg == "h") ||
05579               (arg == "he") ||
05580               (arg == "hel") ||
05581               (arg == "help"))
05582             {
05583               m_help_action = action_help;
05584             }
05585           else
05586             {
05587               if (!m_quiet) cout << "#CMT> syntax error : bad verb " << arg << endl;
05588               m_help_action = action_help;
05589             }
05590           break;
05591         case 'l' :
05592           if (arg == "lock")
05593             {
05594               argc--;
05595               argv++;
05596               if (argc > 1)
05597                 {
05598                   m_current_package = argv[1];
05599                   {
05600                     cmt_string& s = arguments.add ();
05601                     s = m_current_package;
05602                   }
05603 
05604                   m_current_version.erase (0);
05605                   m_current_path.erase (0);
05606 
05607                   argc--;
05608                   argv++;
05609                   if (argc > 1)
05610                     {
05611                       m_current_version = argv[1];
05612 
05613                       {
05614                         cmt_string& s = arguments.add ();
05615                         s = m_current_version;
05616                       }
05617                     
05618                       m_action = action_lock;
05619 
05620                       argc--;
05621                       argv++;
05622                       if (argc > 1)
05623                         {
05624                           m_current_path = argv[1];
05625                           if (m_current_path[0] == '-')
05626                             {
05627                               m_current_path.erase (0);
05628                             }
05629                         }
05630 
05631                       m_current_access = UserMode;
05632                       (Use::current()).set (m_current_package, 
05633                                             m_current_version, 
05634                                             m_current_path);
05635 
05636                     }
05637                   else
05638                     {
05639                       if (!m_quiet) cout << "#CMT> syntax error : version missing" << endl;
05640                       m_help_action = action_help;
05641                       m_action = action_lock;
05642                     }
05643                 }
05644               else
05645                 {
05646                   m_action = action_lock;
05647                 }
05648             }
05649           else
05650             {
05651               if (!m_quiet) cout << "#CMT> syntax error : bad verb " << arg << endl;
05652               m_help_action = action_help;
05653             }
05654           break;
05655         case 'r' :
05656           if (arg == "remove")
05657             {
05658               argc--;
05659               argv++;
05660 
05661               if (argc > 1)
05662                 {
05663                   arg = argv[1];
05664 
05665                   if (arg == "library_links")
05666                     {
05667                       m_action = action_remove_library_links;
05668                     }
05669                   else
05670                     {
05671                       m_current_package = argv[1];
05672                       {
05673                         cmt_string& s = arguments.add ();
05674                         s = m_current_package;
05675                       }
05676                       
05677                       m_current_version.erase (0);
05678                       m_current_path.erase (0);
05679                       
05680                       argc--;
05681                       argv++;
05682                       if (argc > 1)
05683                         {
05684                           m_current_version = argv[1];
05685                           
05686                           {
05687                             cmt_string& s = arguments.add ();
05688                             s = m_current_version;
05689                           }
05690                           
05691                           argc--;
05692                           argv++;
05693                           if (argc > 1)
05694                             {
05695                               m_current_path = argv[1];
05696                               if (m_current_path[0] == '-')
05697                                 {
05698                                   m_current_path.erase (0);
05699                                 }
05700                             }
05701                             
05702                           m_action = action_remove;
05703                         }
05704                       else
05705                         {
05706                           if (!m_quiet) cout << "#CMT> syntax error : version missing" << endl;
05707                           m_help_action = action_help;
05708                           m_action = action_remove;
05709                         }
05710                     }
05711                 }
05712               else
05713                 {
05714                   if (!m_quiet) cout << "#CMT> syntax error : don't know what to remove" << endl;
05715                   m_help_action = action_help;
05716                   m_action = action_remove;
05717                 }
05718             }
05719           else if (arg == "run")
05720             {
05721               argc--;
05722               argv++;
05723               if (argc > 1)
05724                 {
05725                   cmt_string& s = arguments.add ();
05726                   s = argv[1];
05727 
05728                   m_action = action_run;
05729                 }
05730               else
05731                 {
05732                   if (!m_quiet) cout << "#CMT> syntax error : run arguments missing" << endl;
05733                   m_help_action = action_help;
05734                   m_action = action_run;
05735                 }
05736             }
05737           else if (arg == "run_sequence")
05738             {
05739               argc--;
05740               argv++;
05741               if (argc > 1)
05742                 {
05743                   cmt_string& s = arguments.add ();
05744                   s = argv[1];
05745 
05746                   m_action = action_run_sequence;
05747                 }
05748               else
05749                 {
05750                   if (!m_quiet) cout << "#CMT> syntax error : run_sequence arguments missing" << endl;
05751                   m_help_action = action_help;
05752                   m_action = action_run_sequence;
05753                 }
05754             }
05755           else
05756             {
05757               if (!m_quiet) cout << "#CMT> syntax error : bad verb " << arg << endl;
05758               m_help_action = action_help;
05759             }
05760           break;
05761         case 's' :
05762           if (arg == "set")
05763             {
05764               argc--;
05765               argv++;
05766               if (argc > 1)
05767                 {
05768                   arg = argv[1];
05769 
05770                   if (arg == "version")
05771                     {
05772                       argc--;
05773                       argv++;
05774 
05775                       while (argc > 1)
05776                         {
05777                           cmt_string& s = arguments.add ();
05778                           s = argv[1];
05779                           argc--;
05780                           argv++;
05781                         }
05782 
05783                       m_action = action_set_version;
05784                     }
05785                   else if (arg == "versions")
05786                     {
05787                       argc--;
05788                       argv++;
05789 
05790                       while (argc > 1)
05791                         {
05792                           cmt_string& s = arguments.add ();
05793                           s = argv[1];
05794                           argc--;
05795                           argv++;
05796                         }
05797 
05798                       m_action = action_set_versions;
05799 
05800                       if (m_scope_filtering_mode == default_filtering_mode)
05801                         {
05802                           set_scope_filtering_mode (reach_private_uses);
05803                         }
05804                     }
05805                   else
05806                     {
05807                       if (!m_quiet) cout << "#CMT> syntax error : bad set argument" << endl;
05808                       m_help_action = action_help;
05809                       //m_action = action_set;
05810                     }
05811                 }
05812               else
05813                 {
05814                   if (!m_quiet) cout << "#CMT> syntax error : don't know what to set" << endl;
05815                   m_help_action = action_help;
05816                   //m_action = action_set;
05817                 }
05818             }
05819           else if (arg == "setup")
05820             {
05821               m_action = action_setup;
05822             }
05823           else if ((arg == "s") ||
05824                    (arg == "sh") ||
05825                    (arg == "sho") ||
05826                    (arg == "show"))
05827             {
05828               argc--;
05829               argv++;
05830               if (argc > 1)
05831                 {
05832                   arg = argv[1];
05833 
05834                   if (arg == "all_tags")
05835                     {
05836                       m_action = action_show_all_tags;
05837                     }
05838                   else if (arg == "applied_patterns")
05839                     {
05840                       m_action = action_show_applied_patterns;
05841                     }
05842                   else if (arg == "author")
05843                     {
05844                       m_action = action_show_author;
05845                     }
05846                   else if (arg == "branches")
05847                     {
05848                       m_action = action_show_branches;
05849                     }
05850                   else if (arg == "clients")
05851                     {
05852                       argc--;
05853                       argv++;
05854                       if (argc > 1)
05855                         {
05856                           cmt_string& s = arguments.add ();
05857                           s = argv[1];
05858                           m_current_target = argv[1];
05859 
05860                           m_action = action_show_clients;
05861 
05862                           argc--;
05863                           argv++;
05864                           if (argc > 1)
05865                             {
05866                               cmt_string& s = arguments.add ();
05867                               s = argv[1];
05868 
05869                               argc--;
05870                               argv++;
05871                               if (argc > 1)
05872                                 {
05873                                   cmt_string& s = arguments.add ();
05874                                   s = argv[1];
05875                                 }
05876                             }
05877                         }
05878                       else
05879                         {
05880                           if (!m_quiet) cout << "#CMT> syntax error : package name missing" << endl;
05881                           m_help_action = action_help;
05882                           m_action = action_show_clients;
05883                         }
05884                     }
05885                   else if (arg == "cmtpath_patterns")
05886                     {
05887                       m_action = action_show_cmtpath_patterns;
05888                     }
05889                   else if (arg == "constituent")
05890                     {
05891                       argc--;
05892                       argv++;
05893                       if (argc > 1)
05894                         {
05895                           cmt_string& s = arguments.add ();
05896                           s = argv[1];
05897                           m_current_target = argv[1];
05898 
05899                           m_action = action_show_constituent;
05900                         }
05901                       else
05902                         {
05903                           if (!m_quiet) cout << "#CMT> syntax error : constituent name missing" << endl;
05904                           m_help_action = action_help;
05905                           m_action = action_show_constituent;
05906                         }
05907                     }
05908                   else if (arg == "constituent_names")
05909                     {
05910                       m_action = action_show_constituent_names;
05911                     }
05912                   else if (arg == "constituents")
05913                     {
05914                       m_action = action_show_constituents;
05915                     }
05916                   else if (arg == "cycles")
05917                     {
05918                       m_action = action_show_cycles;
05919                     }
05920                   else if (arg == "fragment")
05921                     {
05922                       argc--;
05923                       argv++;
05924                       if (argc > 1)
05925                         {
05926                           cmt_string& s = arguments.add ();
05927                           s = argv[1];
05928                           m_current_target = argv[1];
05929 
05930                           m_action = action_show_fragment;
05931                         }
05932                       else
05933                         {
05934                           if (!m_quiet) cout << "#CMT> syntax error : fragment name missing" << endl;
05935                           m_help_action = action_help;
05936                           m_action = action_show_fragment;
05937                         }
05938                     }
05939                   else if (arg == "fragments")
05940                     {
05941                       m_action = action_show_fragments;
05942                     }
05943                   else if (arg == "groups")
05944                     {
05945                       m_action = action_show_groups;
05946                     }
05947                   else if (arg == "include_dirs")
05948                     {
05949                       m_action = action_show_include_dirs;
05950                     }
05951                   else if (arg == "language")
05952                     {
05953                       argc--;
05954                       argv++;
05955                       if (argc > 1)
05956                         {
05957                           cmt_string& s = arguments.add ();
05958                           s = argv[1];
05959                           m_current_target = argv[1];
05960 
05961                           m_action = action_show_language;
05962                         }
05963                       else
05964                         {
05965                           if (!m_quiet) cout << "#CMT> syntax error : language name missing" << endl;
05966                           m_help_action = action_help;
05967                           m_action = action_show_language;
05968                         }
05969                     }
05970                   else if (arg == "languages")
05971                     {
05972                       m_action = action_show_languages;
05973                     }
05974                   else if (arg == "macro")
05975                     {
05976                       argc--;
05977                       argv++;
05978                       if (argc > 1)
05979                         {
05980                           cmt_string& s = arguments.add ();
05981                           s = argv[1];
05982                           m_current_target = argv[1];
05983 
05984                           m_action = action_show_macro;
05985                         }
05986                       else
05987                         {
05988                           if (!m_quiet) cout << "#CMT> syntax error : macro name missing" << endl;
05989                           m_help_action = action_help;
05990                           m_action = action_show_macro;
05991                         }
05992                     }
05993                   else if (arg == "macro_names")
05994                     {
05995                       argc--;
05996                       argv++;
05997                       if (argc > 1)
05998                         {
05999                           cmt_string& s = arguments.add ();
06000                           s = argv[1];
06001                         }
06002 
06003                       m_action = action_show_macro_names;
06004                     }
06005                   else if (arg == "macro_value")
06006                     {
06007                       m_quiet = true;
06008                       argc--;
06009                       argv++;
06010                       if (argc > 1)
06011                         {
06012                           cmt_string& s = arguments.add ();
06013                           s = argv[1];
06014                           m_current_target = argv[1];
06015 
06016                           m_action = action_show_macro_value;
06017                         }
06018                       else
06019                         {
06020                           if (!m_quiet) cout << "#CMT> syntax error : macro name missing" << endl;
06021                           m_help_action = action_help;
06022                           m_action = action_show_macro_value;
06023                         }
06024                     }
06025                   else if (arg == "macros")
06026                     {
06027                       argc--;
06028                       argv++;
06029                       if (argc > 1)
06030                         {
06031                           cmt_string& s = arguments.add ();
06032                           s = argv[1];
06033                         }
06034 
06035                       m_action = action_show_macros;
06036                     }
06037                   else if (arg == "manager")
06038                     {
06039                       m_action = action_show_manager;
06040                     }
06041                   else if (arg == "packages")
06042                     {
06043                       argc--;
06044                       argv++;
06045                       if (argc > 1)
06046                         {
06047                           cmt_string& s = arguments.add ();
06048                           s = argv[1];
06049                           m_current_target = argv[1];
06050                         }
06051 
06052                       m_action = action_show_packages;
06053                     }
06054                   else if (arg == "path")
06055                     {
06056                       m_action = action_show_path;
06057                     }
06058                   else if (arg == "pattern")
06059                     {
06060                       argc--;
06061                       argv++;
06062                       if (argc > 1)
06063                         {
06064                           cmt_string& s = arguments.add ();
06065                           s = argv[1];
06066                           m_current_target = argv[1];
06067 
06068                           m_action = action_show_pattern;
06069                         }
06070                       else
06071                         {
06072                           if (!m_quiet) cout << "#CMT> syntax error : pattern name missing" << endl;
06073                           m_help_action = action_help;
06074                           m_action = action_show_pattern;
06075                         }
06076                     }
06077                   else if (arg == "pattern_names")
06078                     {
06079                       m_action = action_show_pattern_names;
06080                     }
06081                   else if (arg == "patterns")
06082                     {
06083                       m_action = action_show_patterns;
06084                     }
06085                   else if (arg == "projects")
06086                     {
06087                       m_action = action_show_projects;
06088                     }
06089                   else if (arg == "pwd")
06090                     {
06091                       m_action = action_show_pwd;
06092                     }
06093                   else if (arg == "setup")
06094                     {
06095                       m_action = action_show_setup;
06096 
06097                       if (m_scope_filtering_mode == default_filtering_mode)
06098                         {
06099                           set_scope_filtering_mode (reach_private_uses);
06100                         }
06101                     }
06102                   else if (arg == "set_names")
06103                     {
06104                       argc--;
06105                       argv++;
06106                       if (argc > 1)
06107                         {
06108                           cmt_string& s = arguments.add ();
06109                           s = argv[1];
06110                         }
06111 
06112                       m_action = action_show_set_names;
06113                     }
06114                   else if (arg == "set_value")
06115                     {
06116                       m_quiet = true;
06117                       argc--;
06118                       argv++;
06119                       if (argc > 1)
06120                         {
06121                           cmt_string& s = arguments.add ();
06122                           s = argv[1];
06123                           m_current_target = argv[1];
06124 
06125                           m_action = action_show_set_value;
06126                         }
06127                       else
06128                         {
06129                           if (!m_quiet) cout << "#CMT> syntax error : set name missing" << endl;
06130                           m_help_action = action_help;
06131                           m_action = action_show_set_value;
06132                         }
06133                     }
06134                   else if (arg == "set")
06135                     {
06136                       argc--;
06137                       argv++;
06138                       if (argc > 1)
06139                         {
06140                           cmt_string& s = arguments.add ();
06141                           s = argv[1];
06142                           m_current_target = argv[1];
06143 
06144                           m_action = action_show_set;
06145                         }
06146                       else
06147                         {
06148                           if (!m_quiet) cout << "#CMT> syntax error : set name missing" << endl;
06149                           m_help_action = action_help;
06150                           m_action = action_show_set;
06151                         }
06152                     }
06153                   else if (arg == "sets")
06154                     {
06155                       argc--;
06156                       argv++;
06157                       if (argc > 1)
06158                         {
06159                           cmt_string& s = arguments.add ();
06160                           s = argv[1];
06161                         }
06162 
06163                       m_action = action_show_sets;
06164                     }
06165                   else if (arg == "strategies")
06166                     {
06167                       m_action = action_show_strategies;
06168                     }
06169                   else if (arg == "tags")
06170                     {
06171                       m_action = action_show_tags;
06172                     }
06173                   else if (arg == "use_paths")
06174                     {
06175                       argc--;
06176                       argv++;
06177                       if (argc > 1)
06178                         {
06179                           while (argc > 1)
06180                             {
06181                               if (strcmp (argv[1], "-private") == 0)
06182                                 {
06183                                   set_scope_filtering_mode (reach_private_uses);
06184                                 }
06185                               else if (strcmp (argv[1], "--private") == 0)
06186                                 {
06187                                   set_scope_filtering_mode (reach_private_uses);
06188                                 }
06189                               else
06190                                 {
06191                                   cmt_string& s = arguments.add ();
06192                                   s = argv[1];
06193                                 }
06194 
06195                               argc--;
06196                               argv++;
06197                             }
06198 
06199                           m_action = action_show_use_paths;
06200                         }
06201                       else
06202                         {
06203                           if (!m_quiet) cout << "#CMT> syntax error : package name missing" << endl;
06204                           m_help_action = action_help;
06205                           m_action = action_show_use_paths;
06206                         }
06207                     }
06208                   else if ((arg == "u") ||
06209                            (arg == "us") ||
06210                            (arg == "use") ||
06211                            (arg == "uses"))
06212                     {
06213                       m_action = action_show_uses;
06214 
06215                       if (m_scope_filtering_mode == default_filtering_mode)
06216                         {
06217                           set_scope_filtering_mode (reach_private_uses);
06218                         }
06219                     }
06220                   else if (arg == "version")
06221                     {
06222                       m_action = action_show_version;
06223                     }
06224                   else if (arg == "versions")
06225                     {
06226                       argc--;
06227                       argv++;
06228                       if (argc > 1)
06229                         {
06230                           cmt_string& s = arguments.add ();
06231                           s = argv[1];
06232                           m_current_target = argv[1];
06233 
06234                           m_action = action_show_versions;
06235                         }
06236                       else
06237                         {
06238                           if (!m_quiet) cout << "#CMT> syntax error : package name missing" << endl;
06239                           m_help_action = action_help;
06240                           m_action = action_show_versions;
06241                         }
06242                     }
06243                   else
06244                     {
06245                       if (!m_quiet) cout << "#CMT> syntax error : bad show argument" << endl;
06246                       m_help_action = action_help;
06247                       m_action = action_show;
06248                     }
06249                 }
06250               else
06251                 {
06252                   if (!m_quiet) cout << "#CMT> syntax error : don't know what to show" << endl;
06253                   m_help_action = action_help;
06254                   m_action = action_show;
06255                 }
06256             }
06257           else if (arg == "system")
06258             {
06259               m_action = action_system;
06260             }
06261           else
06262             {
06263               if (!m_quiet) cout << "#CMT> syntax error : bad verb " << arg << endl;
06264               m_help_action = action_help;
06265             }
06266 
06267           break;
06268         case 'u' :
06269           if (arg == "unlock")
06270             {
06271               argc--;
06272               argv++;
06273               if (argc > 1)
06274                 {
06275                   m_current_package = argv[1];
06276                   {
06277                     cmt_string& s = arguments.add ();
06278                     s = m_current_package;
06279                   }
06280 
06281                   m_current_version.erase (0);
06282                   m_current_path.erase (0);
06283                                         
06284                   argc--;
06285                   argv++;
06286                   if (argc > 1)
06287                     {
06288                       m_current_version = argv[1];
06289 
06290                       {
06291                         cmt_string& s = arguments.add ();
06292                         s = m_current_version;
06293                       }
06294                                                 
06295                       m_action = action_unlock;
06296 
06297                       argc--;
06298                       argv++;
06299                       if (argc > 1)
06300                         {
06301                           m_current_path = argv[1];
06302                           if (m_current_path[0] == '-')
06303                             {
06304                               m_current_path.erase (0);
06305                             }
06306                         }
06307                                                 
06308                       m_current_access = UserMode;
06309                       (Use::current()).set (m_current_package, 
06310                                             m_current_version, 
06311                                             m_current_path);
06312 
06313                     }
06314                   else
06315                     {
06316                       if (!m_quiet) cout << "#CMT> syntax error : version missing" << endl;
06317                       m_help_action = action_help;
06318                       m_action = action_unlock;
06319                     }
06320                 }
06321               else
06322                 {
06323                   m_action = action_unlock;
06324                 }
06325             }
06326           else
06327             {
06328               if (!m_quiet) cout << "#CMT> syntax error : bad verb " << arg << endl;
06329               m_help_action = action_help;
06330             }
06331 
06332           break;
06333         case 'v' :
06334           if ((arg == "v") ||
06335               (arg == "ve") ||
06336               (arg == "ver") ||
06337               (arg == "vers") ||
06338               (arg == "versi") ||
06339               (arg == "versio") ||
06340               (arg == "version"))
06341             {
06342               m_action = action_version;
06343             }
06344           else
06345             {
06346               if (!m_quiet) cout << "#CMT> syntax error : bad verb " << arg << endl;
06347               m_help_action = action_help;
06348             }
06349           break;
06350         case '+' :
06351           if (arg.substr (0, 6) == "+path=")
06352             {
06353               arg.erase (0, 6);
06354               CmtSystem::add_cmt_path (arg, "argument",
06355                                        m_cmt_path, 
06356                                        m_cmt_path_pwds, 
06357                                        m_cmt_path_sources);
06358             }
06359           else
06360             {
06361               if (!m_quiet) cout << "#CMT> syntax error : bad verb " 
06362                                << arg << endl;
06363               m_help_action = action_help;
06364             }
06365 
06366           break;
06367         case '-' :
06368           if ((arg == "-help") ||
06369               (arg == "--help"))
06370             {
06371               m_help_action = action_help;
06372             }
06373           else if (arg == "-n")
06374             {
06375               m_simulation = true;
06376             }
06377           else if ((arg == "-q") ||
06378                    (arg == "-qu") ||
06379                    (arg == "-qui") ||
06380                    (arg == "-quie") ||
06381                    (arg == "-quiet"))
06382             {
06383               m_quiet = true;
06384             }
06385           else if (arg == "-csh")
06386             {
06387               mode = Csh;
06388             }
06389           else if (arg == "-sh")
06390             {
06391               mode = Sh;
06392             }
06393           else if (arg == "-bat")
06394             {
06395               mode = Bat;
06396             }
06397           else if (arg.substr (0, 5) == "-use=")
06398             {
06399               arg.erase (0, 5);
06400 
06401               if (m_action != action_create)
06402                 {
06403                   CmtSystem::cmt_string_vector words;
06404 
06405                   CmtSystem::split (arg, ":", words);
06406 
06407                   m_current_access = UserMode;
06408 
06409                   if (words.size () > 0) m_current_package = words[0];
06410                   if (words.size () > 1) m_current_version = words[1];
06411                   if (words.size () > 2) m_current_path    = words[2];
06412                   (Use::current()).set (m_current_package, 
06413                                         m_current_version, 
06414                                         m_current_path);
06415                 }
06416             }
06417           else if (arg.substr (0, 6) == "-pack=")
06418             {
06419               arg.erase (0, 6);
06420               if ((m_action != action_create) && (m_current_package != arg))
06421                 {
06422                   //CmtSystem::cd (m_default_path);
06423 
06424                   m_current_access = UserMode;
06425 
06426                   m_current_package = arg;
06427                   m_current_version = "";
06428                   m_current_path    = m_default_path;
06429 
06430                   (Use::current()).set (m_current_package, 
06431                                         m_current_version, 
06432                                         m_current_path);
06433                 }
06434             }
06435           else if (arg.substr (0, 9) == "-version=")
06436             {
06437               arg.erase (0, 9);
06438               if ((m_action != action_create) && (m_current_version != arg))
06439                 {
06440                   m_current_access = UserMode;
06441                   m_current_version = arg;
06442                   (Use::current()).set (m_current_package, 
06443                                         m_current_version, 
06444                                         m_current_path);
06445                 }
06446             }
06447           else if (arg.substr (0, 6) == "-path=")
06448             {
06449               arg.erase (0, 6);
06450 
06451               /*
06452               cerr << "-path=" << arg << 
06453                 " cp=" << m_current_package <<
06454                 " cv=" << m_current_version <<
06455                 " cp=" << m_current_path << endl;
06456               */
06457 
06458               if ((m_action != action_create) && (m_current_path != arg))
06459                 {
06460                   m_current_access = UserMode;
06461                   m_current_path = arg;
06462                   (Use::current()).set (m_current_package, 
06463                                         m_current_version, 
06464                                         m_current_path);
06465 
06466                   CmtSystem::add_cmt_path (m_current_path, "argument",
06467                                            m_cmt_path, 
06468                                            m_cmt_path_pwds, 
06469                                            m_cmt_path_sources);
06470                 }
06471             }
06472           else if (arg.substr (0, 3) == "-f=")
06473             {
06474               arg.substr (3, extra_file);
06475             }
06476           else if (arg.substr (0, 3) == "-e=")
06477             {
06478               cout << "extra statement = " << arg << endl;
06479               arg.substr (3, extra_line);
06480             }
06481           else if (arg.substr (0, 6) == "-home=")
06482             {
06483               arg.erase (0, 6);
06484               if (CmtSystem::test_directory (arg))
06485                 {
06486                   m_cmt_home = arg;
06487                 }
06488             }
06489           else if (arg.substr (0, 5) == "-tag=")
06490             {
06491                 /*
06492                   Here we are going to change the complete tag set
06493                 */
06494 
06495               Tag* tag;
06496               CmtSystem::cmt_string_vector words;
06497               
06499               Tag::clear_all ();
06500               Cmt::m_extra_tags = ",";
06501 
06503               configure_version_tag ();
06504               configure_site_tag (0);
06505               configure_uname_tag ();
06506               configure_hosttype_tag ();
06507               configure_config_tag ();
06508 
06509               arg.erase (0, 5);
06510 
06511               CmtSystem::split (arg, " \t,", words);
06512 
06513               for (int i = 0; i < words.size (); i++)
06514                 {
06515                   const cmt_string& a = words[i];
06516 
06517                   cmt_string s = ",";
06518                   s += a;
06519                   s += ",";
06520 
06521                   if (i == 0)
06522                     {
06523                       m_current_tag = a;
06524 
06525                       if (CmtSystem::testenv ("TAGDEBUG")) cerr 
06526                           << "parse_argument(tag_add)> current_tag=" << m_current_tag << endl;
06527                     }
06528 
06529                   if (Cmt::m_extra_tags.find (s) == cmt_string::npos)
06530                     {
06531                       //if (!m_quiet) cerr << "  a=[" << a << "]" << endl;
06532                       
06534                       if (a == CmtSystem::get_cmt_config ())
06535                         {
06536                           configure_uname_tag ();
06537                         }
06538                       
06539                       tag = Tag::add (a, PriorityArgument, "arguments", 0);
06540                       
06541                       tag->mark ();
06542 
06543                       Cmt::m_extra_tags += a;
06544                       Cmt::m_extra_tags += ",";
06545                     }
06546                 }
06547             }
06548           else if (arg.substr (0, 9) == "-tag_add=")
06549             {
06550               Tag* tag;
06551               CmtSystem::cmt_string_vector words;
06552               
06553               arg.erase (0, 9);
06554 
06555               //if (!m_quiet) cerr << "-tag_add=" << arg << endl;
06556 
06557               CmtSystem::split (arg, " \t,", words);
06558 
06559               for (int i = 0; i < words.size (); i++)
06560                 {
06561                   const cmt_string& a = words[i];
06562 
06563                   cmt_string s = ",";
06564                   s += a;
06565                   s += ",";
06566 
06567                   if (Cmt::m_extra_tags.find (s) == cmt_string::npos)
06568                     {
06569                         //if (!m_quiet) cerr << "  a=[" << a << "]" << endl;
06570 
06572                       if (a == CmtSystem::get_cmt_config ())
06573                         {
06574                           configure_uname_tag ();
06575                         }
06576                       
06577                       tag = Tag::add (a, PriorityUserTag, "arguments", 0);
06578                       
06579                       tag->mark ();
06580 
06581                       Cmt::m_extra_tags += a;
06582                       Cmt::m_extra_tags += ",";
06583                     }
06584                 }
06585             }
06586           else if (arg.substr (0, 12) == "-tag_remove=")
06587             {
06588               Tag::TagPtrVector tags = Tag::tags ();
06589               int i;
06590               Tag* tag;
06591 
06592               /*
06593               for (i = 0; i < tags.size (); i++)
06594                 {
06595                   tag = tags[i];
06596                   if ((tag != 0) &&
06597                       (tag->selected))
06598                     {
06599                         if (!m_quiet) cerr << "  original tag_list=" << tag->name << tag->priority << endl;
06600                     }
06601                 }
06602               */
06603 
06604               CmtSystem::cmt_string_vector words;
06605 
06606               arg.erase (0, 12);
06607 
06608               //if (!m_quiet) cerr << "-arg_remove=" << arg << endl;
06609 
06610               CmtSystem::split (arg, " \t,", words);
06611 
06612                 //
06613                 // Now erase all entries in the old list that match
06614                 // the specified tags 
06615                 //
06616 
06617               for (i = 0; i < words.size (); i++)
06618                 {
06619                   const cmt_string& a = words[i];
06620 
06621                   cmt_string s = ",";
06622                   s += a;
06623                   s += ",";
06624 
06625                   int pos;
06626 
06627                   pos = Cmt::m_extra_tags.find (s);
06628 
06629                   if (pos != cmt_string::npos)
06630                     {
06631                       Cmt::m_extra_tags.erase (pos, s.size () - 1);
06632                     }
06633 
06634                   //if (!m_quiet) cerr << "  tag_list=[" << tag_list << "]" << endl;
06635                 }
06636 
06637                 //
06638                 // Now reinject the purged list of tags into the database
06639                 // exactly as when using -tag=
06640                 //
06641 
06643               Tag::unmark_all ();
06644 
06646               configure_version_tag ();
06647               configure_site_tag (0);
06648               configure_uname_tag ();
06649               configure_hosttype_tag ();
06650               
06651               CmtSystem::split (Cmt::m_extra_tags, " \t,", words);
06652 
06653               for (i = 0; i < words.size (); i++)
06654                 {
06655                   const cmt_string& a = words[i];
06656 
06657                   //fprintf (stderr, "  a=[%s]\n", a.c_str ());
06658 
06660                   if (a == CmtSystem::get_cmt_config ())
06661                     {
06662                       configure_uname_tag ();
06663                     }
06664 
06665                   if (i == 0)
06666                     {
06667                       m_current_tag = a;
06668 
06669                       //if (!m_quiet) cerr << "parse_argument(tag_remove)> current_tag=" 
06670                         //<< m_current_tag << endl;
06671 
06672                       tag = Tag::add (a, PriorityTag, "restore configuration", 0);
06673                     }
06674                   else
06675                     {
06676                       tag = Tag::add (a, PriorityUserTag, "restore configuration", 0);
06677                     }
06678 
06679                   tag->mark ();
06680                 }
06681             }
06682           else if (arg.substr (0, 14) == "-user_context=")
06683             {
06684               arg.erase (0, 14);
06685               if (CmtSystem::test_directory (arg))
06686                 {
06687                   m_cmt_user_context = arg;
06688                 }
06689             }
06690           else if (arg == "--version")
06691             {
06692               m_action = action_version;
06693             }
06694           else if (arg.substr (0, 23) == "-with_version_directory")
06695             {
06696               m_current_structuring_style = with_version_directory;
06697             }
06698           else if (arg.substr (0, 26) == "-without_version_directory")
06699             {
06700               m_current_structuring_style = without_version_directory;
06701             }
06702           else if (arg.substr (0, 11) == "-no_cleanup")
06703             {
06704               m_current_setup_strategy |= SetupNoCleanup;
06705             }
06706           else if ((arg == "-private") ||
06707                    (arg == "--private"))
06708             {
06709               set_scope_filtering_mode (reach_private_uses);
06710             }
06711           else if ((arg == "-public") ||
06712                    (arg == "--public"))
06713             {
06714               set_scope_filtering_mode (block_private_uses);
06715             }
06716           else
06717             {
06718               if (!m_quiet) cout << "#CMT> syntax error : bad verb " << arg << endl;
06719               m_help_action = action_help;
06720             }
06721 
06722           break;
06723         default:
06724           if (!m_quiet) cout << "#CMT> syntax error : bad command parameter " << arg << endl;
06725           m_help_action = action_help;
06726           break;
06727         }
06728 
06729       argc--;
06730       argv++;
06731     }
06732 }

int Cmt::parser ( int argc,
char * argv[]?) [static]
?

Definition at line 6760 of file cmt_parser.cxx.

06761 {
06762   PrintMode mode = Csh;
06763   CmtSystem::cmt_string_vector arguments;
06764   cmt_string extra_line;
06765   cmt_string extra_file;
06766 
06767   if (argc <= 1)
06768     {
06769       do_help ();
06770       exit (0);
06771     }
06772 
06773   clear ();
06774   configure ();
06775 
06776   CmtError::clear ();
06777 
06778   /*
06779     Set private if positioned inside the package
06780     (which is detected since we were able to retreive the
06781     Version, Package and Path)
06782   */
06783 
06784   if ((m_current_path.size () == 0) ||
06785       (m_current_package.size () == 0) ||
06786       (m_current_version.size () == 0))
06787     {
06788       m_current_access = UserMode;
06789     }
06790   else
06791     {
06792       m_current_access = DeveloperMode;
06793     }
06794 
06795   parse_arguments (argc, argv, arguments,
06796                    extra_line, extra_file, mode);
06797 
06798   if (m_configure_error != "")
06799     {
06800       if (!m_quiet) cout << "# CMT>" << m_configure_error << endl;
06801     }
06802 
06803   if (CmtError::has_pending_error ())
06804     {
06805       int code = CmtError::get_last_error_code ();
06806       if (!m_quiet) CmtError::print ();
06807       clear ();
06808 
06809       return (code);
06810     }
06811 
06812   if (m_debug)
06813     {
06814       cout << "After parse_argument> pack=" << m_current_package
06815            << " m_current_tag=" << m_current_tag
06816            << " cwd=" << CmtSystem::pwd () 
06817            << endl;
06818     }
06819 
06820   /*
06821     Now actual requirements analysis can take place.
06822 
06823     Extra lines or files are analysed first.
06824   */
06825 
06826   if (strlen (extra_file.c_str ()) > 0) SyntaxParser::parse_requirements (extra_file, 0);
06827   if (strlen (extra_line.c_str ()) > 0) SyntaxParser::parse_requirements_line (extra_line, 0);
06828 
06829   //
06830   //  For some of the actions, the CMT package must be automatically
06831   //  included
06832   //
06833 
06834   if (m_debug) cout << "parser1> current_tag=" << m_current_tag << endl;
06835 
06836   if (m_help_action == action_help)
06837     {
06838       do_help (m_action);
06839       return (0);
06840     }
06841 
06842   switch (m_action)
06843     {
06844       // case action_none :
06845     case action_awk :
06846     case action_broadcast :
06847     case action_build_constituent_makefile :
06848     case action_build_constituents_makefile :
06849     case action_build_dependencies :
06850     case action_build_library_links :
06851     case action_build_make_setup :
06852     case action_build_msdev :
06853     case action_build_vsnet :     
06854     case action_build_os9_makefile :
06855       // case action_build_prototype :
06856     case action_build_readme :
06857     case action_build_tag_makefile :
06858       // case action_build_temporary_name :
06859     case action_build_triggers :
06860     case action_build_windefs :
06861     case action_check_configuration :
06862       // case action_check_files :
06863       // case action_check_version :
06864     case action_checkout :
06865     case action_cleanup :
06866     case action_config :
06867     case action_create :
06868       // case action_cvsbranches :
06869       // case action_cvssubpackages :
06870       // case action_cvstags :
06871     case action_expand_model :
06872     case action_filter :
06873       // case action_help :
06874     case action_load :
06875     case action_lock :
06876     case action_remove :
06877     case action_remove_library_links :
06878     case action_run :
06879     case action_run_sequence :
06880     case action_set_version :
06881     case action_set_versions :
06882     case action_setup :
06883     case action_show_all_tags :
06884     case action_show_applied_patterns :
06885       // case action_show_author :
06886       // case action_show_branches :
06887       // case action_show_clients :
06888     case action_show_cmtpath_patterns :
06889       // case action_show_constituent :
06890       // case action_show_constituent_names :
06891       // case action_show_constituents :
06892     case action_show_cycles :
06893     case action_show_fragment :
06894     case action_show_fragments :
06895     case action_show_groups :
06896     case action_show_include_dirs :
06897     case action_show_language :
06898     case action_show_languages :
06899     case action_show_macro :
06900     case action_show_macro_names :
06901     case action_show_macro_value :
06902     case action_show_macros :
06903       // case action_show_manager :
06904       // case action_show_packages :
06905     case action_show_path :
06906     case action_show_pattern :
06907     case action_show_pattern_names :
06908     case action_show_patterns :
06909     case action_show_projects :
06910       // case action_show_pwd :
06911     case action_show_setup :
06912     case action_show_set :
06913     case action_show_set_names :
06914     case action_show_set_value :
06915     case action_show_sets :
06916     case action_show_strategies :
06917     case action_show_tags :
06918     case action_show_use_paths :
06919     case action_show_uses :
06920     case action_show_version :
06921       // case action_show_versions :
06922       // case action_system :
06923     case action_unlock :
06924     case action_version :
06925       use_cmt ();
06926         //
06927         // Now parse the requirements file stored in ${CMTHOME}
06928         //
06929       
06930       use_home_requirements ();
06931 
06932       break;
06933     default:
06934       break;
06935     }
06936 
06937   if (m_debug) cout << "parser2> current_tag=" << m_current_tag << endl;
06938 
06939   //
06940   // Setting up recursive actions
06941   //
06942 
06943   switch (m_action)
06944     {
06945       // case action_none :
06946     case action_awk :
06947     case action_broadcast :
06948     case action_build_constituent_makefile :
06949     case action_build_constituents_makefile :
06950     case action_build_dependencies :
06951     case action_build_library_links :
06952     case action_build_make_setup :
06953     case action_build_msdev :
06954     case action_build_vsnet :     
06955     case action_build_os9_makefile :
06956       // case action_build_prototype :
06957     case action_build_readme :
06958     case action_build_tag_makefile :
06959       // case action_build_temporary_name :
06960     case action_build_triggers :
06961     case action_build_windefs :
06962     case action_check_configuration :
06963       // case action_check_files :
06964       // case action_check_version :
06965       // case action_checkout :
06966     case action_cleanup :
06967     case action_config :
06968       // case action_create :
06969       // case action_cvsbranches :
06970       // case action_cvssubpackages :
06971       // case action_cvstags :
06972     case action_expand_model :
06973     case action_filter :
06974       // case action_help :
06975     case action_load :
06976       // case action_lock :
06977       // case action_remove :
06978     case action_remove_library_links :
06979     case action_run :
06980     case action_run_sequence :
06981       // case action_set_version :
06982     case action_set_versions :
06983     case action_setup :
06984     case action_show_all_tags :
06985     case action_show_applied_patterns :
06986       // case action_show_author :
06987       // case action_show_branches :
06988       // case action_show_clients :
06989     case action_show_cmtpath_patterns :
06990     case action_show_constituent :
06991     case action_show_constituent_names :
06992     case action_show_constituents :
06993     case action_show_cycles :
06994     case action_show_fragment :
06995     case action_show_fragments :
06996     case action_show_groups :
06997     case action_show_include_dirs :
06998     case action_show_language :
06999     case action_show_languages :
07000     case action_show_macro :
07001     case action_show_macro_names :
07002     case action_show_macro_value :
07003     case action_show_macros :
07004       // case action_show_manager :
07005       // case action_show_packages :
07006     case action_show_path :
07007     case action_show_pattern :
07008     case action_show_pattern_names :
07009     case action_show_patterns :
07010     case action_show_projects :
07011       // case action_show_pwd :
07012     case action_show_setup :
07013     case action_show_set :
07014     case action_show_set_names :
07015     case action_show_set_value :
07016     case action_show_sets :
07017     case action_show_strategies :
07018     case action_show_tags :
07019     case action_show_use_paths :
07020     case action_show_uses :
07021       // case action_show_version :
07022       // case action_show_versions :
07023       // case action_system :
07024       // case action_unlock :
07025       // case action_version :
07026       m_recursive = true;
07027       break;
07028     default:
07029       m_recursive = false;
07030       break;
07031     }
07032 
07033   //
07034   //  Actions for which the context of the package is checked,
07035   //  and the requirements file is analysed.
07036   //
07037 
07038   switch (m_action)
07039     {
07040     case action_none :
07041     case action_awk :
07042     case action_broadcast :
07043     case action_build_constituent_makefile :
07044     case action_build_constituents_makefile :
07045     case action_build_dependencies :
07046     case action_build_library_links :
07047     case action_build_make_setup :
07048     case action_build_msdev :
07049     case action_build_vsnet :     
07050     case action_build_os9_makefile :
07051       // case action_build_prototype :
07052     case action_build_readme :
07053     case action_build_tag_makefile :
07054       // case action_build_temporary_name :
07055     case action_build_triggers :
07056     case action_build_windefs :
07057     case action_check_configuration :
07058       // case action_check_files :
07059       // case action_check_version :
07060       // case action_checkout :
07061     case action_cleanup :
07062     case action_config :
07063       // case action_create :
07064       // case action_cvsbranches :
07065       // case action_cvssubpackages :
07066       // case action_cvstags :
07067     case action_expand_model :
07068     case action_filter :
07069       // case action_help :
07070     case action_load :
07071     case action_lock :
07072       // case action_remove :
07073     case action_remove_library_links :
07074     case action_run :
07075       // case action_run_sequence :
07076       // case action_set_version :
07077     case action_set_versions :
07078     case action_setup :
07079     case action_show_all_tags :
07080     case action_show_applied_patterns :
07081     case action_show_author :
07082     case action_show_branches :
07083       // case action_show_clients :
07084     case action_show_cmtpath_patterns :
07085     case action_show_constituent :
07086     case action_show_constituent_names :
07087     case action_show_constituents :
07088     case action_show_cycles :
07089     case action_show_fragment :
07090     case action_show_fragments :
07091     case action_show_groups :
07092     case action_show_include_dirs :
07093     case action_show_language :
07094     case action_show_languages :
07095     case action_show_macro :
07096     case action_show_macro_names :
07097     case action_show_macro_value :
07098     case action_show_macros :
07099     case action_show_manager :
07100       // case action_show_packages :
07101     case action_show_path :
07102     case action_show_pattern :
07103     case action_show_pattern_names :
07104     case action_show_patterns :
07105     case action_show_projects :
07106     case action_show_pwd :
07107     case action_show_setup :
07108     case action_show_set :
07109     case action_show_set_names :
07110     case action_show_set_value :
07111     case action_show_sets :
07112     case action_show_strategies :
07113     case action_show_tags :
07114     case action_show_use_paths :
07115     case action_show_uses :
07116     case action_show_version :
07117       // case action_show_versions :
07118       // case action_system :
07119     case action_unlock :
07120       // case action_version :
07121       reach_current_package ();
07122       use_user_context_requirements ();
07123       break;
07124     default:
07125       break;
07126     }
07127 
07128   if (m_debug) cout << "parser3> current_tag=" << m_current_tag << endl;
07129 
07130   //
07131   // Perform some actions even if there is an error
07132   //
07133 
07134   if (CmtError::has_pending_error ())
07135     {
07136       int code = CmtError::get_last_error_code ();
07137       if (!m_quiet) CmtError::print ();
07138 
07139       switch (m_action)
07140         {
07141           // case action_none :
07142           // case action_awk :
07143           // case action_broadcast :
07144         case action_build_constituent_makefile :
07145         case action_build_constituents_makefile :
07146         case action_build_dependencies :
07147         case action_build_library_links :
07148         case action_build_make_setup :
07149         case action_build_msdev :
07150         case action_build_vsnet :     
07151         case action_build_os9_makefile :
07152         case action_build_prototype :
07153         case action_build_readme :
07154         case action_build_tag_makefile :
07155           // case action_build_temporary_name :
07156         case action_build_triggers :
07157         case action_build_windefs :
07158         case action_check_configuration :
07159           // case action_check_files :
07160           // case action_check_version :
07161           // case action_checkout :
07162         case action_cleanup :
07163           // case action_config :
07164           // case action_create :
07165           // case action_cvsbranches :
07166           // case action_cvssubpackages :
07167           // case action_cvstags :
07168           // case action_expand_model :
07169           // case action_filter :
07170           // case action_help :
07171         case action_load :
07172         case action_lock :
07173         case action_remove :
07174         case action_remove_library_links :
07175           // case action_run :
07176         case action_run_sequence :
07177           // case action_set_version :
07178           // case action_set_versions :
07179         case action_setup :
07180           // case action_show_all_tags :
07181           // case action_show_applied_patterns :
07182           // case action_show_author :
07183           // case action_show_branches :
07184           // case action_show_clients :
07185           // case action_show_cmtpath_patterns :
07186           // case action_show_constituent :
07187           // case action_show_constituent_names :
07188           // case action_show_constituents :
07189           // case action_show_cycles :
07190           // case action_show_fragment :
07191           // case action_show_fragments :
07192           // case action_show_groups :
07193           // case action_show_include_dirs :
07194           // case action_show_language :
07195           // case action_show_languages :
07196           // case action_show_macro :
07197           // case action_show_macro_names :
07198           // case action_show_macro_value :
07199           // case action_show_macros :
07200           // case action_show_manager :
07201           // case action_show_packages :
07202           // case action_show_path :
07203           // case action_show_pattern :
07204           // case action_show_pattern_names :
07205           // case action_show_patterns :
07206           // case action_show_projects :
07207           // case action_show_pwd :
07208           // case action_show_setup :
07209           // case action_show_set :
07210           // case action_show_set_names :
07211           // case action_show_set_value :
07212           // case action_show_sets :
07213           // case action_show_strategies :
07214           // case action_show_tags :
07215           // case action_show_use_paths :
07216           // case action_show_uses :
07217           // case action_show_version :
07218           // case action_show_versions :
07219           // case action_system :
07220         case action_unlock :
07221           // case action_version :
07222           clear ();
07223           return (code);
07224         default:
07225           CmtError::clear ();
07226           break;
07227         }
07228     }
07229 
07230   //
07231   // Perform actions
07232   //
07233 
07234   switch (m_action)
07235     {
07236     case action_none :
07237       //CmtError::set (CmtError::syntax_error, "ParseArguments> ");
07238       break;
07239     case action_awk :
07240       do_awk (arguments);
07241       break;
07242     case action_broadcast :
07243       do_broadcast (arguments, argc, argv);
07244       break;
07245     case action_build_constituent_makefile :
07246       do_build_constituent_makefile (arguments, argc, argv);
07247       break;
07248     case action_build_constituents_makefile :
07249       do_build_constituents_makefile (arguments, argc, argv);
07250       break;
07251     case action_build_dependencies :
07252       do_build_dependencies (arguments, argc, argv);
07253       break;
07254     case action_build_library_links :
07255       do_build_library_links ();
07256       break;
07257     case action_build_make_setup :
07258       do_build_make_setup ();
07259       break;
07260     case action_build_msdev :
07261       do_build_msdev (arguments);
07262       break;
07263     case action_build_vsnet :     
07264       do_build_vsnet (arguments);
07265       break;
07266     case action_build_os9_makefile :
07267       do_build_os9_makefile (arguments);
07268       break;
07269     case action_build_prototype :
07270       do_build_prototype (arguments);
07271       break;
07272     case action_build_readme :
07273       do_build_readme (arguments);
07274       break;
07275     case action_build_tag_makefile :
07276       do_build_tag_makefile ();
07277       break;
07278     case action_build_temporary_name :
07279       do_build_temporary_name ();
07280       break;
07281     case action_build_triggers :
07282       do_build_triggers (arguments);
07283       break;
07284     case action_build_windefs :
07285       do_build_windefs (arguments);
07286       break;
07287     case action_check_configuration :
07288       do_check_configuration ();
07289       break;
07290     case action_check_files :
07291       do_check_files (arguments);
07292       break;
07293     case action_check_version :
07294       do_check_version (arguments);
07295       break;
07296     case action_checkout :
07297       do_checkout (arguments);
07298       break;
07299     case action_cleanup :
07300       do_cleanup (mode);
07301       break;
07302     case action_config :
07303       do_config ();
07304       break;
07305     case action_create :
07306       do_create (arguments);
07307       break;
07308     case action_cvsbranches :
07309       do_cvsbranches (arguments);
07310       break;
07311     case action_cvssubpackages :
07312       do_cvssubpackages (arguments);
07313       break;
07314     case action_cvstags :
07315       do_cvstags (arguments);
07316       break;
07317     case action_expand_model :
07318       do_expand_model (arguments);
07319       break;
07320     case action_filter :
07321       do_filter (arguments);
07322       break;
07323     case action_help :
07324       do_help (m_help_action);
07325       break;
07326     case action_load :
07327       cout << "#CMT> action not implemented" << endl;
07328       break;
07329     case action_lock :
07330       do_lock (m_current_package, m_current_version, m_current_path);
07331       break;
07332     case action_remove :
07333       do_remove (m_current_package, m_current_version, m_current_path);
07334       break;
07335     case action_remove_library_links :
07336       do_remove_library_links ();
07337       break;
07338     case action_run :
07339       do_run (arguments);
07340       break;
07341     case action_run_sequence :
07342       do_run_sequence (arguments);
07343       break;
07344     case action_set_version :
07345       do_set_version (arguments);
07346       break;
07347     case action_set_versions :
07348       do_set_versions (arguments);
07349       break;
07350     case action_setup :
07351       do_setup (mode);
07352       break;
07353     case action_show_all_tags :
07354       do_show_all_tags ();
07355       break;
07356     case action_show_applied_patterns :
07357       do_show_applied_patterns ();
07358       break;
07359     case action_show_author :
07360       do_show_author ();
07361       break;
07362     case action_show_branches :
07363       do_show_branches (mode);
07364       break;
07365     case action_show_clients :
07366       do_show_clients (arguments);
07367       break;
07368     case action_show_cmtpath_patterns :
07369       do_show_cmtpath_patterns ();
07370       break;
07371     case action_show_constituent :
07372       do_show_constituent (arguments);
07373       break;
07374     case action_show_constituent_names :
07375       do_show_constituent_names ();
07376       break;
07377     case action_show_constituents :
07378       do_show_constituents ();
07379       break;
07380     case action_show_cycles :
07381       do_show_cycles ();
07382       break;
07383     case action_show_fragment :
07384       do_show_fragment (arguments);
07385       break;
07386     case action_show_fragments :
07387       do_show_fragments ();
07388       break;
07389     case action_show_groups :
07390       do_show_groups ();
07391       break;
07392     case action_show_include_dirs :
07393       do_show_include_dirs ();
07394       break;
07395     case action_show_language :
07396       do_show_language (arguments);
07397       break;
07398     case action_show_languages :
07399       do_show_languages ();
07400       break;
07401     case action_show_macro :
07402       do_show_macro (arguments, mode);
07403       break;
07404     case action_show_macro_names :
07405       do_show_macro_names (arguments, mode);
07406       break;
07407     case action_show_macro_value :
07408       do_show_macro_value (arguments, mode);
07409       break;
07410     case action_show_macros :
07411       do_show_macros (arguments, mode);
07412       break;
07413     case action_show_manager :
07414       do_show_manager ();
07415       break;
07416     case action_show_packages :
07417       do_show_packages (arguments);
07418       break;
07419     case action_show_path :
07420       do_show_path ();
07421       break;
07422     case action_show_pattern :
07423       do_show_pattern (arguments);
07424       break;
07425     case action_show_pattern_names :
07426       do_show_pattern_names ();
07427       break;
07428     case action_show_patterns :
07429       do_show_patterns ();
07430       break;
07431     case action_show_projects :
07432       do_show_projects ();
07433       break;
07434     case action_show_pwd :
07435       do_show_pwd ();
07436       break;
07437     case action_show_setup :
07438       do_show_setup ();
07439       break;
07440     case action_show_set :
07441       do_show_set (arguments, mode);
07442       break;
07443     case action_show_set_names :
07444       do_show_set_names (arguments, mode);
07445       break;
07446     case action_show_set_value :
07447       do_show_set_value (arguments, mode);
07448       break;
07449     case action_show_sets :
07450       do_show_sets (arguments, mode);
07451       break;
07452     case action_show_strategies :
07453       do_show_strategies ();
07454       break;
07455     case action_show_tags :
07456       do_show_tags ();
07457       break;
07458     case action_show_use_paths :
07459       do_show_use_paths (arguments);
07460       break;
07461     case action_show_uses :
07462       do_show_uses ();
07463       break;
07464     case action_show_version :
07465       do_show_version ();
07466       break;
07467     case action_show_versions :
07468       do_show_versions (arguments);
07469       break;
07470     case action_system :
07471       do_show_system ();
07472       break;
07473     case action_unlock :
07474       do_unlock (m_current_package, m_current_version, m_current_path);
07475       break;
07476     case action_version :
07477       do_version ();
07478       break;
07479     default:
07480       CmtError::set (CmtError::syntax_error, "ParseArguments>");
07481       break;
07482     }
07483 
07484   if (CmtError::has_pending_error ())
07485     {
07486       int code = CmtError::get_last_error_code ();
07487       if (!m_quiet) CmtError::print ();
07488       clear ();
07489       return (code);
07490     }
07491   else
07492     {
07493       clear ();
07494       return (0);
07495     }
07496 }

int Cmt::parser ( const cmt_string & command_line?) [static]
?

Definition at line 6735 of file cmt_parser.cxx.

Referenced by do_broadcast(), and main().

06736 {
06737   CmtSystem::cmt_string_vector v;
06738 
06739   CmtSystem::split (command_line, " \t", v);
06740 
06741   int argc = v.size ();
06742 
06743   char** argv = (char**) malloc ((argc + 1) * sizeof (char*));
06744 
06745   int i;
06746   for (i = 0; i < argc; i++)
06747     {
06748       argv[i] = (char*) v[i].c_str ();
06749     }
06750   argv[argc] = 0;
06751 
06752   int status = parser (argc, argv);
06753 
06754   free (argv);
06755 
06756   return (status);
06757 }

void Cmt::print ( PrintMode mode?) [static]
?

Format as one single line a set of 'setenv' statements joined with semi-colons to form one shell command.

Definition at line 7503 of file cmt_parser.cxx.

Referenced by do_setup().

07504 {
07505   Use::UsePtrVector& Uses = Use::get_ordered_uses ();
07506   Use& current_use = Use::current ();
07507 
07508   cmt_string tag;
07509 
07510   set_standard_macros ();
07511 
07512     //cerr << "# current_tag=" << m_current_tag << endl;
07513     //cerr << "# current_config=" << m_current_config << endl;
07514 
07515   if (m_current_tag == "")
07516     {
07517       if (mode == Bat) tag = "%CMTCONFIG%";
07518       else tag = "${CMTCONFIG}";
07519     }
07520   else
07521     {
07522       tag = m_current_tag;
07523     }
07524 
07525   if (m_current_access == DeveloperMode)
07526     {
07527       m_scope = ScopePrivate;
07528     }
07529   else
07530     {
07531       m_scope = ScopePublic;
07532     }
07533 
07534     //
07535     //  Now check if all extra tags are still valid. Some of them
07536     //  may be discarded du to some conflict with highest priority
07537     //  tags, or with exclude statements
07538     //
07539 
07540   {
07541     CmtSystem::cmt_string_vector words;
07542       
07543     cmt_string tags;
07544 
07545     tags = Cmt::m_extra_tags;
07546       
07547     CmtSystem::split (tags, " \t,", words);
07548 
07549     Cmt::m_extra_tags = ",";
07550       
07551     for (int i = 0; i < words.size (); i++)
07552       {
07553         Tag* tag;
07554         const cmt_string& a = words[i];
07555 
07556         tag = Tag::find (a);
07557 
07558         if ((tag != 0) && (tag->is_selected ()))
07559           {
07560             Cmt::m_extra_tags += a;
07561             Cmt::m_extra_tags += ",";
07562           }
07563       }
07564   }
07565 
07566   if (m_debug)
07567     {
07568       cout << "Before all print contexts" << endl;
07569     }
07570 
07571   if (Uses.size () > 0)
07572     {
07573       int number;
07574 
07575       for (number = 0; number < Uses.size (); number++)
07576         {
07577           Use& use = *(Uses[number]);
07578 
07579           if (use.discarded) continue;
07580 
07581           print_context (use, mode, tag);
07582         }
07583     }
07584 
07585   print_context (Use::current (), mode, tag);
07586 
07587   if (m_debug)
07588     {
07589       cout << "After all print contexts" << endl;
07590     }
07591 
07592   Symbol::all_print (mode);
07593   // Script::all_print (mode);
07594 
07595   if (m_debug)
07596     {
07597       cout << "After all print" << endl;
07598     }
07599 
07600   cout << endl;
07601 }

void Cmt::print_clean ( PrintMode mode?) [static]
?

Format as one single line a set of 'unsetenv' statements joined with semi-colons to form one shell command.

Definition at line 7608 of file cmt_parser.cxx.

Referenced by do_cleanup().

07609 {
07610   Use::UsePtrVector& Uses = Use::get_ordered_uses ();
07611 
07612   set_standard_macros ();
07613 
07614   Script::all_print_clean (mode);
07615   Symbol::all_print_clean (mode);
07616 
07617   switch (mode)
07618     {
07619     case Csh :
07620       if (m_current_package != "CMT")
07621         {
07622           cout << "unsetenv " << m_current_prefix << "ROOT" << endl;
07623           cout << "unsetenv " << m_current_prefix << "CONFIG" << endl;
07624         }
07625       break;
07626     case Sh :
07627       if (m_current_package != "CMT")
07628         {
07629           cout << "unset " << m_current_prefix << "ROOT" << endl;
07630           cout << "unset " << m_current_prefix << "CONFIG" << endl;
07631         }
07632       break;
07633     case Bat :
07634       if (m_current_package != "CMT")
07635         {
07636           cout << "set " << m_current_prefix << "ROOT=" << endl;
07637           cout << "set " << m_current_prefix << "CONFIG=" << endl;
07638         }
07639       break;
07640     }
07641 
07642   if (Uses.size () > 0)
07643     {
07644       int number;
07645 
07646       for (number = 0; number < Uses.size (); number++)
07647         {
07648           Use* use = Uses[number];
07649 
07650           if (use->discarded) continue;
07651 
07652           Package* p = use->get_package ();
07653           if (p->is_cmt ()) continue;
07654 
07655           switch (mode)
07656             {
07657             case Csh :
07658               cout << "unsetenv " << use->prefix << "ROOT" << endl;
07659               cout << "unsetenv " << use->prefix << "CONFIG" << endl;
07660               break;
07661             case Sh :
07662               cout << "unset " << use->prefix << "ROOT" << endl;
07663               cout << "unset " << use->prefix << "CONFIG" << endl;
07664               break;
07665             case Bat :
07666               cout << "set " << use->prefix << "ROOT=" << endl;
07667               cout << "set " << use->prefix << "CONFIG" << endl;
07668               break;
07669             }
07670         }
07671     }
07672 
07673   switch (mode)
07674     {
07675     case Csh :
07676       cout << "unsetenv CMTEXTRATAGS" << endl;
07677       break;
07678     case Sh :
07679       cout << "unset CMTEXTRATAGS" << endl;
07680       break;
07681     case Bat :
07682       cout << "set CMTEXTRATAGS=" << endl;
07683       break;
07684     }
07685 
07686   cout << endl;
07687 }

void Cmt::print_context ( Use & use,
PrintMode mode,
const cmt_string & tag?) [static]
?

Definition at line 7690 of file cmt_parser.cxx.

Referenced by print().

07691 {
07692   if (use.get_package_name () == "cmt_standalone") return;
07693 
07694   cmt_string fs = CmtSystem::file_separator ();
07695 
07696   use.real_path.replace_all (CmtSystem::file_separator (), fs);
07697 
07698   cmt_string system = CmtSystem::get_cmt_config ();
07699 
07700   bool do_config = ((m_current_setup_strategy & SetupConfigMask) == SetupConfig);
07701   bool do_root = ((m_current_setup_strategy & SetupRootMask) == SetupRoot);
07702 
07703   switch (mode)
07704     {
07705     case Csh :
07706       if (do_root)
07707         {
07708           cout << "setenv " << use.prefix << "ROOT \"" <<
07709             use.get_full_path () << "\"" << endl;
07710         }
07711 
07712       if (use.get_package_name () == "CMT")
07713         {
07714           cout << "setenv CMTCONFIG " << system << endl;
07715         }
07716       else
07717         {
07718           if (do_config)
07719             {
07720               cout << "setenv " << use.prefix << "CONFIG \"" << tag << "\"" << endl;
07721             }
07722         }
07723         
07724       break;
07725     case Sh :
07726       if (do_root)
07727         {
07728           cout << use.prefix << "ROOT=\"" <<
07729             use.get_full_path () << "\"; export " <<
07730             use.prefix << "ROOT" << endl;
07731         }
07732 
07733       if (use.get_package_name () == "CMT")
07734         {
07735           cout << "CMTCONFIG=" << system << "; export CMTCONFIG" << endl;
07736         }
07737       else
07738         {
07739           if (do_config)
07740             {
07741               cout << use.prefix << "CONFIG=\"" <<
07742                 tag << "\"; export " <<
07743                 use.prefix << "CONFIG" << endl;
07744             }
07745         }
07746         
07747       break;
07748     case Bat :
07749       if (do_root)
07750         {
07751           cout << "set " << use.prefix << "ROOT=" <<
07752             use.get_full_path () << endl;
07753         }
07754 
07755       if (use.get_package_name () == "CMT")
07756         {
07757           cout << "set CMTCONFIG=" << system << endl;
07758         }
07759       else
07760         {
07761           if (do_config)
07762             {
07763               cout << "set " << use.prefix << "CONFIG=" << tag << endl;
07764             }
07765         }
07766         
07767       break;
07768     }
07769 }

void Cmt::print_macros ( PrintMode mode,
const cmt_string & pattern = ""?) [static]
?

Format a set of make macro definitions (one per line) Each macro value is provided enclosed in single quotes.

Take the macro values from the macro statements found in recursively read requirements files.

Definition at line 7831 of file cmt_parser.cxx.

Referenced by do_build_tag_makefile(), do_show_macros(), and do_show_sets().

07832 {
07833   int number;
07834 
07835   set_standard_macros ();
07836 
07837   cmt_regexp expression (pattern);
07838 
07839   bool has_pattern = (pattern != "");
07840 
07841   for (number = 0; number < Symbol::symbol_number (); number++)
07842     {
07843       Symbol& symbol = Symbol::symbol (number);
07844 
07845       if (has_pattern)
07846         {
07847           if (!expression.match (symbol.name)) continue;
07848         }
07849 
07850       if (m_action == action_show_macros)
07851         {
07852           // Only keep macros.
07853           if ((symbol.command == CommandSet) ||
07854               (symbol.command == CommandSetAppend) ||
07855               (symbol.command == CommandSetPrepend) ||
07856               (symbol.command == CommandSetRemove) ||
07857               (symbol.command == CommandAlias) ||
07858               (symbol.command == CommandPath) ||
07859               (symbol.command == CommandPathAppend) ||
07860               (symbol.command == CommandPathPrepend) ||
07861               (symbol.command == CommandPathRemove)) continue;
07862         }
07863       else if (m_action == action_show_sets)
07864         {
07865           // Exclude macros.
07866           if ((symbol.command == CommandMacro) ||
07867               (symbol.command == CommandMacroAppend) ||
07868               (symbol.command == CommandMacroPrepend) ||
07869               (symbol.command == CommandMacroRemove) ||
07870               (symbol.command == CommandMacroRemoveAll)) continue;
07871         }
07872       else if (m_action == action_build_tag_makefile)
07873         {
07874           // Exclude scripts.
07875           if ((symbol.command == CommandSetupScript) ||
07876               (symbol.command == CommandCleanupScript)) continue;
07877         }
07878 
07879       if (symbol.value_lists.size () < 1) continue;
07880 
07881       symbol.show_macro (mode);
07882     }
07883 }

void Cmt::print_symbol_names ( PrintMode mode,
const cmt_string & pattern = ""?) [static]
?

Format a set of make macro definitions (one per line) Each macro value is provided enclosed in single quotes.

Take the macro values from the macro statements found in recursively read requirements files.

Definition at line 7778 of file cmt_parser.cxx.

Referenced by do_show_macro_names(), and do_show_set_names().

07779 {
07780   int number;
07781 
07782   set_standard_macros ();
07783 
07784   cmt_regexp expression (pattern);
07785 
07786   bool has_pattern = (pattern != "");
07787 
07788   for (number = 0; number < Symbol::symbol_number (); number++)
07789     {
07790       Symbol& symbol = Symbol::symbol (number);
07791 
07792       if (has_pattern)
07793        {
07794          if (!expression.match (symbol.name)) continue;
07795        }
07796 
07797       if (m_action == action_show_macro_names)
07798         {
07799           // Only keep macros.
07800           if ((symbol.command == CommandSet) ||
07801               (symbol.command == CommandSetAppend) ||
07802               (symbol.command == CommandSetPrepend) ||
07803               (symbol.command == CommandSetRemove) ||
07804               (symbol.command == CommandAlias) ||
07805               (symbol.command == CommandPath) ||
07806               (symbol.command == CommandPathAppend) ||
07807               (symbol.command == CommandPathPrepend) ||
07808               (symbol.command == CommandPathRemove)) continue;
07809         }
07810       else if (m_action == action_show_set_names)
07811         {
07812           // Exclude macros.
07813           if ((symbol.command == CommandMacro) ||
07814               (symbol.command == CommandMacroAppend) ||
07815               (symbol.command == CommandMacroPrepend) ||
07816               (symbol.command == CommandMacroRemove) ||
07817               (symbol.command == CommandMacroRemoveAll)) continue;
07818         }
07819 
07820       cout << symbol.name << endl;
07821     }
07822 }

void Cmt::print_tabs ( int tabs?) [static]
?

Definition at line 7886 of file cmt_parser.cxx.

07887 {
07888   while (tabs > 0)
07889     {
07890       cout << "  ";
07891       tabs--;
07892     }
07893 }

int Cmt::reach_current_package ( ) [static]
?

Definition at line 7896 of file cmt_parser.cxx.

Referenced by do_config(), and parser().

07897 {
07898   Use& use = Use::current ();
07899   cmt_string dir;
07900 
07901   if (m_debug)
07902     {
07903       cout << "Cmt::reach_current_package> pwd = " 
07904            << CmtSystem::pwd () 
07905            << " path=" << m_current_path
07906            << " package=" << m_current_package
07907            << endl;
07908     }
07909 
07910   /*
07911     Try to access the package.
07912   */
07913 
07914   if (m_current_package == "cmt_standalone")
07915     {
07916       if ((m_current_path != "") && (m_current_path != CmtSystem::pwd ()))
07917         {
07918           if (!CmtSystem::cd (m_current_path))
07919             {
07920               CmtError::set (CmtError::package_not_found,
07921                              "ReachCurrentPackage> Cannot reach the path directory");
07922               return (0);
07923             }
07924         }
07925 
07926       if (!CmtSystem::test_file ("requirements"))
07927         {
07928             /*
07929           if (!m_quiet)
07930             {
07931               cout << "#CMT> Cannot reach the requirements file" << endl;
07932             }
07933               
07934           CmtError::set (CmtError::package_not_found,
07935                          "ReachCurrentPackage> Cannot reach the requirements file");
07936             */
07937           return (0);
07938         }
07939     }
07940   else if (m_current_package != "")
07941     {
07942       if (!use.move_to ())
07943         {
07944           CmtError::set (CmtError::package_not_found,
07945                          "ReachCurrentPackage> Cannot reach the path directory");
07946           return (0);
07947         }
07948 
07949       m_current_path = use.real_path;
07950 
07951       cmt_string parent = m_current_path;
07952       cmt_string d = m_current_path;
07953 
07954       //
07955       // This section is for adding the current package location
07956       // into the CMTPATH list. We try to guess the highest possible
07957       // directory level which is NOT part of another upper package.
07958       //
07959       //  However this is somewhat dangerous. Therefore we might consider
07960       // getting rid of this feature.
07961       //
07962       for (;;)
07963         {
07964           d += "/../";
07965           if (!CmtSystem::is_package_directory (d))
07966             {
07967               CmtSystem::add_cmt_path (parent, "current package",
07968                                        m_cmt_path, 
07969                                        m_cmt_path_pwds, 
07970                                        m_cmt_path_sources);
07971               break;
07972             }
07973           parent = d;
07974         }
07975     }
07976   else
07977     {
07978       //
07979       // The cmt command has been given without explicit search for 
07980       // a package. Thus it is expected that we are in the context of a
07981       // true package.
07982       //
07983       //  This means that there should be a requirements file visible.
07984       //
07985       //  If this is not true, we'll make a try into ../cmt and then
07986       // a last try into ../mgr
07987       //
07988 
07989       if (!CmtSystem::test_file ("requirements"))
07990         {
07991           if (CmtSystem::cd ("../cmt") && 
07992               CmtSystem::test_file ("requirements"))
07993             {
07994               m_current_style = cmt_style;
07995             }
07996           else if (CmtSystem::cd ("../mgr") && 
07997                    CmtSystem::test_file ("requirements"))
07998             {
07999               m_current_style = mgr_style;
08000             }
08001           else
08002             {
08003               if (!m_quiet)
08004                 {
08005                   cout << "#CMT> Cannot reach the mgr branch" << endl;
08006                 }
08007               
08008               CmtError::set (CmtError::package_not_found,
08009                              "ReachCurrentPackage> Cannot reach the mgr/cmt directory");
08010               return (0);
08011             }
08012         }
08013 
08014       dir = CmtSystem::pwd ();
08015 
08016       CmtSystem::dirname (dir, m_current_path);
08017       CmtSystem::basename (m_current_path, m_current_version);
08018 
08019       if (CmtSystem::is_version_directory (m_current_version))
08020         {
08021           CmtSystem::dirname (m_current_path, m_current_path);
08022           CmtSystem::basename (m_current_path, m_current_package);
08023           CmtSystem::dirname (m_current_path, m_current_path);
08024         }
08025       else
08026         {
08027           m_current_package = m_current_version;
08028           m_current_version = "";
08029           CmtSystem::dirname (m_current_path, m_current_path);
08030 
08031           m_current_style = no_version_style;
08032         }
08033 
08034       Use& use = Use::current ();
08035       
08036       use.set_package_name (m_current_package);
08037       use.version = m_current_version;
08038       use.path    = m_current_path;
08039       use.style   = m_current_style;
08040     }
08041 
08042   configure_current_dir ();
08043 
08044   /*
08045     Check Tag is always set up
08046   */
08047 
08048   if (m_debug) cout << "reach_current_package0> current_tag=" << m_current_tag << endl;
08049 
08050   if (m_current_tag == "")
08051     {
08052       cmt_string env;
08053 
08054       env = CmtSystem::getenv (m_current_config);
08055       if (env != "")
08056         {
08057           Tag* tag;
08058 
08059           tag = Tag::add (env, PriorityConfig, "reach current package", 0);
08060           tag->mark ();
08061             //m_current_tag = env;
08062 
08063           //if (!m_quiet) cerr << "reach_current_package1> current_tag=" << m_current_tag << endl;
08064 
08065         }
08066     }
08067 
08068   if (m_debug)
08069     {
08070       cout << "pwd = " << CmtSystem::pwd () << endl;
08071     }
08072 
08073   /*
08074     Work on the requirements file.
08075   */
08076 
08077   if (dir != "") dir += CmtSystem::file_separator ();
08078   dir += "requirements";
08079   SyntaxParser::parse_requirements (dir, 0);
08080 
08081   if (m_debug) cout << "reach_current_package2> current_tag=" << m_current_tag << endl;
08082 
08104   Pattern::apply_all_globals ();
08105 
08106   /*
08107     Select all possible tags
08108   */
08109 
08110   Tag::restore_tree ();
08111 
08112   return (1);
08113 }

void Cmt::restore_all_tags ( Use * use?) [static]
?

Definition at line 1352 of file cmt_parser.cxx.

Referenced by parse_arguments().

01353 {
01354     //cerr << "restore_all_tags" << endl;
01355 
01356   Cmt::configure_tags (use);
01357 
01358     /*
01359       Then get existing extra tags
01360      */
01361 
01362   if (CmtSystem::testenv ("CMTEXTRATAGS"))
01363     {
01364       cmt_string s = "CMTEXTRATAGS";
01365 
01366       if (use != 0)
01367         {
01368           s += " in ";
01369         }
01370 
01371       Tag* tag;
01372       CmtSystem::cmt_string_vector words;
01373       
01374       cmt_string tags = CmtSystem::getenv ("CMTEXTRATAGS");
01375       
01376       CmtSystem::split (tags, " \t,", words);
01377 
01378       Cmt::m_extra_tags = ",";
01379       
01380       for (int i = 0; i < words.size (); i++)
01381         {
01382           const cmt_string& a = words[i];
01383 
01384           Cmt::m_extra_tags += a;
01385           Cmt::m_extra_tags += ",";
01386           
01387           tag = Tag::add (a, PriorityUserTag, s, use);
01388           
01389           tag->mark ();
01390         }
01391     }
01392 }

void Cmt::set_current_access ( AccessMode mode?) [static]
?

Definition at line 9350 of file cmt_parser.cxx.

Referenced by SyntaxParser::parse_requirements_text().

09351 {
09352   m_current_access = mode;
09353 }

void Cmt::set_current_build_strategy ( int strategy?) [static]
?

Definition at line 9356 of file cmt_parser.cxx.

Referenced by KwdBuildStrategy::action().

09357 {
09358   m_current_build_strategy = strategy;
09359 }

void Cmt::set_current_setup_strategy ( int strategy?) [static]
?

Definition at line 9362 of file cmt_parser.cxx.

Referenced by KwdSetupStrategy::action().

09363 {
09364   m_current_setup_strategy = strategy;
09365 }

void Cmt::set_current_strategy ( VersionStrategy strategy?) [static]
?

Definition at line 9368 of file cmt_parser.cxx.

Referenced by KwdVersionStrategy::action().

09369 {
09370   m_current_strategy = strategy;
09371 }

void Cmt::set_scope ( ScopeType scope?) [static]
?

Definition at line 9374 of file cmt_parser.cxx.

Referenced by KwdPublic::action(), KwdPrivate::action(), and SyntaxParser::parse_requirements_text().

09375 {
09376   m_scope = scope;
09377 }

void Cmt::set_scope_filtering_mode ( CmtScopeFilteringMode mode?) [static]
?

Definition at line 9380 of file cmt_parser.cxx.

Referenced by parse_arguments().

09381 {
09382   m_scope_filtering_mode = mode;
09383 }

void Cmt::set_standard_macros ( ) [static]
?

Definition at line 9386 of file cmt_parser.cxx.

Referenced by build_msdev_file(), build_vsnet_file(), do_build_constituent_makefile(), do_build_constituents_makefile(), do_build_dependencies(), do_build_library_links(), do_build_make_setup(), do_build_msdev(), do_build_os9_makefile(), do_build_prototype(), do_build_readme(), do_build_triggers(), do_build_vsnet(), do_build_windefs(), do_expand_model(), do_filter(), do_lock(), do_remove_library_links(), do_run(), do_show_all_tags(), do_show_cmtpath_patterns(), do_show_constituent(), do_show_constituent_names(), do_show_constituents(), do_show_cycles(), do_show_include_dirs(), do_show_language(), do_show_languages(), do_show_macro(), do_show_tags(), do_unlock(), print(), print_clean(), print_macros(), and print_symbol_names().

09387 {
09388   if (m_standard_macros_done) return;
09389 
09390   m_standard_macros_done = true;
09391 
09392   int number;
09393   cmt_string temp;
09394   Use::UsePtrVector& Uses = Use::get_ordered_uses ();
09395   Use& current_use = Use::current ();
09396 
09397   cmt_string fs = CmtSystem::file_separator ();
09398 
09399   cmt_string pwd = CmtSystem::pwd ();
09400 
09401   if (CmtSystem::test_file ("../cmt/requirements")) m_current_style = cmt_style;
09402   else if (CmtSystem::test_file ("../mgr/requirements")) m_current_style = mgr_style;
09403   else m_current_style = none_style;
09404 
09405   {
09406     cmt_string v;
09407     CmtSystem::dirname (pwd, v);
09408     CmtSystem::basename (v, v);
09409     if (!CmtSystem::is_version_directory (v))
09410       {
09411         m_current_style = no_version_style;
09412       }
09413   }
09414 
09415   // Prepare computation of the best form for relative path from current directory
09416   // to package directories.
09417   CmtSystem::cmt_string_vector vb;
09418   CmtSystem::split (pwd, fs, vb);
09419 
09420 
09425   bool tag_debug = CmtSystem::testenv ("TAGDEBUG");
09426 
09427   if (tag_debug) cerr << "set_standard_macro0> current_tag=" << m_current_tag << endl;
09428 
09429   if (m_current_tag != "")
09430     {
09431         // this is when some -tag= argument was used.
09432       if (tag_debug) cerr << "set_standard_macro0.1> current_tag=" << m_current_tag << endl;
09433     }
09434   else if (Symbol::is_selected ("CMTCONFIG"))
09435     {
09436         // This is when CMTCONFIG has been set from some requirements file
09437       Symbol* macro = Symbol::find ("CMTCONFIG");
09438       if (macro != 0)
09439         {
09440           m_current_tag = macro->build_macro_value ();
09441           if (tag_debug) cerr << "set_standard_macro1> current_tag=" << m_current_tag << endl;
09442         }
09443     }
09444   else
09445     {
09446         // this is when no -tag= argument was used.
09447       if (tag_debug) cerr << "set_standard_macro(before2)> current_tag=" << m_current_tag << endl;
09448       if (current_use.get_package_name () == "CMT")
09449         {
09450           m_current_tag = CmtSystem::getenv ("CMTBIN");
09451         }
09452       else
09453         {
09454           m_current_tag = CmtSystem::getenv ("CMTCONFIG");
09455         }
09456 
09457       if (tag_debug) cerr << "set_standard_macro2> current_tag=" << m_current_tag << endl;
09458     }
09459 
09460   if (m_debug)
09461     {
09462       cout << "set_standard_macro3>" << endl;
09463     }
09464 
09465   StandardMacroBuilder builder (m_current_tag,
09466                                 m_current_package,
09467                                 m_current_version,
09468                                 m_current_prefix,
09469                                 m_current_style);
09470 
09471   builder.fill_for_tag ();
09472   builder.fill_for_package_tag ();
09473   builder.fill_for_package (m_current_dir);
09474   builder.fill_for_branches ();
09475   builder.fill_for_uses ();
09476   builder.fill_for_use_requirements ();
09477   builder.fill_for_use_includes ();
09478   builder.fill_for_use_fincludes ();
09479   builder.fill_for_use_stamps ();
09480   builder.fill_for_use_cflags ();
09481   builder.fill_for_use_pp_cflags ();
09482   builder.fill_for_use_cppflags ();
09483   builder.fill_for_use_pp_cppflags ();
09484   builder.fill_for_use_fflags ();
09485   builder.fill_for_use_pp_fflags ();
09486   builder.fill_for_use_linkopts ();
09487   builder.fill_for_use_libraries ();
09488   builder.fill_for_includes ();
09489   builder.fill_for_fincludes ();
09490   builder.fill_for_all_constituents ();
09491 
09496   const Constituent::ConstituentVector& constituents =
09497     Constituent::constituents ();
09498   
09499   if (!Symbol::is_selected ("constituents"))
09500     {
09501       temp = "macro_append constituents \" ";
09502       
09503       for (number = 0; number < constituents.size (); number++)
09504         {
09505           const Constituent& constituent = constituents[number];
09506 
09507           if (constituent.group == 0)
09508             {
09509               temp += constituent.name;
09510               temp += " ";
09511             }
09512         }
09513       
09514       temp += "\"";
09515       
09516       SyntaxParser::parse_requirements_line (temp, ¤t_use);
09517     }
09518 
09519   SyntaxParser::parse_requirements_line ("macro_append all_constituents \" $(constituents)\"", 
09520                                       ¤t_use);
09521 
09522   if (!Symbol::is_selected ("constituentsclean"))
09523     {
09524       temp = "macro_append constituentsclean \" ";
09525       
09526       for (number = constituents.size () - 1; number >= 0 ; number--)
09527         {
09528           const Constituent& constituent = constituents[number];
09529 
09530           if (constituent.group == 0)
09531             {
09532               temp += constituent.name;
09533               temp += "clean ";
09534             }
09535         }
09536       
09537       temp += "\"";
09538       
09539       SyntaxParser::parse_requirements_line (temp, ¤t_use);
09540     }
09541 
09542   SyntaxParser::parse_requirements_line ("macro_append all_constituentsclean \" $(constituentsclean)\"", 
09543                                       ¤t_use);
09544 
09545   const Group::GroupVector& groups = Group::groups ();
09546   
09547   for (number = 0; number < groups.size (); number++)
09548     {
09549       const Group& group = groups[number];
09550 
09551       temp = "macro_append ";
09552       temp += group.name ();
09553       temp += "_constituents \" ";
09554 
09555       int i;
09556 
09557       for (i = 0; i < constituents.size (); i++)
09558         {
09559           const Constituent& constituent = constituents[i];
09560 
09561           if ((constituent.group != 0) && 
09562               (group.name () == constituent.group->name ()))
09563             {
09564               temp += constituent.name;
09565               temp += " ";
09566             }
09567         }
09568       
09569       temp += "\"";
09570       
09571       SyntaxParser::parse_requirements_line (temp, ¤t_use);
09572 
09573       temp = "macro_append ";
09574       temp += group.name ();
09575       temp += "_constituentsclean \" ";
09576       
09577       for (i = constituents.size () - 1; i >= 0 ; i--)
09578         {
09579           const Constituent& constituent = constituents[i];
09580 
09581           if ((constituent.group != 0) && 
09582               (group.name () == constituent.group->name ()))
09583             {
09584               temp += constituent.name;
09585               temp += "clean ";
09586             }
09587         }
09588       
09589       temp += "\"";
09590       
09591       SyntaxParser::parse_requirements_line (temp, ¤t_use);
09592     }
09593 
09594     //
09595     //  Definitions for installation area mechanisms
09596     //
09597   if ((get_current_build_strategy () & InstallAreaMask) == WithInstallArea)
09598     {
09599       CmtInstallAreaMgr& ia_mgr = CmtInstallAreaMgr::instance ();
09600 
09601       ia_mgr.setup ();
09602     }
09603 }

void Cmt::use_cmt ( ) [static]
?

Macros implied or required to manage constituents.

Definition at line 9606 of file cmt_parser.cxx.

Referenced by load(), and parser().

09607 {
09608   UseRef use;
09609   bool recursive_copy = m_recursive;
09610   bool debug_copy = m_debug;
09611 
09612   if (m_default_path.size () <= 0) return;
09613   if (m_current_package == "CMT") return;
09614 
09615   m_recursive = true;
09616   m_debug = false;
09617   use = Use::add (m_default_path, "CMT", m_cmt_version, "", "", 0);
09618   m_recursive = recursive_copy;
09619   m_debug = debug_copy;
09620 }

void Cmt::use_home_requirements ( ) [static]
?

Definition at line 9623 of file cmt_parser.cxx.

Referenced by parser().

09624 {
09625   cmt_string f = m_cmt_home;
09626 
09627   if (f == "") 
09628     {
09629         //if (!m_quiet) cerr << "No CMTHOME" << endl;
09630       return;
09631     }
09632 
09633     //if (!m_quiet) cerr << "Using CMTHOME in " << f << endl;
09634 
09635   UseRef use;
09636   bool recursive_copy = m_recursive;
09637 
09638   if (m_default_path.size () <= 0) return;
09639   if (m_current_package == "CMT") return;
09640 
09641   m_recursive = true;
09642 
09643   cmt_string name = CmtSystem::get_home_package ();
09644 
09645   use = Use::add (f, name, "", "", "", 0);
09646 
09647   f += CmtSystem::file_separator ();
09648   f += "requirements";
09649   SyntaxParser::parse_requirements (f, use);
09650 
09651   m_recursive = recursive_copy;
09652 }

void Cmt::use_user_context_requirements ( ) [static]
?

Definition at line 9655 of file cmt_parser.cxx.

Referenced by parser().

09656 {
09657   cmt_string f = m_cmt_user_context;
09658 
09659   if (f == "") 
09660     {
09661         //if (!m_quiet) cerr << "No CMTUSERCONTEXT" << endl;
09662       return;
09663     }
09664 
09665     //if (!m_quiet) cerr << "Using CMTUSERCONTEXT in " << f << endl;
09666 
09667   UseRef use;
09668   bool recursive_copy = m_recursive;
09669 
09670   if (m_default_path.size () <= 0) return;
09671   if (m_current_package == "CMT") return;
09672 
09673   m_recursive = true;
09674 
09675   cmt_string name = CmtSystem::get_user_context_package ();
09676 
09677   use = Use::add (f, name, "", "", "", 0);
09678 
09679   f += CmtSystem::file_separator ();
09680   f += "requirements";
09681   SyntaxParser::parse_requirements (f, use);
09682 
09683   m_recursive = recursive_copy;
09684 }

void Cmt::vector_to_string ( const CmtSystem::cmt_string_vector & v,
const cmt_string & separator,
cmt_string & result?) [static]
?

Definition at line 9687 of file cmt_parser.cxx.

09690 {
09691   result.erase (0);
09692 
09693   for (int i = 0; i < v.size (); i++)
09694     {
09695       const cmt_string& s = v[i];
09696       if (s == "") continue;
09697 
09698       if (i > 0) result += separator;
09699       result += v[i];
09700     }
09701 }

cmt_string Cmt::vector_to_string ( const CmtSystem::cmt_string_vector & v?) [static]
?

Definition at line 9704 of file cmt_parser.cxx.

Referenced by PathBuilder::build(), and PathBuilder::clean().

09705 {
09706   cmt_string result;
09707 
09708   vector_to_string (v, " ", result);
09709 
09710   return (result);
09711 }

Member Data Documentation

ActionType Cmt::m_action [static, private]
?

All Attributes are private.

Definition at line 35 of file cmt_parser.cxx.

bool Cmt::m_build_nmake [static, private]
?

Definition at line 37 of file cmt_parser.cxx.

cmt_string Cmt::m_cmt_config [static, private]
?

Definition at line 38 of file cmt_parser.cxx.

cmt_string Cmt::m_cmt_home [static, private]
?

Definition at line 43 of file cmt_parser.cxx.

CmtSystem::cmt_string_vector Cmt::m_cmt_path [static, private]
?

Definition at line 39 of file cmt_parser.cxx.

CmtSystem::cmt_string_vector Cmt::m_cmt_path_pwds [static, private]
?

Definition at line 40 of file cmt_parser.cxx.

CmtSystem::cmt_string_vector Cmt::m_cmt_path_sources [static, private]
?

Definition at line 41 of file cmt_parser.cxx.

cmt_string Cmt::m_cmt_root [static, private]
?

Definition at line 42 of file cmt_parser.cxx.

cmt_string Cmt::m_cmt_site [static, private]
?

Definition at line 45 of file cmt_parser.cxx.

cmt_string Cmt::m_cmt_user_context [static, private]
?

Definition at line 44 of file cmt_parser.cxx.

cmt_string Cmt::m_cmt_version [static, private]
?

Definition at line 46 of file cmt_parser.cxx.

cmt_string Cmt::m_configure_error [static, private]
?

Definition at line 69 of file cmt_parser.cxx.

AccessMode Cmt::m_current_access = UserMode [static, private]
?

Definition at line 58 of file cmt_parser.cxx.

int Cmt::m_current_build_strategy = DefaultBuildStrategy [static, private]
?

Definition at line 47 of file cmt_parser.cxx.

cmt_string Cmt::m_current_cmtpath [static, private]
?

Definition at line 55 of file cmt_parser.cxx.

cmt_string Cmt::m_current_config [static, private]
?

Definition at line 52 of file cmt_parser.cxx.

cmt_string Cmt::m_current_dir [static, private]
?

Definition at line 50 of file cmt_parser.cxx.

cmt_string Cmt::m_current_offset [static, private]
?

Definition at line 56 of file cmt_parser.cxx.

cmt_string Cmt::m_current_package [static, private]
?

Definition at line 51 of file cmt_parser.cxx.

cmt_string Cmt::m_current_path [static, private]
?

Definition at line 53 of file cmt_parser.cxx.

cmt_string Cmt::m_current_prefix [static, private]
?

Definition at line 54 of file cmt_parser.cxx.

int Cmt::m_current_setup_strategy = DefaultSetupStrategy [static, private]
?

Definition at line 48 of file cmt_parser.cxx.

VersionStrategy Cmt::m_current_strategy = BestFit [static, private]
?

Definition at line 59 of file cmt_parser.cxx.

CmtStructuringStyle Cmt::m_current_structuring_style = with_version_directory [static, private]
?

Definition at line 61 of file cmt_parser.cxx.

CmtDirStyle Cmt::m_current_style = cmt_style [static, private]
?

Definition at line 60 of file cmt_parser.cxx.

cmt_string Cmt::m_current_tag [static, private]
?

Definition at line 63 of file cmt_parser.cxx.

cmt_string Cmt::m_current_target [static, private]
?

Definition at line 64 of file cmt_parser.cxx.

cmt_string Cmt::m_current_version [static, private]
?

Definition at line 65 of file cmt_parser.cxx.

bool Cmt::m_debug [static, private]
?

Definition at line 71 of file cmt_parser.cxx.

cmt_string Cmt::m_default_path [static, private]
?

Definition at line 73 of file cmt_parser.cxx.

cmt_string Cmt::m_extra_tags [static, private]
?

Definition at line 67 of file cmt_parser.cxx.

ActionType Cmt::m_help_action [static, private]
?

Definition at line 36 of file cmt_parser.cxx.

bool Cmt::m_quiet [static, private]
?

Definition at line 74 of file cmt_parser.cxx.

bool Cmt::m_recursive [static, private]
?

Definition at line 75 of file cmt_parser.cxx.

ScopeType Cmt::m_scope [static, private]
?

Definition at line 76 of file cmt_parser.cxx.

CmtScopeFilteringMode Cmt::m_scope_filtering_mode [static, private]
?

Definition at line 77 of file cmt_parser.cxx.

bool Cmt::m_simulation [static, private]
?

Definition at line 78 of file cmt_parser.cxx.

bool Cmt::m_standard_macros_done [static, private]
?

Definition at line 79 of file cmt_parser.cxx.


The documentation for this class was generated from the following files:
Generated at Mon Aug 11 12:56:04 2003 for CMT by 1.2.3 written by , ??1997-2000