From ed88a94065d8fda1985f95913b234e7e0d5f6334 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Fri, 8 Dec 2000 11:16:36 +0000 Subject: [PATCH] *** empty log message *** --- Common/Context.cpp | 21 +++++++++++++++++++-- Common/Context.h | 4 ++-- Geo/Print_Geo.cpp | 3 +-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/Common/Context.cpp b/Common/Context.cpp index d63a6bb7bb..f94bd4d314 100644 --- a/Common/Context.cpp +++ b/Common/Context.cpp @@ -1,4 +1,4 @@ -/* $Id: Context.cpp,v 1.17 2000-12-08 10:56:36 geuzaine Exp $ */ +/* $Id: Context.cpp,v 1.18 2000-12-08 11:16:34 geuzaine Exp $ */ #include "Gmsh.h" #include "Const.h" @@ -342,8 +342,19 @@ void Init_Context(void){ extern List_T *Post_ViewList; -void Print_Context(FILE *file){ +void Print_Context(char *filename){ + FILE *file; int i ; + + if(filename){ + file = fopen(filename,"w"); + if(!file){ + Msg(WARNING, "Unable to Open File '%s'", filename); + return; + } + } + else + file = stdout; Print_StringOptions(GeneralOptions_String, "General.", file); Print_NumberOptions(GeneralOptions_Number, "General.", file); @@ -374,6 +385,12 @@ void Print_Context(FILE *file){ Print_NumberOptions(PrintOptions_Number, "Print.", file); Print_ArrayOptions(PrintOptions_Array, "Print.", file); Print_ColorOptions(PrintOptions_Color, "Print.", file); + + if(filename){ + Msg (INFOS, "Options Output Complete '%s'", filename); + Msg (INFO, "Wrote File '%s'", filename); + fclose(file); + } } void Context_T::buildRotmatrix(float m[4][4]) diff --git a/Common/Context.h b/Common/Context.h index fab8a22ccc..01e9464591 100644 --- a/Common/Context.h +++ b/Common/Context.h @@ -1,4 +1,4 @@ -/* $Id: Context.h,v 1.16 2000-12-06 22:09:53 geuzaine Exp $ */ +/* $Id: Context.h,v 1.17 2000-12-08 11:16:34 geuzaine Exp $ */ #ifndef _CONTEXT_H_ #define _CONTEXT_H_ @@ -202,6 +202,6 @@ void Print_ColorOptions(StringXArray s[], char *prefix, FILE *file); void Init_Colors (int num); void Init_Context (void); -void Print_Context(FILE *file); +void Print_Context(char *filename); #endif diff --git a/Geo/Print_Geo.cpp b/Geo/Print_Geo.cpp index 6f8b91db62..acb0da1f63 100644 --- a/Geo/Print_Geo.cpp +++ b/Geo/Print_Geo.cpp @@ -1,4 +1,4 @@ -/* $Id: Print_Geo.cpp,v 1.7 2000-12-05 15:47:04 geuzaine Exp $ */ +/* $Id: Print_Geo.cpp,v 1.8 2000-12-08 11:16:36 geuzaine Exp $ */ #include "Gmsh.h" #include "Geo.h" @@ -173,7 +173,6 @@ void Print_Geo(Mesh *M, char *filename){ else FOUT = stdout; - Print_Context(FOUT); Tree_Action(M->Points,Print_Point); Tree_Action(M->Curves,Print_Curve); Tree_Action(M->Surfaces,Print_Surface); -- GitLab