diff --git a/annotated.html b/annotated.html index 77082dd..2c81524 100644 --- a/annotated.html +++ b/annotated.html @@ -81,7 +81,7 @@ $(function() { diff --git a/classes.html b/classes.html index 1b36d99..3e2f33e 100644 --- a/classes.html +++ b/classes.html @@ -82,7 +82,7 @@ $(function() { diff --git a/common_8hpp_source.html b/common_8hpp_source.html index 170d75c..065ea74 100644 --- a/common_8hpp_source.html +++ b/common_8hpp_source.html @@ -95,7 +95,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/dir_33c78a012c8d08979f57a54a07694c46.html b/dir_33c78a012c8d08979f57a54a07694c46.html index f33a7fa..2f31bb6 100644 --- a/dir_33c78a012c8d08979f57a54a07694c46.html +++ b/dir_33c78a012c8d08979f57a54a07694c46.html @@ -80,7 +80,7 @@ $(function() { diff --git a/dir_49bef833487b2e4ec885e49af66a06b7.html b/dir_49bef833487b2e4ec885e49af66a06b7.html index a0938da..cc1fc0e 100644 --- a/dir_49bef833487b2e4ec885e49af66a06b7.html +++ b/dir_49bef833487b2e4ec885e49af66a06b7.html @@ -84,11 +84,13 @@ Files    dyld.hpp   + unistd.hpp diff --git a/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/dir_68267d1309a1af8e8297ef4c3efbcdba.html index 6337817..5a415c5 100644 --- a/dir_68267d1309a1af8e8297ef4c3efbcdba.html +++ b/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -86,7 +86,7 @@ Files diff --git a/dir_d44c64559bbebec7f509842c48db8b23.html b/dir_d44c64559bbebec7f509842c48db8b23.html index 13c668b..19e1010 100644 --- a/dir_d44c64559bbebec7f509842c48db8b23.html +++ b/dir_d44c64559bbebec7f509842c48db8b23.html @@ -86,7 +86,7 @@ Directories diff --git a/dyld_8hpp_source.html b/dyld_8hpp_source.html index 8678e2e..7a2c876 100644 --- a/dyld_8hpp_source.html +++ b/dyld_8hpp_source.html @@ -115,7 +115,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/files.html b/files.html index b53373c..ae681f6 100644 --- a/files.html +++ b/files.html @@ -79,14 +79,15 @@ $(function() {   MacStd  common.hpp  dyld.hpp -  src - pch.hpp + unistd.hpp +  src + pch.hpp diff --git a/hierarchy.html b/hierarchy.html index f2de7ae..507989b 100644 --- a/hierarchy.html +++ b/hierarchy.html @@ -82,7 +82,7 @@ $(function() { diff --git a/index.html b/index.html index 5970388..525e4ca 100644 --- a/index.html +++ b/index.html @@ -119,7 +119,7 @@ Usage diff --git a/interface_tests.html b/interface_tests.html index e39028c..94c0e03 100644 --- a/interface_tests.html +++ b/interface_tests.html @@ -85,7 +85,7 @@ Inheritance diagram for Tests: diff --git a/pch_8hpp_source.html b/pch_8hpp_source.html index c064d55..f40cbcb 100644 --- a/pch_8hpp_source.html +++ b/pch_8hpp_source.html @@ -90,10 +90,11 @@ $(document).ready(function() { init_codefold(0); });
6#pragma once
7
8#include "../include/MacStd/dyld.hpp"
+
9#include "../include/MacStd/unistd.hpp"
diff --git a/unistd_8hpp_source.html b/unistd_8hpp_source.html new file mode 100644 index 0000000..9d39962 --- /dev/null +++ b/unistd_8hpp_source.html @@ -0,0 +1,120 @@ + + + + + + + +MacStd: include/MacStd/unistd.hpp Source File + + + + + + + + + +
+
+ + + + + + +
+
MacStd +
+
OS X API using Standard C++
+
+
+ + + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
unistd.hpp
+
+
+
1/*
+
2 SPDX-License-Identifier: MIT
+
3 Copyright © 2023 Amebis
+
4*/
+
5
+
6#pragma once
+
7
+
8#include "common.hpp"
+
9#include <unistd.h>
+
10#include <string>
+
11
+
17inline const char* getcwd(std::string& path)
+
18{
+
19 char stack_buffer[MACSTD_STACK_BUFFER_BYTES];
+
20 auto result = getcwd(stack_buffer, MACSTD_STACK_BUFFER_BYTES);
+
21 if (result) {
+
22 path = result;
+
23 return path.data();
+
24 }
+
25 if (errno == ERANGE) {
+
26 result = getcwd(NULL, 0);
+
27 if (result) {
+
28 path = result;
+
29 free(result);
+
30 return path.data();
+
31 }
+
32 }
+
33 return NULL;
+
34}
+
+ + + +