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
libcdi
Commits
4ad22cde
Commit
4ad22cde
authored
Jul 01, 2017
by
Uwe Schulzweida
Browse files
Removed function tableInqParNamePtr().
parent
aed9becd
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/table.c
View file @
4ad22cde
...
...
@@ -826,27 +826,6 @@ int tableInqParName(int tableID, int code, char *varname)
}
const
char
*
tableInqParNamePtr
(
int
tableID
,
int
code
)
{
const
char
*
name
=
NULL
;
if
(
tableID
!=
CDI_UNDEFID
)
{
int
npars
=
parTable
[
tableID
].
npars
;
for
(
int
item
=
0
;
item
<
npars
;
item
++
)
{
if
(
parTable
[
tableID
].
pars
[
item
].
id
==
code
)
{
name
=
parTable
[
tableID
].
pars
[
item
].
name
;
break
;
}
}
}
return
name
;
}
int
tableInqParLongname
(
int
tableID
,
int
code
,
char
*
longname
)
{
if
(
((
tableID
>=
0
)
&
(
tableID
<
MAX_TABLE
))
|
(
tableID
==
CDI_UNDEFID
)
)
{
}
else
...
...
src/tablepar.h
View file @
4ad22cde
...
...
@@ -22,8 +22,6 @@ param_type;
static
void
tableLink
(
int
tableID
,
const
param_type
*
pars
,
int
npars
);
int
tableDef
(
int
modelID
,
int
tablegribID
,
const
char
*
tablename
);
const
char
*
tableInqParNamePtr
(
int
tableID
,
int
parID
);
#endif
/*
* Local Variables:
...
...
src/vlist_var.c
View file @
4ad22cde
...
...
@@ -541,24 +541,29 @@ char* vlistCopyVarName(int vlistId, int varId)
vlistCheckVarID
(
__func__
,
vlistId
,
varId
);
//If a name is set in the variable description, use that.
const
char
*
name
=
vlistptr
->
vars
[
varId
].
name
;
if
(
name
)
return
strdup
(
name
);
{
const
char
*
name
=
vlistptr
->
vars
[
varId
].
name
;
if
(
name
)
return
strdup
(
name
);
}
//Otherwise we check if we should use the table of parameter descriptions.
int
param
=
vlistptr
->
vars
[
varId
].
param
;
int
discipline
,
category
,
number
;
cdiDecodeParam
(
param
,
&
number
,
&
category
,
&
discipline
);
char
*
result
=
NULL
;
if
(
discipline
==
255
)
if
(
discipline
==
255
)
{
int
tableId
=
vlistptr
->
vars
[
varId
].
tableID
;
if
((
name
=
tableInqParNamePtr
(
tableId
,
number
)
))
char
name
[
CDI_MAX_NAME
];
name
[
0
]
=
0
;
tableInqParName
(
tableId
,
number
,
name
);
if
(
name
[
0
]
)
result
=
strdup
(
name
);
{
//No luck, fall back to outputting a name of the format "var<num>".
result
=
(
char
*
)
Malloc
(
3
+
3
*
sizeof
(
int
)
*
CHAR_BIT
/
8
+
2
);
sprintf
(
result
,
"var%d"
,
number
);
}
else
{
//No luck, fall back to outputting a name of the format "var<num>".
result
=
(
char
*
)
Malloc
(
3
+
3
*
sizeof
(
int
)
*
CHAR_BIT
/
8
+
2
);
sprintf
(
result
,
"var%d"
,
number
);
}
}
else
{
...
...
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