1 /*$Id: globals.cc,v 26.138 2013/04/24 03:03:11 al Exp $ -*- C++ -*-
2 * Copyright (C) 2001 Albert Davis
3 * Author: Albert Davis <aldavis@gnu.org>
4 *
5 * This file is part of "Gnucap", the Gnu Circuit Analysis Package
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
10 * any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 * 02110-1301, USA.
21 *------------------------------------------------------------------
22 * static objects -- construct first, destruct last
23 */
24 #include "globals.h"
25 #include "u_prblst.h"
26 #include "e_cardlist.h"
27 #include "u_status.h"
28 #include "patchlev.h"
29 /*--------------------------------------------------------------------------*/
30 // here to make sure they get constructed and destructed in proper order
31 // first construct, last destruct
32
lib_version()33 const char* lib_version()
34 {
35 return PATCHLEVEL;
36 }
37
38 // dispatchers must be constructed before any static objects they contain
39 // and destructed after.
40 RUN_MODE ENV::run_mode = rPRE_MAIN;
41 DISPATCHER<CMD> command_dispatcher;
42 DISPATCHER<COMMON_COMPONENT> bm_dispatcher;
43 DISPATCHER<MODEL_CARD> model_dispatcher;
44 DISPATCHER<CARD> device_dispatcher;
45 DISPATCHER<LANGUAGE> language_dispatcher;
46 DISPATCHER<FUNCTION> function_dispatcher;
47 DISPATCHER<FUNCTION> measure_dispatcher;
48 DISPATCHER<CKT_BASE> status_dispatcher;
49 DISPATCHER<CKT_BASE> help_dispatcher;
50 DISPATCHER<PROBELIST> probe_dispatcher;
51
52 // for the rest, order should not matter, but it is convenient here
53 CARD_LIST CARD_LIST::card_list; // root circuit
54
55 // the rest of this should not be here, is residue of old stuff
56 STATUS status;
57 std::string head;
58 /*--------------------------------------------------------------------------*/
59 /* sweep command. This will go away with a rewrite of looping */
60 const int swp_nest_max = 1; /* no loop, "future" expansion */
61 int swp_count[swp_nest_max]; /* sweep counter */
62 int swp_steps[swp_nest_max]; /* sweep number of steps */
63 int swp_type[swp_nest_max]; /* type of sweep (log or linear) */
64 int swp_nest; /* sweep nesting (recursion) level */
65 /*--------------------------------------------------------------------------*/
66 /*--------------------------------------------------------------------------*/
67