57 int main (
int argc,
char ** argv) {
60 char * outfile = NULL;
61 char * projPath = NULL;
71 std::list<std::string> vamodules;
75 ::srand (::time (NULL));
78 for (
int i = 1;
i < argc;
i++) {
79 if (!strcmp (argv[
i],
"-v") || !strcmp (argv[i],
"--version")) {
81 "Qucsator " PACKAGE_VERSION
"\n"
82 "Copyright (C) 2003-2009 "
83 "Stefan Jahn <stefan@lkcc.org>\n"
84 "Copyright (C) 2006 Helene Parruitte <parruit@enseirb.fr>\n"
85 "Copyright (C) 2006 Bastien Roucaries <roucaries.bastien@gmail.com>\n"
86 "\nThis is free software; see the source for copying "
87 "conditions. There is NO\n"
88 "warranty; not even for MERCHANTABILITY or FITNESS FOR A "
89 "PARTICULAR PURPOSE.\n");
92 if (!strcmp (argv[i],
"-h") || !strcmp (argv[i],
"--help")) {
94 "Usage: %s [OPTION]...\n\n"
95 " -h, --help display this help and exit\n"
96 " -v, --version display version information and exit\n"
97 " -i FILENAME use file as input netlist (default stdin)\n"
98 " -o FILENAME use file as output dataset (default stdout)\n"
99 " -b, --bar enable textual progress bar\n"
100 " -g, --gui special progress bar used by gui\n"
101 " -c, --check check the input netlist and exit\n"
103 " -l, --listing emit C-code for available definitions\n"
105 " -p, --path project path (or location of dynamic modules)\n"
106 " -m, --module list of dynamic loaded modules (base names separated by space)\n"
107 "\nReport bugs to <" PACKAGE_BUGREPORT
">.\n", argv[0]);
110 else if (!strcmp (argv[i],
"-i")) {
113 else if (!strcmp (argv[i],
"-o")) {
117 else if (!strcmp (argv[i],
"-b") || !strcmp (argv[i],
"--bar")) {
120 else if (!strcmp (argv[i],
"-g") || !strcmp (argv[i],
"--gui")) {
123 else if (!strcmp (argv[i],
"-c") || !strcmp (argv[i],
"--check")) {
126 else if (!strcmp (argv[i],
"-l") || !strcmp (argv[i],
"--listing")) {
130 else if (!strcmp (argv[i],
"-p") || !strcmp (argv[i],
"--path")) {
131 projPath = argv[++
i];
133 else if (!strcmp (argv[i],
"-m") || !strcmp (argv[i],
"--module")) {
138 vamodules.push_back(argv[i]);
162 std::string sLine =
"";
165 std::string projPathNet =
"";
166 std::string projVaMoules =
"";
170 while (!file.eof()) {
171 getline(file, sLine);
173 if (sLine.find(
"--path") != std::string::npos) {
174 std::cout << sLine << std::endl;
177 pos = sLine.find(
"=");
178 sLine.erase(0, pos + 1);
179 std::cout << sLine << std::endl;
190 if (sLine.find(
"--module") != std::string::npos) {
191 std::cout << sLine << std::endl;
194 pos = sLine.find(
"=");
195 sLine.erase(0, pos + 1);
197 projVaMoules = sLine;
200 std::istringstream ss(sLine);
203 while(std::getline(ss, token,
' ')) {
204 std::cout << token <<
'\n';
206 vamodules.push_back(token);
217 root =
new environment (
"root");
220 subnet =
new net (
"subnet");
221 in = infile ?
new input (infile) :
new input ();
224 subnet->setEnv (root);
228 if (in->netlist (subnet) != 0) {
241 gnd->setNode (0,
"gnd");
242 gnd->setName (
"GND");
243 subnet->insertCircuit (gnd);
247 out = subnet->runAnalysis (err);
251 ret |= root->equationSolver (out);
252 out->setFile (outfile);
static void registerDynamicModules(char *proj, std::list< std::string > modlist)
static void registerModules(void)
int main(int argc, char **argv)
void print(const char *prefix=NULL)
static void closeDynamicLibs(void)
void netlist_destroy_env(void)
The environment class definition.
static void unregisterModules(void)
void logprint(int level, const char *format,...)