home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / oslib / oslib_1 / OSLib / Computer / h / filer < prev    next >
Encoding:
Text File  |  1995-06-23  |  6.9 KB  |  244 lines

  1. #ifndef filer_H
  2. #define filer_H
  3.  
  4. /* C header file for Filer
  5.  * written by DefMod (Jun 20 1995) on Fri Jun 23 16:09:41 1995
  6.  * Jonathan Coxhead, Acorn Computers Ltd
  7.  */
  8.  
  9. #ifndef types_H
  10. #include "types.h"
  11. #endif
  12.  
  13. #ifndef os_H
  14. #include "os.h"
  15. #endif
  16.  
  17. #ifndef wimp_H
  18. #include "wimp.h"
  19. #endif
  20.  
  21. #ifndef fileswitch_H
  22. #include "fileswitch.h"
  23. #endif
  24.  
  25. /**********************************
  26.  * SWI names and SWI reason codes *
  27.  **********************************/
  28. #undef  Service_StartFiler
  29. #define Service_StartFiler                      0x4B
  30. #undef  Service_StartedFiler
  31. #define Service_StartedFiler                    0x4C
  32. #undef  Service_FilerDying
  33. #define Service_FilerDying                      0x4F
  34. #undef  Service_EnumerateFormats
  35. #define Service_EnumerateFormats                0x6A
  36. #undef  Service_DiscDismounted
  37. #define Service_DiscDismounted                  0x7D
  38.  
  39. /************************************
  40.  * Structure and union declarations *
  41.  ************************************/
  42. typedef struct filer_message_open_dir           filer_message_open_dir;
  43. typedef struct filer_message_open_dir_at        filer_message_open_dir_at;
  44. typedef struct filer_message_selection_dir      filer_message_selection_dir;
  45. typedef struct filer_message_add_selection      filer_message_add_selection;
  46. typedef struct filer_message_action             filer_message_action;
  47. typedef struct filer_message_control_action     filer_message_control_action;
  48. typedef struct filer_message_selection          filer_message_selection;
  49. typedef struct filer_format                     filer_format;
  50.  
  51. /********************
  52.  * Type definitions *
  53.  ********************/
  54. struct filer_message_open_dir
  55.    {  fileswitch_fs_no fs_no;
  56.       byte reserved [3];
  57.       bits flags;
  58.       char dir_name [228];
  59.    };
  60.  
  61. struct filer_message_open_dir_at
  62.    {  fileswitch_fs_no fs_no;
  63.       byte reserved [3];
  64.       bits flags;
  65.       os_coord at;
  66.       int width;
  67.       int height;
  68.       byte display;
  69.       char dir_name [211];
  70.    };
  71.  
  72. struct filer_message_selection_dir
  73.    {  char dir_name [236];
  74.    };
  75.  
  76. struct filer_message_add_selection
  77.    {  char leaf_list [236];
  78.    };
  79.  
  80. struct filer_message_action
  81.    {  int operation;
  82.       bits options;
  83.       union
  84.       {  char destination_dir_name [228];
  85.          struct
  86.          {  short access;
  87.             short mask;
  88.          }
  89.          access;
  90.          bits file_type;
  91.          char find_leaf [228];
  92.       }
  93.       data;
  94.    };
  95.  
  96. struct filer_message_control_action
  97.    {  int control;
  98.    };
  99.  
  100. struct filer_message_selection
  101.    {  os_box bbox;
  102.       int width;
  103.       int height;
  104.       bits display;
  105.       int col0;
  106.       int row0;
  107.       int col1;
  108.       int row1;
  109.    };
  110.  
  111. struct filer_format
  112.    {  filer_format *next;
  113.       char *menu_text;
  114.       char *help_text;
  115.       int disc_format_swi;
  116.       int disc_format_handle;
  117.       int layout_structure_swi;
  118.       int layout_structure_handle;
  119.       bits flags;
  120.    };
  121.  
  122. /************************
  123.  * Constant definitions *
  124.  ************************/
  125. #define error_FILER_NO_RECURSION                0xB80u
  126. #define error_FILER_NO_TEMPLATE                 0xB81u
  127. #define error_FILER_FAILED_SAVE                 0xB82u
  128. #define error_FILER_BAD_PATH                    0xB83u
  129. #define message_FILER_OPEN_DIR                  0x400u
  130. #define message_FILER_CLOSE_DIR                 0x401u
  131. #define message_FILER_OPEN_DIR_AT               0x402u
  132. #define message_FILER_SELECTION_DIR             0x403u
  133. #define message_FILER_ADD_SELECTION             0x404u
  134. #define message_FILER_ACTION                    0x405u
  135. #define message_FILER_CONTROL_ACTION            0x406u
  136. #define message_FILER_SELECTION                 0x407u
  137. #define filer_FORMAT_NATIVE                     0x1u
  138. #define filer_DIR_NONCANONICAL                  0x1u
  139. #define filer_DISPLAY_LARGE_ICONS               0x0u
  140. #define filer_DISPLAY_SMALL_ICONS               0x1u
  141. #define filer_DISPLAY_FULL_INFO                 0x2u
  142. #define filer_DISPLAY                           0x3u
  143. #define filer_DISPLAY_SHIFT                     0
  144. #define filer_SORT_BY_NAME                      0x0u
  145. #define filer_SORT_BY_SIZE                      0x1u
  146. #define filer_SORT_BY_TYPE                      0x2u
  147. #define filer_SORT_BY_DATE                      0x3u
  148. #define filer_SORT                              0xCu
  149. #define filer_SORT_SHIFT                        2
  150. #define filer_GIVEN_DISPLAY                     0x10u
  151. #define filer_GIVEN_SORT                        0x20u
  152. #define filer_CONTROL_ACKNOWLEDGE               0
  153. #define filer_CONTROL_VERBOSE_ON                1
  154. #define filer_CONTROL_VERBOSE_OFF               2
  155.  
  156. /*************************
  157.  * Function declarations *
  158.  *************************/
  159.  
  160. #ifdef __cplusplus
  161.    extern "C" {
  162. #endif
  163.  
  164. /* ------------------------------------------------------------------------
  165.  * Function:      service_start_filer()
  166.  *
  167.  * Description:   Request to filing-system-specific desktop filers to start
  168.  *                up
  169.  *
  170.  * Input:         task - value of R0 on entry
  171.  *
  172.  * Output:        command - value of R0 on exit
  173.  *                unclaimed - value of R1 on exit (X version only)
  174.  *
  175.  * Returns:       R1 (non-X version only)
  176.  *
  177.  * Other notes:   Calls SWI 0x30 with R1 = 0x4B.
  178.  */
  179.  
  180. extern os_error *xservice_start_filer (wimp_t task,
  181.       char **command,
  182.       bool *unclaimed);
  183. extern bool service_start_filer (wimp_t task,
  184.       char **command);
  185.  
  186. /* ------------------------------------------------------------------------
  187.  * Function:      service_started_filer()
  188.  *
  189.  * Description:   Request to filing-system-specific desktop filers to set
  190.  *                task_handle variable to 0
  191.  *
  192.  * Other notes:   Calls SWI 0x30 with R1 = 0x4C.
  193.  */
  194.  
  195. extern os_error *xservice_started_filer (void);
  196. extern void service_started_filer (void);
  197.  
  198. /* ------------------------------------------------------------------------
  199.  * Function:      service_filer_dying()
  200.  *
  201.  * Description:   Notification that the Filer module is about to close down
  202.  *
  203.  * Other notes:   Calls SWI 0x30 with R1 = 0x4F.
  204.  */
  205.  
  206. extern os_error *xservice_filer_dying (void);
  207. extern void service_filer_dying (void);
  208.  
  209. /* ------------------------------------------------------------------------
  210.  * Function:      service_enumerate_formats()
  211.  *
  212.  * Description:   Enumerate available disc formats
  213.  *
  214.  * Input:         format_list - value of R2 on entry
  215.  *
  216.  * Output:        format_list_out - value of R2 on exit
  217.  *
  218.  * Other notes:   Calls SWI 0x30 with R1 = 0x6A.
  219.  */
  220.  
  221. extern os_error *xservice_enumerate_formats (filer_format *format_list,
  222.       filer_format **format_list_out);
  223. extern void service_enumerate_formats (filer_format *format_list,
  224.       filer_format **format_list_out);
  225.  
  226. /* ------------------------------------------------------------------------
  227.  * Function:      service_disc_dismounted()
  228.  *
  229.  * Description:   Disc dismounted
  230.  *
  231.  * Input:         disc_name - value of R2 on entry
  232.  *
  233.  * Other notes:   Calls SWI 0x30 with R1 = 0x7D.
  234.  */
  235.  
  236. extern os_error *xservice_disc_dismounted (char const *disc_name);
  237. extern void service_disc_dismounted (char const *disc_name);
  238.  
  239. #ifdef __cplusplus
  240.    }
  241. #endif
  242.  
  243. #endif
  244.