feat: rename process module to os and add Platform class with name and isPosix methods

Rename the "process" module to "os" across all source files, documentation, tests, and build configuration. Add a new Platform class to the os module with static methods `name` (returns OS string like "Windows", "Linux", "OS X", "iOS", "Unix", "POSIX", or "Unknown") and `isPosix` (returns bool indicating POSIX compliance). Update all import paths from "process" to "os" in test files and module registrations. Move process.c/h to os.c/h, rename processSetArguments to osSetArguments, and regenerate the os.wren.inc bytecode source. Add documentation pages for the os module and Platform class.
This commit is contained in:
Bob Nystrom
2016-05-21 19:44:17 +00:00
parent c5e1c2e57f
commit 95ef1a2814
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