Skip to content

Commit

Permalink
- Implemented some more external functions in libomcruntime
Browse files Browse the repository at this point in the history
- On Unix you no longer need to set OPENMODELICAHOME
  - It uses the --prefix from configuration
  - OPENMODELICAHOME still overrides that since most developers don't run make install


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7014 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Nov 14, 2010
1 parent a06aaab commit 3fc6154
Show file tree
Hide file tree
Showing 17 changed files with 1,755 additions and 1,419 deletions.
1 change: 1 addition & 0 deletions Compiler/DAE.mo
Expand Up @@ -666,6 +666,7 @@ public constant Type T_BOXED_DEFAULT = (T_BOXED((T_NOTYPE(),NONE())),NONE());
public constant Type T_LIST_DEFAULT = (T_LIST((T_NOTYPE(),NONE())),NONE());
public constant Type T_NONE_DEFAULT = (T_METAOPTION((T_NOTYPE(),NONE())),NONE());
public constant Type T_NOTYPE_DEFAULT = (T_NOTYPE(),NONE());
public constant Type T_NORETCALL_DEFAULT = (T_NORETCALL(),NONE());

public uniontype TType "-TType contains the actual type"
record T_INTEGER
Expand Down
30 changes: 15 additions & 15 deletions Compiler/IOStreamExt.mo
Expand Up @@ -46,99 +46,99 @@ function createFile
input String fileName;
output Integer fileID;

external "C";
external "C" fileID=IOStreamExt_createFile(fileName) annotation(Library = "omcruntime");
end createFile;

function closeFile
input Integer fileID;

external "C";
external "C" IOStreamExt_closeFile(fileID) annotation(Library = "omcruntime");
end closeFile;

function deleteFile
input Integer fileID;

external "C";
external "C" IOStreamExt_deleteFile(fileID) annotation(Library = "omcruntime");
end deleteFile;

function clearFile
input Integer fileID;

external "C";
external "C" IOStreamExt_clearFile(fileID) annotation(Library = "omcruntime");
end clearFile;

function appendFile
input Integer fileID;
input String inString;

external "C";
external "C" IOStreamExt_appendFile(fileID,inString) annotation(Library = "omcruntime");
end appendFile;

function readFile
input Integer fileID;
output String outString;

external "C";
external "C" outString=IOStreamExt_readFile(fileID) annotation(Library = "omcruntime");
end readFile;

function printFile
input Integer fileID;
input Integer whereToPrint "stdout:1, stderr:2";

external "C";
external "C" IOStreamExt_printFile(fileID,whereToPrint) annotation(Library = "omcruntime");
end printFile;

function createBuffer
output Integer bufferID;

external "C";
external "C" bufferID = IOStreamExt_createBuffer() annotation(Library = "omcruntime");
end createBuffer;

function appendBuffer
input Integer bufferID;
input String inString;

external "C";
external "C" IOStreamExt_appendBuffer(bufferID,inString) annotation(Library = "omcruntime");
end appendBuffer;

function deleteBuffer
input Integer bufferID;

external "C";
external "C" IOStreamExt_deleteBuffer(bufferID) annotation(Library = "omcruntime");
end deleteBuffer;

function clearBuffer
input Integer bufferID;

external "C";
external "C" IOStreamExt_clearBuffer(bufferID) annotation(Library = "omcruntime");
end clearBuffer;

function readBuffer
input Integer bufferID;
output String outString;

external "C";
external "C" outString=IOStreamExt_readBuffer(bufferID) annotation(Library = "omcruntime");
end readBuffer;

function printBuffer
input Integer bufferID;
input Integer whereToPrint "stdout:1, stderr:2";

external "C";
external "C" IOStreamExt_printBuffer(bufferID,whereToPrint) annotation(Library = "omcruntime");
end printBuffer;

function appendReversedList
input list<String> inStringLst;
output String outString;

external "C";
external "C" outString = IOStreamExt_appendReversedList(inStringLst) annotation(Library = "omcruntime");
end appendReversedList;

function printReversedList
input list<String> inStringLst;
input Integer whereToPrint "stdout:1, stderr:2";

external "C";
external "C" IOStreamExt_printReversedList(inStringLst, whereToPrint) annotation(Library = "omcruntime");
end printReversedList;

end IOStreamExt;
2 changes: 1 addition & 1 deletion Compiler/Settings.mo
Expand Up @@ -88,7 +88,7 @@ end setInstallationDirectoryPath;
public function getInstallationDirectoryPath
output String outString;

external "C" ;
external "C" outString=Settings_getInstallationDirectoryPath() annotation(Library = "omcruntime");
end getInstallationDirectoryPath;

public function setPlotCommand
Expand Down
1,342 changes: 670 additions & 672 deletions Compiler/SimCodeC.mo

Large diffs are not rendered by default.

29 changes: 15 additions & 14 deletions Compiler/System.mo
Expand Up @@ -47,19 +47,20 @@ public function removeFirstAndLastChar
end removeFirstAndLastChar;

public function trim
input String inString1;
input String inString2;
"removes chars in charsToRemove from inString"
input String inString;
input String charsToRemove;
output String outString;

external "C";
external "C" outString=System_trim(inString,charsToRemove) annotation(Library = "omcruntime");
end trim;

public function trimChar
input String inString1;
input String inString2;
output String outString;

external "C" ;
external "C" outString=System_trimChar(inString1,inString2) annotation(Library = "omcruntime");
end trimChar;

public function strcmp
Expand Down Expand Up @@ -144,19 +145,19 @@ end setCCompiler;
public function getCCompiler
output String outString;

external "C" annotation(Library = "omcruntime");
external "C" outString=System_getCCompiler() annotation(Library = "omcruntime");
end getCCompiler;

public function setCFlags
input String inString;

external "C" annotation(Library = "omcruntime");
external "C" System_setCCompiler(inString) annotation(Library = "omcruntime");
end setCFlags;

public function getCFlags
output String outString;

external "C" annotation(Library = "omcruntime");
external "C" outString=System_getCFlags() annotation(Library = "omcruntime");
end getCFlags;

public function setCXXCompiler
Expand All @@ -168,7 +169,7 @@ end setCXXCompiler;
public function getCXXCompiler
output String outString;

external "C" annotation(Library = "omcruntime");
external "C" outString=System_getCXXCompiler() annotation(Library = "omcruntime");
end getCXXCompiler;

public function setLinker
Expand All @@ -180,7 +181,7 @@ end setLinker;
public function getLinker
output String outString;

external "C" annotation(Library = "omcruntime");
external "C" outString=System_getLinker() annotation(Library = "omcruntime");
end getLinker;

public function setLDFlags
Expand All @@ -192,19 +193,19 @@ end setLDFlags;
public function getLDFlags
output String outString;

external "C" annotation(Library = "omcruntime");
external "C" outString=System_getLDFlags() annotation(Library = "omcruntime");
end getLDFlags;

public function getExeExt
output String outString;

external "C" annotation(Library = "omcruntime");
external "C" outString=System_getExeExt() annotation(Library = "omcruntime");
end getExeExt;

public function getDllExt
output String outString;

external "C" annotation(Library = "omcruntime");
external "C" outString=System_getDllExt() annotation(Library = "omcruntime");
end getDllExt;

public function loadLibrary
Expand Down Expand Up @@ -479,7 +480,7 @@ Why it returns linux for OSX, we have no clue. But it does, so let's
document it.
"
output String str;
external "C" annotation(Library = "omcruntime");
external "C" str = System_os() annotation(Library = "omcruntime");
end os;

public function compileCFile
Expand Down Expand Up @@ -539,7 +540,7 @@ end tmpTickReset;
public function getSendDataLibs
"Returns a string containing the compiler flags used for SENDDATALIBS"
output String sendDataLibs;
external "C" annotation(Library = "omcruntime");
external "C" sendDataLibs=System_getSendDataLibs() annotation(Library = "omcruntime");
end getSendDataLibs;

public function userIsRoot
Expand Down

0 comments on commit 3fc6154

Please sign in to comment.