Skip to content

Commit

Permalink
- Some more changes that rely on new RML
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund committed Oct 27, 2010
1 parent 326775b commit ed0516b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
26 changes: 13 additions & 13 deletions Compiler/Print.mo
Expand Up @@ -44,81 +44,81 @@ package Print
public function setBufSize
input Integer newSize;

external "C" ;
external "C" Print_setBufSize(newSize) annotation(Library = "omcruntime");
end setBufSize;

public function unSetBufSize
input Integer newSize "not used, this is a debuging func";

external "C" ;
external "C" Print_unSetBufSize(newSize) annotation(Library = "omcruntime");
end unSetBufSize;

public function printErrorBuf
input String inString;

external "C" ;
external "C" Print_printErrorBuf(inString) annotation(Library = "omcruntime");
end printErrorBuf;

public function clearErrorBuf

external "C" ;
external "C" Print_clearErrorBuf() annotation(Library = "omcruntime");
end clearErrorBuf;

public function getErrorString
output String outString;

external "C" outString = Print_getErrorString();
external "C" outString = Print_getErrorString() annotation(Library = "omcruntime");
end getErrorString;

public function printBuf
input String inString;

external "C" ;
external "C" Print_printBuf(inString) annotation(Library = "omcruntime");
end printBuf;

public function clearBuf

external "C" ;
external "C" Print_clearBuf() annotation(Library = "omcruntime");
end clearBuf;

public function getString "Does not clear the buffer"
output String outString;

external "C" outString = Print_getString();
external "C" outString = Print_getString() annotation(Library = "omcruntime");
end getString;

public function writeBuf
input String inString;

external "C" ;
external "C" Print_writeBuf(inString) annotation(Library = "omcruntime");
end writeBuf;

public function getBufLength
"Gets the actual length of the filled space in the print buffer."
output Integer outBufFilledLength;

external "C" outBufFilledLength = Print_getBufLength();
external "C" outBufFilledLength = Print_getBufLength() annotation(Library = "omcruntime");
end getBufLength;

public function printBufSpace
"Prints the given number of spaces to the print buffer."
input Integer inNumOfSpaces;

external "C" ;
external "C" Print_printBufSpace(inNumOfSpaces) annotation(Library = "omcruntime");
end printBufSpace;

public function printBufNewLine
"Prints one new line character to the print buffer."

external "C" ;
external "C" Print_printBufNewLine() annotation(Library = "omcruntime");
end printBufNewLine;

public function hasBufNewLineAtEnd
"Tests if the last outputted character in the print buffer is a new line.
It is a (temporary) workaround to stringLength()'s O(n) cost."
output Boolean outHasNewLineAtEnd ;

external "C" outHasNewLineAtEnd = Print_hasBufNewLineAtEnd();
external "C" outHasNewLineAtEnd = Print_hasBufNewLineAtEnd() annotation(Library = "omcruntime");
end hasBufNewLineAtEnd;

end Print;
Expand Down
12 changes: 6 additions & 6 deletions Compiler/runtime/Print_omc.cpp
Expand Up @@ -34,13 +34,13 @@ extern "C" {

#include "printimpl.c"

extern void printErrorBuf(const char* str)
extern void Print_printErrorBuf(const char* str)
{
if (PrintImpl__printErrorBuf(str))
throw 1;
}

extern void printBuf(const char* str)
extern void Print_printBuf(const char* str)
{
if (PrintImpl__printBuf(str))
throw 1;
Expand Down Expand Up @@ -72,23 +72,23 @@ extern const char* Print_getErrorString(void)
return strdup(res);
}

extern void clearErrorBuf(void)
extern void Print_clearErrorBuf(void)
{
PrintImpl__clearErrorBuf();
}

extern void clearBuf(void)
extern void Print_clearBuf(void)
{
PrintImpl__clearBuf();
}

extern void printBufSpace(int numSpace)
extern void Print_printBufSpace(int numSpace)
{
if (PrintImpl__printBufSpace(numSpace))
throw 1;
}

extern void printBufNewLine(void)
extern void Print_printBufNewLine(void)
{
if (PrintImpl__printBufNewLine())
throw 1;
Expand Down

0 comments on commit ed0516b

Please sign in to comment.