home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / oslib / h / taskmanage < prev    next >
Encoding:
Text File  |  1994-09-07  |  4.3 KB  |  148 lines

  1. #ifndef taskmanager_H
  2. #define taskmanager_H
  3.  
  4. /* C header file for TaskManager
  5.  * written by DefMod (Sep  7 1994) on Wed Sep  7 21:19:06 1994
  6.  * Copyright © Acorn Computers Ltd, 1994
  7.  */
  8.  
  9. /*************************************************************************
  10.  * This source file was written by Acorn Computers Limited. It is part   *
  11.  * of the OSLib library for writing applications for RISC OS. It may be  *
  12.  * used freely in the creation of programs for RISC OS.                  *
  13.  *************************************************************************/
  14.  
  15. #ifndef types_H
  16.    #include "types.h"
  17. #endif
  18.  
  19. #ifndef os_H
  20.    #include "os.h"
  21. #endif
  22.  
  23. #ifndef wimp_H
  24.    #include "wimp.h"
  25. #endif
  26.  
  27. /**********************************
  28.  * SWI names and SWI reason codes *
  29.  **********************************/
  30. #undef  TaskManager_TaskNameFromHandle
  31. #define TaskManager_TaskNameFromHandle          0x42680
  32. #undef  XTaskManager_TaskNameFromHandle
  33. #define XTaskManager_TaskNameFromHandle         0x62680
  34. #undef  TaskManager_EnumerateTasks
  35. #define TaskManager_EnumerateTasks              0x42681
  36. #undef  XTaskManager_EnumerateTasks
  37. #define XTaskManager_EnumerateTasks             0x62681
  38. #undef  TaskManager_Shutdown
  39. #define TaskManager_Shutdown                    0x42682
  40. #undef  XTaskManager_Shutdown
  41. #define XTaskManager_Shutdown                   0x62682
  42.  
  43. /************************************
  44.  * Structure and union declarations *
  45.  ************************************/
  46. typedef struct taskmanager_task                 taskmanager_task;
  47.  
  48. /********************
  49.  * Type definitions *
  50.  ********************/
  51. struct taskmanager_task
  52.    {  wimp_t task;
  53.       char *name;
  54.       int slot_size;
  55.       bits flags;
  56.    };
  57.  
  58. /************************
  59.  * Constant definitions *
  60.  ************************/
  61. #define taskmanager_NAME_LIMIT                  32
  62. #define taskmanager_MODULE_TASK                 0x1u
  63. #define taskmanager_DRAGGABLE_SLOT              0x2u
  64. #define taskmanager_SHUTDOWN_EXIT_ONLY          0x1u
  65. #define taskmanager_SHUTDOWN_NO_PRE_QUIT        0x2u
  66. #define taskmanager_SHUTDOWN_PORTABLE_POWER_DOWN 0x4u
  67. #define taskmanager_SHUTDOWN_SEND_MESSAGE       0x8u
  68. #define taskmanager_SHUTDOWN_IGNORE_UP_CALLS    0x10u
  69.  
  70. /*************************
  71.  * Function declarations *
  72.  *************************/
  73.  
  74. #ifdef __cplusplus
  75.    extern "C" {
  76. #endif
  77.  
  78. /*************************************************************
  79.  * NOTE: The following functions provide direct access to    *
  80.  *       the SWI's noted in the function description.        *
  81.  *       Please read the relevant PRM section for more       *
  82.  *       information on their input/output parameters.       *
  83.  *************************************************************/
  84.  
  85. /* ------------------------------------------------------------------------
  86.  * Function:      taskmanager_task_name_from_handle()
  87.  *
  88.  * Description:   Finds the name of a task
  89.  *
  90.  * Input:         task - value of R0 on entry
  91.  *
  92.  * Output:        name - value of R0 on exit (X version only)
  93.  *
  94.  * Returns:       R0 (non-X version only)
  95.  *
  96.  * Other notes:   Calls SWI 0x42680.
  97.  */
  98.  
  99. extern os_error *xtaskmanager_task_name_from_handle (wimp_t task,
  100.       char **name);
  101. extern char *taskmanager_task_name_from_handle (wimp_t task);
  102.  
  103. /* ------------------------------------------------------------------------
  104.  * Function:      taskmanager_enumerate_tasks()
  105.  *
  106.  * Description:   Enumerates all the currently active tasks
  107.  *
  108.  * Input:         context - value of R0 on entry
  109.  *                task - value of R1 on entry
  110.  *                size - value of R2 on entry
  111.  *
  112.  * Output:        context_out - value of R0 on exit (X version only)
  113.  *                end - value of R1 on exit
  114.  *
  115.  * Returns:       R0 (non-X version only)
  116.  *
  117.  * Other notes:   Calls SWI 0x42681.
  118.  */
  119.  
  120. extern os_error *xtaskmanager_enumerate_tasks (int context,
  121.       taskmanager_task *task,
  122.       int size,
  123.       int *context_out,
  124.       char **end);
  125. extern int taskmanager_enumerate_tasks (int context,
  126.       taskmanager_task *task,
  127.       int size,
  128.       char **end);
  129.  
  130. /* ------------------------------------------------------------------------
  131.  * Function:      taskmanager_shutdown()
  132.  *
  133.  * Description:   Initiates a desktop shutdown
  134.  *
  135.  * Input:         flags - value of R0 on entry
  136.  *
  137.  * Other notes:   Calls SWI 0x42682.
  138.  */
  139.  
  140. extern os_error *xtaskmanager_shutdown (bits flags);
  141. extern void taskmanager_shutdown (bits flags);
  142.  
  143. #ifdef __cplusplus
  144.    }
  145. #endif
  146.  
  147. #endif
  148.