diff --git a/Common/Context.cpp b/Common/Context.cpp index d63a6bb7bb8f569156b99e462d860789cf6ca199..f94bd4d31413ecf95fa1e204b74f48bdde46410c 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 fab8a22ccc0a58a82a54ee17432f32287f8caca4..01e94645915bedc41a4e45e8d0eda8ccf4f9f585 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 6f8b91db62a9f0e5667743be5e6e0a472c299cd1..acb0da1f63ffff9e4d4d72f736be9e7eaefa81bb 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);