home *** CD-ROM | disk | FTP | other *** search
- #ifndef taskmanager_H
- #define taskmanager_H
-
- /* C header file for TaskManager
- * written by DefMod (Sep 7 1994) on Wed Sep 7 21:19:06 1994
- * Copyright © Acorn Computers Ltd, 1994
- */
-
- /*************************************************************************
- * This source file was written by Acorn Computers Limited. It is part *
- * of the OSLib library for writing applications for RISC OS. It may be *
- * used freely in the creation of programs for RISC OS. *
- *************************************************************************/
-
- #ifndef types_H
- #include "types.h"
- #endif
-
- #ifndef os_H
- #include "os.h"
- #endif
-
- #ifndef wimp_H
- #include "wimp.h"
- #endif
-
- /**********************************
- * SWI names and SWI reason codes *
- **********************************/
- #undef TaskManager_TaskNameFromHandle
- #define TaskManager_TaskNameFromHandle 0x42680
- #undef XTaskManager_TaskNameFromHandle
- #define XTaskManager_TaskNameFromHandle 0x62680
- #undef TaskManager_EnumerateTasks
- #define TaskManager_EnumerateTasks 0x42681
- #undef XTaskManager_EnumerateTasks
- #define XTaskManager_EnumerateTasks 0x62681
- #undef TaskManager_Shutdown
- #define TaskManager_Shutdown 0x42682
- #undef XTaskManager_Shutdown
- #define XTaskManager_Shutdown 0x62682
-
- /************************************
- * Structure and union declarations *
- ************************************/
- typedef struct taskmanager_task taskmanager_task;
-
- /********************
- * Type definitions *
- ********************/
- struct taskmanager_task
- { wimp_t task;
- char *name;
- int slot_size;
- bits flags;
- };
-
- /************************
- * Constant definitions *
- ************************/
- #define taskmanager_NAME_LIMIT 32
- #define taskmanager_MODULE_TASK 0x1u
- #define taskmanager_DRAGGABLE_SLOT 0x2u
- #define taskmanager_SHUTDOWN_EXIT_ONLY 0x1u
- #define taskmanager_SHUTDOWN_NO_PRE_QUIT 0x2u
- #define taskmanager_SHUTDOWN_PORTABLE_POWER_DOWN 0x4u
- #define taskmanager_SHUTDOWN_SEND_MESSAGE 0x8u
- #define taskmanager_SHUTDOWN_IGNORE_UP_CALLS 0x10u
-
- /*************************
- * Function declarations *
- *************************/
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- /*************************************************************
- * NOTE: The following functions provide direct access to *
- * the SWI's noted in the function description. *
- * Please read the relevant PRM section for more *
- * information on their input/output parameters. *
- *************************************************************/
-
- /* ------------------------------------------------------------------------
- * Function: taskmanager_task_name_from_handle()
- *
- * Description: Finds the name of a task
- *
- * Input: task - value of R0 on entry
- *
- * Output: name - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x42680.
- */
-
- extern os_error *xtaskmanager_task_name_from_handle (wimp_t task,
- char **name);
- extern char *taskmanager_task_name_from_handle (wimp_t task);
-
- /* ------------------------------------------------------------------------
- * Function: taskmanager_enumerate_tasks()
- *
- * Description: Enumerates all the currently active tasks
- *
- * Input: context - value of R0 on entry
- * task - value of R1 on entry
- * size - value of R2 on entry
- *
- * Output: context_out - value of R0 on exit (X version only)
- * end - value of R1 on exit
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x42681.
- */
-
- extern os_error *xtaskmanager_enumerate_tasks (int context,
- taskmanager_task *task,
- int size,
- int *context_out,
- char **end);
- extern int taskmanager_enumerate_tasks (int context,
- taskmanager_task *task,
- int size,
- char **end);
-
- /* ------------------------------------------------------------------------
- * Function: taskmanager_shutdown()
- *
- * Description: Initiates a desktop shutdown
- *
- * Input: flags - value of R0 on entry
- *
- * Other notes: Calls SWI 0x42682.
- */
-
- extern os_error *xtaskmanager_shutdown (bits flags);
- extern void taskmanager_shutdown (bits flags);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-