@@ -50,16 +50,16 @@ * [OFApplication terminate]; * } * @end * @endcode */ -#define OF_APPLICATION_DELEGATE(class_) \ - int \ - main(int argc, char *argv[]) \ - { \ - return of_application_main(&argc, &argv, \ - (class_ *)[[class_ alloc] init]); \ +#define OF_APPLICATION_DELEGATE(class_) \ + int \ + main(int argc, char *argv[]) \ + { \ + return OFApplicationMain(&argc, &argv, \ + (class_ *)[[class_ alloc] init]); \ } #ifdef OF_HAVE_PLEDGE # define OF_HAVE_SANDBOX #endif @@ -198,18 +198,11 @@ */ @property OF_NULLABLE_PROPERTY (assign, nonatomic) id delegate; #ifdef OF_HAVE_SANDBOX -/** - * @brief The sandbox currently active for this application. - */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFSandbox *activeSandbox; - -/** - * @brief The sandbox currently active for child processes of this application. - */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFSandbox *activeSandboxForChildProcesses; #endif /** @@ -251,41 +244,12 @@ * @param status The status with which the application will terminate */ + (void)terminateWithStatus: (int)status OF_NO_RETURN; #ifdef OF_HAVE_SANDBOX -/** - * @brief Activates the specified sandbox for the application. - * - * This is only available if `OF_HAVE_SANDBOX` is defined. - * - * @warning If you allow `exec()`, but do not call - * @ref activateSandboxForChildProcesses:, an `exec()`'d process does - * not have its permissions restricted! - * - * @note Once a sandbox has been activated, you cannot activate a different - * sandbox. You can however change the active sandbox and reactivate it. - * - * @param sandbox The sandbox to activate - */ -+ (void)activateSandbox: (OFSandbox *)sandbox; - -/** - * @brief Activates the specified sandbox for child processes of the - * application. - * - * This is only available if `OF_HAVE_SANDBOX` is defined. - * - * `unveiledPaths` on the sandbox must *not* be empty, otherwise an - * @ref OFInvalidArgumentException is raised. - * - * @note Once a sandbox has been activated, you cannot activate a different - * sandbox. You can however change the active sandbox and reactivate it. - * - * @param sandbox The sandbox to activate - */ -+ (void)activateSandboxForChildProcesses: (OFSandbox *)sandbox; ++ (void)of_activateSandbox: (OFSandbox *)sandbox; ++ (void)of_activateSandboxForChildProcesses: (OFSandbox *)sandbox; #endif - (instancetype)init OF_UNAVAILABLE; /** @@ -308,49 +272,20 @@ * @param status The status with which the application will terminate */ - (void)terminateWithStatus: (int)status OF_NO_RETURN; #ifdef OF_HAVE_SANDBOX -/** - * @brief Activates the specified sandbox for the application. - * - * This is only available if `OF_HAVE_SANDBOX` is defined. - * - * @warning If you allow `exec()`, but do not call - * @ref activateSandboxForChildProcesses:, an `exec()`'d process does - * not have its permissions restricted! - * - * @note Once a sandbox has been activated, you cannot activate a different - * sandbox. You can however change the active sandbox and reactivate it. - * - * @param sandbox The sandbox to activate - */ -- (void)activateSandbox: (OFSandbox *)sandbox; - -/** - * @brief Activates the specified sandbox for child processes of the - * application. - * - * This is only available if `OF_HAVE_SANDBOX` is defined. - * - * `unveiledPaths` on the sandbox must *not* be empty, otherwise an - * @ref OFInvalidArgumentException is raised. - * - * @note Once a sandbox has been activated, you cannot activate a different - * sandbox. You can however change the active sandbox and reactivate it. - * - * @param sandbox The sandbox to activate - */ -- (void)activateSandboxForChildProcesses: (OFSandbox *)sandbox; +- (void)of_activateSandbox: (OFSandbox *)sandbox; +- (void)of_activateSandboxForChildProcesses: (OFSandbox *)sandbox; #endif @end #ifdef __cplusplus extern "C" { #endif -extern int of_application_main(int *_Nonnull, - char *_Nullable *_Nonnull[_Nonnull], id ); +extern int OFApplicationMain(int *_Nonnull, char *_Nullable *_Nonnull[_Nonnull], + id ); #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END