Skip to content
Snippets Groups Projects
Commit 7c6fd0ae authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

option to parse files silently

parent 8926b500
No related branches found
No related tags found
No related merge requests found
// $Id: GetOptions.cpp,v 1.42 2001-11-19 09:29:18 geuzaine Exp $
// $Id: GetOptions.cpp,v 1.43 2001-12-06 10:10:42 geuzaine Exp $
#include <unistd.h>
#include "Gmsh.h"
......@@ -94,8 +94,8 @@ void Get_Options (int argc, char *argv[], int *nbfiles) {
InitSymbols(); //this symbol context is local to option parsing (the
//symbols will not interfere with subsequent OpenFiles)
ParseFile(CTX.sessionrc_filename);
ParseFile(CTX.optionsrc_filename);
ParseFile(CTX.sessionrc_filename,1);
ParseFile(CTX.optionsrc_filename,1);
// Get command line options
......@@ -179,7 +179,7 @@ void Get_Options (int argc, char *argv[], int *nbfiles) {
i++;
CTX.terminal = 1;
if(argv[i] && argv[i+1]){
ParseFile(argv[i]);
ParseFile(argv[i],0);
if(List_Nbr(CTX.post.list))
Write_View(1,(Post_View*)List_Pointer(CTX.post.list, 0),argv[i+1]);
else
......
// $Id: OpenFile.cpp,v 1.25 2001-12-04 09:31:18 geuzaine Exp $
// $Id: OpenFile.cpp,v 1.26 2001-12-06 10:10:42 geuzaine Exp $
#include "Gmsh.h"
#include "Numeric.h"
......@@ -25,7 +25,7 @@ extern GUI *WID;
extern Mesh *THEM, M;
extern Context_T CTX;
int ParseFile(char *f){
int ParseFile(char *f, int silent){
char String[256];
int status;
......@@ -36,7 +36,7 @@ int ParseFile(char *f){
if(!(yyin = fopen(yyname,"r")))
return 0;
Msg(STATUS2, "Loading '%s'", yyname);
if(!silent) Msg(STATUS2, "Loading '%s'", yyname);
fpos_t position;
fgetpos(yyin, &position);
......@@ -70,7 +70,8 @@ int ParseFile(char *f){
}
fclose(yyin);
Msg(STATUS2, "Loaded '%s'", yyname);
if(!silent) Msg(STATUS2, "Loaded '%s'", yyname);
return status;
}
......@@ -81,12 +82,12 @@ void ParseString(char *str){
if((f = fopen(CTX.tmp_filename,"w"))){
fprintf(f,"%s\n", str);
fclose(f);
ParseFile(CTX.tmp_filename);
ParseFile(CTX.tmp_filename,0);
}
}
void MergeProblem(char *name){
ParseFile(name);
ParseFile(name,0);
if (yyerrorstate) return;
}
......@@ -131,7 +132,7 @@ void OpenProblem(char *name){
int nb = List_Nbr(CTX.post.list);
status = ParseFile(CTX.filename);
status = ParseFile(CTX.filename,0);
ApplyLcFactor(THEM);
......
......@@ -3,7 +3,7 @@
#define MAX_OPEN_FILES 256
int ParseFile(char *filename);
int ParseFile(char *filename, int silent);
void ParseString(char *str);
void OpenProblem(char *filename);
void MergeProblem(char *filename);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment