#ifndef __cmt_h__
#define __cmt_h__

#include "cmt_parser.h"
#include "cmt_system.h"

class Symbol;
class Selector;

class Cmt
{
 public:
  static void build_config (const cmt_string& prefix, cmt_string& config);
  static void build_makefile (const cmt_string& target);
  static void build_msdev_file (const cmt_string& target);
  static void build_OS9_makefile (const cmt_string& target);
  static void build_prefix (const cmt_string& package, cmt_string& prefix);
  static void clear ();

  static void configure ();
  static void configure_cmt_path ();
  static void configure_config_selector ();
  static void configure_current_dir ();
  static void configure_current_package ();
  static void configure_default_path ();
  static void configure_hosttype_selector ();
  static void configure_site_selector ();
  static void configure_uname_selector ();

  static void do_broadcast (const CmtSystem::cmt_string_vector& arguments,
                            int argc,
                            char* argv[]);
  static void do_build_constituent_makefile (const CmtSystem::cmt_string_vector& arguments,
                                             int argc,
                                             char* argv[]);
  static void do_build_constituents_makefile (const CmtSystem::cmt_string_vector& arguments,
                                              int argc,
                                              char* argv[]);
  static void do_build_dependencies (const CmtSystem::cmt_string_vector& arguments,
                                     int argc,
                                     char* argv[]);
  static void do_build_library_links ();
  static void do_build_make_setup ();
  static void do_build_msdev (const CmtSystem::cmt_string_vector& arguments);
  static void do_build_os9_makefile (const CmtSystem::cmt_string_vector& arguments);
  static void do_build_prototype (const CmtSystem::cmt_string_vector& arguments);
  static void do_build_readme (const CmtSystem::cmt_string_vector& arguments);
  static void do_build_tag_makefile ();
  static void do_build_temporary_name ();
  static void do_build_triggers (const CmtSystem::cmt_string_vector& arguments);
  static void do_build_windefs (const CmtSystem::cmt_string_vector& arguments);
  static void do_check_configuration ();
  static void do_check_files (const CmtSystem::cmt_string_vector& arguments);
  static void do_check_version (const CmtSystem::cmt_string_vector& arguments);
  static void do_checkout (const CmtSystem::cmt_string_vector& arguments);
  static void do_cleanup (PrintMode& mode);
  static void do_config ();
  static void do_create (const cmt_string& package,
                         const cmt_string& version,
                         const cmt_string& path);
  static void do_cvsbranches (const CmtSystem::cmt_string_vector& arguments);
  static void do_cvssubpackages (const CmtSystem::cmt_string_vector& arguments);
  static void do_cvstags (const CmtSystem::cmt_string_vector& arguments);
  static void do_expand_model (const CmtSystem::cmt_string_vector& arguments);
  static void do_filter (const CmtSystem::cmt_string_vector& arguments);
  static void do_help ();
  static void do_lock (const cmt_string& package,
                       const cmt_string& version,
                       const cmt_string& path);
  static void do_remove (const cmt_string& package,
                         const cmt_string& version,
                         const cmt_string& path);
  static void do_remove_library_links ();
  static void do_run (const CmtSystem::cmt_string_vector& arguments);
  static void do_setup (PrintMode& mode);
  static void do_show_author ();
  static void do_show_branches (PrintMode& mode);
  static void do_show_clients (const CmtSystem::cmt_string_vector& arguments);
  static void do_show_constituent (const CmtSystem::cmt_string_vector& arguments);
  static void do_show_constituent_names ();
  static void do_show_constituents ();
  static void do_show_fragment (const CmtSystem::cmt_string_vector& arguments);
  static void do_show_fragments ();
  static void do_show_groups ();
  static void do_show_include_dirs ();
  static void do_show_language (const CmtSystem::cmt_string_vector& arguments);
  static void do_show_languages ();
  static void do_show_macro (const CmtSystem::cmt_string_vector& arguments,
			     PrintMode& mode);
  static void do_show_macro_value (const CmtSystem::cmt_string_vector& arguments,
				   PrintMode& mode);
  static void do_show_macros (PrintMode& mode);
  static void do_show_manager ();
  static void do_show_packages (const CmtSystem::cmt_string_vector& arguments);
  static void do_show_path ();
  static void do_show_pattern (const CmtSystem::cmt_string_vector& arguments);
  static void do_show_pattern_names ();
  static void do_show_patterns ();
  static void do_show_pwd ();
  static void do_show_set (const CmtSystem::cmt_string_vector& arguments,
			   PrintMode& mode);
  static void do_show_set_value (const CmtSystem::cmt_string_vector& arguments,
				 PrintMode& mode);
  static void do_show_sets (PrintMode& mode);
  static void do_show_strategies ();
  static void do_show_tags ();
  static void do_show_uses ();
  static void do_show_version ();
  static void do_show_versions (const CmtSystem::cmt_string_vector& arguments);
  static void do_show_system ();
  static void do_unlock (const cmt_string& package,
                         const cmt_string& version,
                         const cmt_string& path);
  static void do_version ();


