Skip to content
Snippets Groups Projects
Commit 09f412ea authored by Thomas Jahns's avatar Thomas Jahns :cartwheel:
Browse files

Enable handling of bool parameters and return values.

* To the F77 and F2003 interface generators that is.
parent dda540c1
No related branches found
No related tags found
No related merge requests found
......@@ -134,6 +134,16 @@ $argumentTemplates =
:callExpression => '<name>_dummy',
:passAs => 'integer(c_<type>), value :: <name>_dummy',
:postcallStatements => ''
}, { #logical
:regex => '^\s*(?<type>bool)\s+(?<name>\w+)\s*$',
:placeholders => %w[name type],
:dummyName => '<name>_dummy',
:acceptAs => 'logical(c_<type>), value :: <name>_dummy',
:helperVars => '',
:precallStatements => '',
:callExpression => '<name>_dummy',
:passAs => 'logical(c_<type>), value :: <name>_dummy',
:postcallStatements => ''
}, { #<floatTypes>
:regex => '^\s*(?<type><floatTypes>)\s+(?<name>\w+)\s*$',
:placeholders => %w[name type],
......@@ -469,6 +479,16 @@ $returnTypeTemplates = [
:receiveAs => 'integer(c_<type>)',
:assignVariable => $wrapperResultVarName,
:postcallStatements => ''
}, { #bool
:regex => '^\s*(?<type>bool)\s*$',
:placeholders => %w[type],
:isVoid => false,
:returnAs => 'logical(c_<type>)',
:helperVars => '',
:precallStatements => '',
:receiveAs => 'logical(c_<type>)',
:assignVariable => $wrapperResultVarName,
:postcallStatements => ''
}, { #<floatTypes>
:regex => '^\s*(?<type><floatTypes>)\s*$',
:placeholders => %w[type],
......
......@@ -86,7 +86,7 @@ static void doctotxt(FILE *fp, Docu *doc, size_t ndoc)
}
}
enum cftype {ISVOID, ISCONSTSTRING, ISINT, ISREAL, ISDOUBLE, ISMPI_COMM,
enum cftype {ISVOID, ISCONSTSTRING, ISINT, ISLOGICAL, ISREAL, ISDOUBLE, ISMPI_COMM,
ISXT_IDXLIST, ISCHOICE, ISINTP, ISFLOATV, ISFLOATVV,
ISDOUBLEV, ISDOUBLEVV, ISINTV, ISINTVV, ISINTVVV, ISREALP,
ISDOUBLEP, ISCBUF, ISUUID, ISUCHAR, ISSTRING, ISSTRINGP,
......@@ -152,6 +152,8 @@ static struct symbol funArgSym[]
"^"WS"*const"WS"+char"WS"+\\*"SYMRE WS"*\\(", 1, 0, 0 },
{ "INTEGER", "INT", "%sint %.*s",
"^"WS"*(const"WS"+)?int("WS"+"SYMRE")?"WS"*[,\\)]", 3, 0, 0 },
{ "LOGICAL", "LOGICAL", "%bool %.*s",
"^"WS"*(const"WS"+)?bool("WS"+"SYMRE")?"WS"*[,\\)]", 3, 0, 0 },
{ "REAL", "FLOAT", "%sfloat %.*s",
"^"WS"*(const"WS"+)?float"WS"+"SYMRE"?"WS"*[,\\)]", 2, 0, 0 },
{ "DOUBLEPRECISION", "DOUBLE", "%sdouble %.*s",
......@@ -215,6 +217,8 @@ static struct symbol funRet[] = {
"char"WS"+\\*"WS"*"SYMRE WS"*\\(", 1, 0, 0 },
{ "INTEGER", "INT", "%sint %.*s",
"(const"WS"+)?int"WS"+"SYMRE WS"*\\(", 2, 0, 0 },
{ "LOGICAL", "LOGICAL", "%sbool %.*s",
"(const"WS"+)?bool"WS"+"SYMRE WS"*\\(", 2, 0, 0 },
{ "REAL", "FLOAT", "%sfloat %.*s",
"(const"WS"+)?float"WS"+"SYMRE WS"*\\(", 2, 0, 0 },
{ "DOUBLEPRECISION", "DOUBLE", "%sdouble %.*s",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment