Add a Platform class.

- Rename the "process" module to "os".
- Add Platform to it.
- Static "name" method.
- Static "isPosix" method.
- Docs and tests!
This commit is contained in:
Bob Nystrom
2016-05-21 12:44:17 -07:00
parent 6bcc64eb61
commit 06731f66d4
20 changed files with 170 additions and 65 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
#include <stdio.h>
#include <string.h>
#include "process.h"
#include "os.h"
#include "vm.h"
#include "wren.h"
@@ -14,7 +14,7 @@ int main(int argc, const char* argv[])
return 0;
}
processSetArguments(argc, argv);
osSetArguments(argc, argv);
if (argc == 1)
{
+8 -2
View File
@@ -4,7 +4,7 @@
#include "modules.h"
#include "io.wren.inc"
#include "process.wren.inc"
#include "os.wren.inc"
#include "scheduler.wren.inc"
#include "timer.wren.inc"
@@ -21,6 +21,8 @@ extern void fileRealPath(WrenVM* vm);
extern void fileSize(WrenVM* vm);
extern void fileStat(WrenVM* vm);
extern void fileWriteBytes(WrenVM* vm);
extern void platformIsPosix(WrenVM* vm);
extern void platformName(WrenVM* vm);
extern void processAllArguments(WrenVM* vm);
extern void statPath(WrenVM* vm);
extern void statBlockCount(WrenVM* vm);
@@ -149,7 +151,11 @@ static ModuleRegistry modules[] =
STATIC_METHOD("readStop_()", stdinReadStop)
END_CLASS
END_MODULE
MODULE(process)
MODULE(os)
CLASS(Platform)
STATIC_METHOD("isPosix", platformIsPosix)
STATIC_METHOD("name", platformName)
END_CLASS
CLASS(Process)
STATIC_METHOD("allArguments", processAllArguments)
END_CLASS