  static const cmt_string& filter_dir (const cmt_string& dir);
  static void install_cleanup_scripts ();
  static void install_setup_scripts ();
  static void install_test_cleanup_scripts ();
  static void install_test_setup_scripts ();
  static bool load (const cmt_string& path,
                    const cmt_string& package,
                    const cmt_string& version,
                    const cmt_string& tag_name = "");
  static bool need_prototypes ();
  static void parse_arguments (int argc, char* argv[],
                               CmtSystem::cmt_string_vector& arguments,
                               cmt_string& extra_line,
                               cmt_string& extra_file,
                               PrintMode& mode);
  static void parse_requirements (const cmt_string& file_name, Use* use);
  static void parse_requirements_line (const cmt_string& line,
                                       Use* use,
                                       const cmt_string& file_name = "",
                                       int line_number = 0);
  static void parse_requirements_text (const cmt_string& text,
                                       const cmt_string& file_name,
                                       Use* use);
  static int parser (const cmt_string& command_line);
  static int parser (int argc, char* argv[]);
  static void print (PrintMode mode);
  static void print_clean (PrintMode mode);
  static void print_context (Use& use, PrintMode mode, const cmt_string& tag);
  static void print_macros (PrintMode mode);
  static void print_tabs (int tabs);
  static int reach_current_package ();
  static void select (const CmtSystem::cmt_string_vector& words, Use* use,
                      const cmt_string& file_name,
                      int line_number);
  static void set_standard_macros ();
  static void use_cmt ();
  static cmt_string vector_to_string (const CmtSystem::cmt_string_vector& v);
  static void vector_to_string (const CmtSystem::cmt_string_vector& v,
                                const cmt_string& separator,
                                cmt_string& result);

  static ActionType action;
  static bool build_nmake;
  static cmt_string cmt_config;
  static CmtSystem::cmt_string_vector cmt_path;
  static CmtSystem::cmt_string_vector cmt_path_sources;
  static cmt_string cmt_root;
  static cmt_string cmt_site;
  static cmt_string cmt_version;
  static int current_build_strategy;
  static cmt_string current_config;
  static cmt_string current_dir;
  static cmt_string current_package;
  static cmt_string current_path;
  static cmt_string current_prefix;
  static AccessMode current_access;
  static VersionStrategy current_strategy;
  static CmtDirStyle current_style;
  static cmt_string current_tag;
  static cmt_string current_target;
  static cmt_string current_version;
  static bool debug;
  static cmt_string default_path;
  static Selector* default_selector;
  static int depth;
  static CmtSystem::cmt_string_vector extra_tag_values;
  static CmtSystem::cmt_string_vector extra_tags;
  static cmt_string filtered_text;
  static bool quiet;
  static bool recursive;
  static ScopeType scope;
  static bool simulation;
};

#endif
