Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
cdo
Commits
ee5a241b
Commit
ee5a241b
authored
Jun 05, 2017
by
Uwe Schulzweida
Browse files
Merge branch 'develop' of git.mpimet.mpg.de:cdo into develop
parents
1c7169bd
b095a2bc
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/modules.cc
View file @
ee5a241b
...
...
@@ -1406,3 +1406,20 @@ void operatorPrintList(bool print_no_output) {
std
::
cout
<<
str
<<
std
::
endl
;
}
}
bool
is_alias
(
char
*
operatorName
)
{
return
(
aliases
.
find
(
std
::
string
(
operatorName
))
!=
aliases
.
end
());
}
void
get_original
(
char
*
operatorName
)
{
if
(
is_alias
(
operatorName
)){
std
::
string
opName
=
aliases
[
std
::
string
(
operatorName
)];
operatorName
=
(
char
*
)
realloc
(
operatorName
,
opName
.
size
());
strcpy
(
operatorName
,
opName
.
c_str
());
}
else
{
Error
(
"%s is not an alias"
,
operatorName
);
}
}
src/modules.h
View file @
ee5a241b
...
...
@@ -71,6 +71,8 @@ int operatorStreamNumber(const char *operatorName);
void
operatorPrintAll
(
void
);
void
operatorPrintList
(
bool
print_no_output
);
bool
is_alias
(
char
*
operatorName
);
void
get_original
(
char
*
operatorName
);
#ifdef CUSTOM_MODULES
void
load_custom_module
(
std
::
string
path
);
void
load_custom_modules
(
std
::
string
folder_path
);
...
...
src/process.cc
View file @
ee5a241b
...
...
@@ -945,10 +945,11 @@ int cdoOperatorID(void)
if
(
Process
[
processID
].
noper
>
0
)
{
for
(
operID
=
0
;
operID
<
Process
[
processID
].
noper
;
operID
++
)
for
(
operID
=
0
;
operID
<
Process
[
processID
].
noper
;
operID
++
)
{
if
(
Process
[
processID
].
oper
[
operID
].
name
)
if
(
strcmp
(
Process
[
processID
].
operatorName
,
Process
[
processID
].
oper
[
operID
].
name
)
==
0
)
break
;
}
if
(
operID
==
Process
[
processID
].
noper
)
cdoAbort
(
"Operator not callable by this name!"
);
}
...
...
src/util.cc
View file @
ee5a241b
...
...
@@ -238,10 +238,11 @@ const char *getOperatorName(const char *operatorArg)
}
/* return operatorName; */
std
::
string
opName
=
aliases
[
std
::
string
(
operatorName
)];
memcpy
(
operatorName
,
opName
.
c_str
(),
opName
.
size
()
);
return
operatorName
;
if
(
is_alias
(
operatorName
))
{
get_original
(
operatorName
);
}
return
operatorName
;
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment