1 // 2 // Copyright (c) 2017 The Khronos Group Inc. 3 // 4 // Licensed under the Apache License, Version 2.0 (the "License"); 5 // you may not use this file except in compliance with the License. 6 // You may obtain a copy of the License at 7 // 8 // http://www.apache.org/licenses/LICENSE-2.0 9 // 10 // Unless required by applicable law or agreed to in writing, software 11 // distributed under the License is distributed on an "AS IS" BASIS, 12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 // See the License for the specific language governing permissions and 14 // limitations under the License. 15 // 16 #ifndef __os_helpers_h__ 17 #define __os_helpers_h__ 18 19 #include "compat.h" 20 21 // ------------------------------------------------------------------------------------------------- 22 // C++ interface. 23 // ------------------------------------------------------------------------------------------------- 24 25 #ifdef __cplusplus 26 27 #include <string> 28 29 std::string err_msg(int err); 30 std::string dir_sep(); 31 std::string exe_path(); 32 std::string exe_dir(); 33 34 #endif // __cplusplus 35 36 // ------------------------------------------------------------------------------------------------- 37 // C interface. 38 // ------------------------------------------------------------------------------------------------- 39 40 char* get_err_msg(int err); // Returns system error message. Subject to free. 41 char* get_dir_sep(); // Returns dir separator. Subject to free. 42 char* get_exe_path(); // Returns path of current executable. Subject to free. 43 char* get_exe_dir(); // Returns dir of current executable. Subject to free. 44 45 #endif // __os_helpers_h__ 46