@@ -43,102 +43,86 @@ encapsulated package Print
4343
4444 public function saveAndClearBuf "saves and clears content of buffer and return a handle to the saved buffer so it can be restored by restorBuf later on"
4545 output Integer handle;
46- external "C" handle = Print_saveAndClearBuf() annotation(Library = "omcruntime" );
46+ external "C" handle = Print_saveAndClearBuf(OpenModelica.threadData() ) annotation(Library = "omcruntime" );
4747end saveAndClearBuf;
4848
4949public function restoreBuf
5050 input Integer handle;
51- external "C" Print_restoreBuf(handle) annotation(Library = "omcruntime" );
51+ external "C" Print_restoreBuf(OpenModelica.threadData(), handle) annotation(Library = "omcruntime" );
5252end restoreBuf;
5353
54- /* TODO: Implement an external C function for bootstrapped omc or remove me. DO NOT SIMPLY REMOVE THIS COMMENT
55- public function setBufSize
56- input Integer newSize;
57-
58- external "C" Print_setBufSize(newSize) annotation(Library = "omcruntime");
59- end setBufSize;*/
60-
61- /* TODO: Implement an external C function for bootstrapped omc or remove me. DO NOT SIMPLY REMOVE THIS COMMENT
62- public function unSetBufSize
63- input Integer newSize "not used, this is a debuging func";
64-
65- external "C" Print_unSetBufSize(newSize) annotation(Library = "omcruntime");
66- end unSetBufSize;*/
67-
6854public function printErrorBuf
6955 input String inString;
7056
71- external "C" Print_printErrorBuf(inString) annotation(Library = "omcruntime" );
57+ external "C" Print_printErrorBuf(OpenModelica.threadData(), inString) annotation(Library = "omcruntime" );
7258end printErrorBuf;
7359
7460public function clearErrorBuf
7561
76- external "C" Print_clearErrorBuf() annotation(Library = "omcruntime" );
62+ external "C" Print_clearErrorBuf(OpenModelica.threadData() ) annotation(Library = "omcruntime" );
7763end clearErrorBuf;
7864
7965public function getErrorString
8066 output String outString;
8167
82- external "C" outString = Print_getErrorString() annotation(Library = "omcruntime" );
68+ external "C" outString = Print_getErrorString(OpenModelica.threadData() ) annotation(Library = "omcruntime" );
8369end getErrorString;
8470
8571public function printBuf
8672 input String inString;
8773
88- external "C" Print_printBuf(inString) annotation(Library = "omcruntime" );
74+ external "C" Print_printBuf(OpenModelica.threadData(), inString) annotation(Library = "omcruntime" );
8975end printBuf;
9076
9177public function clearBuf
9278
93- external "C" Print_clearBuf() annotation(Library = "omcruntime" );
79+ external "C" Print_clearBuf(OpenModelica.threadData() ) annotation(Library = "omcruntime" );
9480end clearBuf;
9581
9682public function getString "Does not clear the buffer"
9783 output String outString;
9884
99- external "C" outString = Print_getString() annotation(Library = "omcruntime" );
85+ external "C" outString = Print_getString(OpenModelica.threadData() ) annotation(Library = "omcruntime" );
10086end getString;
10187
10288public function writeBuf
10389 input String inString;
10490
105- external "C" Print_writeBuf(inString) annotation(Library = "omcruntime" );
91+ external "C" Print_writeBuf(OpenModelica.threadData(), inString) annotation(Library = "omcruntime" );
10692end writeBuf;
10793
10894public function writeBufConvertLines
10995 "Writes the print buffer to the filename, with /*#modelicaLine...*/ directives converted to #line C preprocessor macros"
11096 input String filename;
111- external "C" Print_writeBufConvertLines(filename) annotation(Library = "omcruntime" );
97+ external "C" Print_writeBufConvertLines(OpenModelica.threadData(), filename) annotation(Library = "omcruntime" );
11298end writeBufConvertLines;
11399
114100public function getBufLength
115101"Gets the actual length of the filled space in the print buffer."
116102 output Integer outBufFilledLength;
117103
118- external "C" outBufFilledLength = Print_getBufLength() annotation(Library = "omcruntime" );
104+ external "C" outBufFilledLength = Print_getBufLength(OpenModelica.threadData() ) annotation(Library = "omcruntime" );
119105end getBufLength;
120106
121107public function printBufSpace
122108"Prints the given number of spaces to the print buffer."
123109 input Integer inNumOfSpaces;
124110
125- external "C" Print_printBufSpace(inNumOfSpaces) annotation(Library = "omcruntime" );
111+ external "C" Print_printBufSpace(OpenModelica.threadData(), inNumOfSpaces) annotation(Library = "omcruntime" );
126112end printBufSpace;
127113
128114public function printBufNewLine
129115"Prints one new line character to the print buffer."
130116
131- external "C" Print_printBufNewLine() annotation(Library = "omcruntime" );
117+ external "C" Print_printBufNewLine(OpenModelica.threadData() ) annotation(Library = "omcruntime" );
132118end printBufNewLine;
133119
134120public function hasBufNewLineAtEnd
135121"Tests if the last outputted character in the print buffer is a new line.
136122 It is a (temporary) workaround to stringLength()'s O(n) cost."
137123 output Boolean outHasNewLineAtEnd ;
138124
139- external "C" outHasNewLineAtEnd = Print_hasBufNewLineAtEnd() annotation(Library = "omcruntime" );
125+ external "C" outHasNewLineAtEnd = Print_hasBufNewLineAtEnd(OpenModelica.threadData() ) annotation(Library = "omcruntime" );
140126end hasBufNewLineAtEnd;
141127
142128end Print;
143-
144-
0 commit comments