Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
9981bf30
Commit
9981bf30
authored
23 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
Home dir
parent
51fedc7b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
Common/Context.h
+1
-0
1 addition, 0 deletions
Common/Context.h
Common/Options.cpp
+17
-17
17 additions, 17 deletions
Common/Options.cpp
Fltk/Main.cpp
+2
-1
2 additions, 1 deletion
Fltk/Main.cpp
Fltk/Socket.cpp
+4
-3
4 additions, 3 deletions
Fltk/Socket.cpp
Fltk/Solvers.cpp
+4
-21
4 additions, 21 deletions
Fltk/Solvers.cpp
with
28 additions
and
42 deletions
Common/Context.h
+
1
−
0
View file @
9981bf30
...
@@ -39,6 +39,7 @@ public :
...
@@ -39,6 +39,7 @@ public :
char
*
display
;
// forced display host:0.0 under X11
char
*
display
;
// forced display host:0.0 under X11
int
terminal
;
// show we print to the terminal console?
int
terminal
;
// show we print to the terminal console?
char
*
editor
;
// text editor command (with included '%s')
char
*
editor
;
// text editor command (with included '%s')
char
home_dir
[
NAME_STR_L
];
// the home directory
int
position
[
2
];
// position of the menu window on the screen
int
position
[
2
];
// position of the menu window on the screen
int
gl_position
[
2
];
// position of the graphic window on the screen
int
gl_position
[
2
];
// position of the graphic window on the screen
...
...
This diff is collapsed.
Click to expand it.
Common/Options.cpp
+
17
−
17
View file @
9981bf30
// $Id: Options.cpp,v 1.
19
2001-05-2
0
1
9:24:5
3 geuzaine Exp $
// $Id: Options.cpp,v 1.
20
2001-05-2
1
1
3:01:1
3 geuzaine Exp $
#include
"Gmsh.h"
#include
"Gmsh.h"
#include
"GmshUI.h"
#include
"GmshUI.h"
...
@@ -19,6 +19,20 @@ extern GUI *WID ;
...
@@ -19,6 +19,20 @@ extern GUI *WID ;
// ************** General routines ****************************************
// ************** General routines ****************************************
void
Init_Options
(
int
num
){
void
Init_Options
(
int
num
){
char
*
tmp
;
// Home directory
if
((
tmp
=
getenv
(
"HOME"
)))
strcpy
(
CTX
.
home_dir
,
tmp
);
else
if
((
tmp
=
getenv
(
"TMP"
)))
strcpy
(
CTX
.
home_dir
,
tmp
);
else
if
((
tmp
=
getenv
(
"TEMP"
)))
strcpy
(
CTX
.
home_dir
,
tmp
);
else
strcpy
(
CTX
.
home_dir
,
""
);
if
(
strlen
(
CTX
.
home_dir
)){
#if defined(WIN32) && !defined(__CYGWIN__)
strcat
(
CTX
.
home_dir
,
"
\\
"
);
#else
strcat
(
CTX
.
home_dir
,
"/"
);
#endif
}
// Reference view storing default options
// Reference view storing default options
Post_ViewReference
=
(
Post_View
*
)
Malloc
(
sizeof
(
Post_View
))
;
Post_ViewReference
=
(
Post_View
*
)
Malloc
(
sizeof
(
Post_View
))
;
...
@@ -414,20 +428,6 @@ int Get_ColorForString(StringX4Int SX4I[], int alpha,
...
@@ -414,20 +428,6 @@ int Get_ColorForString(StringX4Int SX4I[], int alpha,
} \
} \
}
}
#if defined(WIN32) && !defined(__CYGWIN__)
#define SLASH "\\"
#else
#define SLASH "/"
#endif
#define GET_PATH(path_val) \
char *tmp; \
if ((tmp = getenv("HOME"))) strcpy(path_val, tmp); \
else if((tmp = getenv("TMP"))) strcpy(path_val, tmp); \
else if((tmp = getenv("TEMP"))) strcpy(path_val, tmp); \
else strcpy(path_val, ""); \
if(strlen(path_val)) strcat(path_val, SLASH);
char
*
opt_general_display
(
OPT_ARGS_STR
){
char
*
opt_general_display
(
OPT_ARGS_STR
){
if
(
action
&
GMSH_SET
)
CTX
.
display
=
val
;
if
(
action
&
GMSH_SET
)
CTX
.
display
=
val
;
return
CTX
.
display
;
return
CTX
.
display
;
...
@@ -459,7 +459,7 @@ char * opt_general_error_filename(OPT_ARGS_STR){
...
@@ -459,7 +459,7 @@ char * opt_general_error_filename(OPT_ARGS_STR){
char
*
opt_general_session_filename
(
OPT_ARGS_STR
){
char
*
opt_general_session_filename
(
OPT_ARGS_STR
){
if
(
action
&
GMSH_SET
){
if
(
action
&
GMSH_SET
){
CTX
.
session_filename
=
val
;
CTX
.
session_filename
=
val
;
GET_PATH
(
CTX
.
sessionrc_filename
);
strcpy
(
CTX
.
sessionrc_filename
,
CTX
.
home_dir
);
strcat
(
CTX
.
sessionrc_filename
,
CTX
.
session_filename
);
strcat
(
CTX
.
sessionrc_filename
,
CTX
.
session_filename
);
}
}
return
CTX
.
session_filename
;
return
CTX
.
session_filename
;
...
@@ -467,7 +467,7 @@ char * opt_general_session_filename(OPT_ARGS_STR){
...
@@ -467,7 +467,7 @@ char * opt_general_session_filename(OPT_ARGS_STR){
char
*
opt_general_options_filename
(
OPT_ARGS_STR
){
char
*
opt_general_options_filename
(
OPT_ARGS_STR
){
if
(
action
&
GMSH_SET
){
if
(
action
&
GMSH_SET
){
CTX
.
options_filename
=
val
;
CTX
.
options_filename
=
val
;
GET_PATH
(
CTX
.
optionsrc_filename
);
strcpy
(
CTX
.
optionsrc_filename
,
CTX
.
home_dir
);
strcat
(
CTX
.
optionsrc_filename
,
CTX
.
options_filename
);
strcat
(
CTX
.
optionsrc_filename
,
CTX
.
options_filename
);
}
}
#ifdef _FLTK
#ifdef _FLTK
...
...
This diff is collapsed.
Click to expand it.
Fltk/Main.cpp
+
2
−
1
View file @
9981bf30
// $Id: Main.cpp,v 1.2
4
2001-05-
07 06:25:26
geuzaine Exp $
// $Id: Main.cpp,v 1.2
5
2001-05-
21 13:01:13
geuzaine Exp $
#include
<signal.h>
#include
<signal.h>
...
@@ -124,6 +124,7 @@ int main(int argc, char *argv[]){
...
@@ -124,6 +124,7 @@ int main(int argc, char *argv[]){
Msg
(
LOG_INFO
,
gmsh_date
);
Msg
(
LOG_INFO
,
gmsh_date
);
Msg
(
LOG_INFO
,
gmsh_host
);
Msg
(
LOG_INFO
,
gmsh_host
);
Msg
(
LOG_INFO
,
gmsh_packager
);
Msg
(
LOG_INFO
,
gmsh_packager
);
Msg
(
LOG_INFO
,
"Home directory : '%s'"
,
CTX
.
home_dir
);
Msg
(
LOG_INFO
,
"-------------------------------------------------------"
);
Msg
(
LOG_INFO
,
"-------------------------------------------------------"
);
// Display the GUI immediately to have a quick "a la Windows" launch time
// Display the GUI immediately to have a quick "a la Windows" launch time
...
...
This diff is collapsed.
Click to expand it.
Fltk/Socket.cpp
+
4
−
3
View file @
9981bf30
/* $Id: Socket.cpp,v 1.1
0
2001-05-
07 07:55:00
geuzaine Exp $ */
/* $Id: Socket.cpp,v 1.1
1
2001-05-
21 13:01:13
geuzaine Exp $ */
#include
<stdio.h>
#include
<stdio.h>
#include
<stdlib.h>
#include
<stdlib.h>
...
@@ -119,7 +119,7 @@ int Socket_StartProgram(char *progname, char *sockname){
...
@@ -119,7 +119,7 @@ int Socket_StartProgram(char *progname, char *sockname){
strcpy
(
addr
.
sun_path
,
sockname
);
strcpy
(
addr
.
sun_path
,
sockname
);
addr
.
sun_family
=
AF_UNIX
;
addr
.
sun_family
=
AF_UNIX
;
if
(
bind
(
s
,
(
struct
sockaddr
*
)
&
addr
,
strlen
(
addr
.
sun_path
)
+
sizeof
(
addr
.
sun_family
))
<
0
)
{
if
(
bind
(
s
,
(
struct
sockaddr
*
)
&
addr
,
strlen
(
addr
.
sun_path
)
+
sizeof
(
addr
.
sun_family
))
<
0
)
{
Msg
(
GERROR
,
"Couldn't bind socket to name
"
);
Msg
(
GERROR
,
"Couldn't bind socket to name
'%s'"
,
sockname
);
return
-
1
;
return
-
1
;
}
}
...
@@ -158,7 +158,8 @@ int Socket_StartProgram(char *progname, char *sockname){
...
@@ -158,7 +158,8 @@ int Socket_StartProgram(char *progname, char *sockname){
}
}
int
Socket_StopProgram
(
char
*
progname
,
char
*
sockname
,
int
sock
){
int
Socket_StopProgram
(
char
*
progname
,
char
*
sockname
,
int
sock
){
if
(
Socket_UnlinkName
(
sockname
)
==-
1
)
Msg
(
WARNING
,
"Impossible to unlink the socket"
);
if
(
Socket_UnlinkName
(
sockname
)
==-
1
)
Msg
(
WARNING
,
"Impossible to unlink the socket '%s'"
,
sockname
);
close
(
sock
);
close
(
sock
);
return
0
;
return
0
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Fltk/Solvers.cpp
+
4
−
21
View file @
9981bf30
// $Id: Solvers.cpp,v 1.
6
2001-05-1
7
13:1
4
:1
5
geuzaine Exp $
// $Id: Solvers.cpp,v 1.
7
2001-05-
2
1 13:
0
1:1
3
geuzaine Exp $
#include
"Gmsh.h"
#include
"Gmsh.h"
...
@@ -11,33 +11,16 @@
...
@@ -11,33 +11,16 @@
#include
"Socket.h"
#include
"Socket.h"
#include
"OpenFile.h"
#include
"OpenFile.h"
#include
"Solvers.h"
#include
"Solvers.h"
#include
"GmshUI.h"
#include
"GmshUI.h"
#include
"GUI.h"
#include
"GUI.h"
#include
"Mesh.h"
#include
"Mesh.h"
#include
"Draw.h"
#include
"Draw.h"
#include
"Context.h"
extern
Context_T
CTX
;
extern
GUI
*
WID
;
extern
GUI
*
WID
;
#if defined(WIN32) && !defined(__CYGWIN__)
#define SLASH "\\"
#else
#define SLASH "/"
#endif
#define GET_PATH(path_val) \
char *tmp; \
if ((tmp = getenv("HOME"))) strcpy(path_val, tmp); \
else if((tmp = getenv("TMP"))) strcpy(path_val, tmp); \
else if((tmp = getenv("TEMP"))) strcpy(path_val, tmp); \
else strcpy(path_val, ""); \
if(strlen(path_val)) strcat(path_val, SLASH);
// interface to GetDP
// interface to GetDP
_GetDP_Info
GetDP_Info
;
_GetDP_Info
GetDP_Info
;
...
@@ -46,7 +29,7 @@ int GetDP(char *args){
...
@@ -46,7 +29,7 @@ int GetDP(char *args){
int
sock
,
type
,
i
,
n
;
int
sock
,
type
,
i
,
n
;
char
progname
[
1000
],
sockname
[
1000
],
str
[
1000
];
char
progname
[
1000
],
sockname
[
1000
],
str
[
1000
];
GET_PATH
(
sockname
);
strcpy
(
sockname
,
CTX
.
home_dir
);
strcat
(
sockname
,
".gmshsock"
);
strcat
(
sockname
,
".gmshsock"
);
sprintf
(
progname
,
"%s %s"
,
GetDP_Info
.
command
,
args
);
sprintf
(
progname
,
"%s %s"
,
GetDP_Info
.
command
,
args
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment