Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
OpenGEODE
Commits
6276fc84
Commit
6276fc84
authored
Dec 17, 2014
by
Maxime Perrotin
Browse files
Generate access to internal state in shared libs
parent
8f63fd0f
Changes
1
Hide whitespace changes
Inline
Side-by-side
opengeode/AdaGenerator.py
View file @
6276fc84
...
...
@@ -190,6 +190,19 @@ def _process(process, simu=False, **kwargs):
process_level_decl
.
append
(
'function get_state return chars_ptr;'
)
process_level_decl
.
append
(
'pragma export(C, get_state, "{}_state");'
.
format
(
process_name
))
# Functions to get gobal variables (length and value)
for
var_name
,
(
var_type
,
_
)
in
process
.
variables
.
viewitems
():
process_level_decl
.
append
(
"function l_{name}_size return integer "
"is (l_{name}'Size) with Export, "
"Convention => C, "
'Link_Name => "{name}_size";'
.
format
(
name
=
var_name
))
process_level_decl
.
append
(
"function l_{name}_value return {sort} "
"is (l_{name}) with Export, "
"Convention => C, "
'Link_Name => "{name}_value";'
.
format
(
name
=
var_name
,
sort
=
type_name
(
var_type
)))
# Add the declaration of the runTransition procedure
process_level_decl
.
append
(
'procedure runTransition(Id: Integer);'
)
...
...
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