home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / oslib / oslib_1 / OSLib / Toolbox / h / fileinfo < prev    next >
Encoding:
Text File  |  1995-09-05  |  12.8 KB  |  408 lines

  1. #ifndef fileinfo_H
  2. #define fileinfo_H
  3.  
  4. /* C header file for FileInfo
  5.  * written by DefMod (Aug 30 1995) on Tue Sep  5 15:14:30 1995
  6.  * Jonathan Coxhead, Acorn Computers Ltd
  7.  */
  8.  
  9. #ifndef types_H
  10. #include "types.h"
  11. #endif
  12.  
  13. #ifndef toolbox_H
  14. #include "toolbox.h"
  15. #endif
  16.  
  17. #ifndef window_H
  18. #include "window.h"
  19. #endif
  20.  
  21. /**********************************
  22.  * SWI names and SWI reason codes *
  23.  **********************************/
  24. #undef  FileInfo_ClassSWI
  25. #define FileInfo_ClassSWI                       0x82AC0
  26. #undef  XFileInfo_ClassSWI
  27. #define XFileInfo_ClassSWI                      0xA2AC0
  28. #undef  FileInfo_PostFilter
  29. #define FileInfo_PostFilter                     0x82AC1
  30. #undef  XFileInfo_PostFilter
  31. #define XFileInfo_PostFilter                    0xA2AC1
  32. #undef  FileInfo_PreFilter
  33. #define FileInfo_PreFilter                      0x82AC2
  34. #undef  XFileInfo_PreFilter
  35. #define XFileInfo_PreFilter                     0xA2AC2
  36. #undef  FileInfo_GetWindowId
  37. #define FileInfo_GetWindowId                    0x0
  38. #undef  FileInfo_SetModified
  39. #define FileInfo_SetModified                    0x1
  40. #undef  FileInfo_GetModified
  41. #define FileInfo_GetModified                    0x2
  42. #undef  FileInfo_SetFileType
  43. #define FileInfo_SetFileType                    0x3
  44. #undef  FileInfo_GetFileType
  45. #define FileInfo_GetFileType                    0x4
  46. #undef  FileInfo_SetFileName
  47. #define FileInfo_SetFileName                    0x5
  48. #undef  FileInfo_GetFileName
  49. #define FileInfo_GetFileName                    0x6
  50. #undef  FileInfo_SetFileSize
  51. #define FileInfo_SetFileSize                    0x7
  52. #undef  FileInfo_GetFileSize
  53. #define FileInfo_GetFileSize                    0x8
  54. #undef  FileInfo_SetDate
  55. #define FileInfo_SetDate                        0x9
  56. #undef  FileInfo_GetDate
  57. #define FileInfo_GetDate                        0xA
  58. #undef  FileInfo_SetTitle
  59. #define FileInfo_SetTitle                       0xB
  60. #undef  FileInfo_GetTitle
  61. #define FileInfo_GetTitle                       0xC
  62.  
  63. /************************************
  64.  * Structure and union declarations *
  65.  ************************************/
  66. typedef struct fileinfo_object                  fileinfo_object;
  67. typedef struct fileinfo_action_about_to_be_shown fileinfo_action_about_to_be_shown;
  68.  
  69. /********************
  70.  * Type definitions *
  71.  ********************/
  72. typedef bits fileinfo_flags;
  73.  
  74. struct fileinfo_object
  75.    {  fileinfo_flags flags;
  76.       toolbox_msg_reference title;
  77.       int title_limit;
  78.       bool modified;
  79.       bits file_type;
  80.       toolbox_msg_reference file_name;
  81.       int file_size;
  82.       os_date_and_time date_and_time;
  83.       byte reserved [3];
  84.       toolbox_string_reference alternative_window_name;
  85.    };
  86.  
  87. typedef toolbox_full fileinfo_full;
  88.  
  89. struct fileinfo_action_about_to_be_shown
  90.    {  toolbox_position_tag tag;
  91.       union
  92.       {  os_coord top_left;
  93.          fileinfo_full full;
  94.       }
  95.       position;
  96.    };
  97.  
  98. /************************
  99.  * Constant definitions *
  100.  ************************/
  101. #define class_FILE_INFO                         ((toolbox_class) 0x82AC0u)
  102. #define error_FILE_INFO_TASKS_ACTIVE            0x80B200u
  103. #define error_FILE_INFO_ALLOC_FAILED            0x80B201u
  104. #define error_FILE_INFO_SHORT_BUFFER            0x80B202u
  105. #define error_FILE_INFO_NO_SUCH_TASK            0x80B211u
  106. #define error_FILE_INFO_NO_SUCH_METHOD          0x80B212u
  107. #define error_FILE_INFO_NO_SUCH_MISC_OP_METHOD  0x80B213u
  108. #define fileinfo_GENERATE_ABOUT_TO_BE_SHOWN     ((fileinfo_flags) 0x1u)
  109. #define fileinfo_GENERATE_DIALOGUE_COMPLETED    ((fileinfo_flags) 0x2u)
  110. #define action_FILE_INFO_ABOUT_TO_BE_SHOWN      0x82AC0u
  111. #define action_FILE_INFO_DIALOGUE_COMPLETED     0x82AC1u
  112. #define fileinfo_DATE                           ((toolbox_c) 0x82AC01u)
  113. #define fileinfo_FILE_SIZE                      ((toolbox_c) 0x82AC02u)
  114. #define fileinfo_FILE_NAME                      ((toolbox_c) 0x82AC03u)
  115. #define fileinfo_FILE_TYPE                      ((toolbox_c) 0x82AC04u)
  116. #define fileinfo_MODIFIED                       ((toolbox_c) 0x82AC05u)
  117. #define fileinfo_FILE_ICON                      ((toolbox_c) 0x82AC06u)
  118. #define fileinfo_DATE_LABEL                     ((toolbox_c) 0x82AC07u)
  119. #define fileinfo_FILE_SIZE_LABEL                ((toolbox_c) 0x82AC08u)
  120. #define fileinfo_MODIFIED_LABEL                 ((toolbox_c) 0x82AC09u)
  121. #define fileinfo_FILE_TYPE_LABEL                ((toolbox_c) 0x82AC0Au)
  122.  
  123. /*************************
  124.  * Function declarations *
  125.  *************************/
  126.  
  127. #ifdef __cplusplus
  128.    extern "C" {
  129. #endif
  130.  
  131. /* ------------------------------------------------------------------------
  132.  * Function:      fileinfo_get_window_id()
  133.  *
  134.  * Description:   Gets the underlying window object ID for the specified
  135.  *                file info object
  136.  *
  137.  * Input:         flags - value of R0 on entry
  138.  *                file_info - value of R1 on entry
  139.  *
  140.  * Output:        window - value of R0 on exit (X version only)
  141.  *
  142.  * Returns:       R0 (non-X version only)
  143.  *
  144.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0x0.
  145.  */
  146.  
  147. extern os_error *xfileinfo_get_window_id (bits flags,
  148.       toolbox_o file_info,
  149.       toolbox_o *window);
  150. extern toolbox_o fileinfo_get_window_id (bits flags,
  151.       toolbox_o file_info);
  152.  
  153. /* ------------------------------------------------------------------------
  154.  * Function:      fileinfo_set_modified()
  155.  *
  156.  * Description:   Sets the modified flag for the specified file info object
  157.  *
  158.  * Input:         flags - value of R0 on entry
  159.  *                file_info - value of R1 on entry
  160.  *                modified - value of R3 on entry
  161.  *
  162.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0x1.
  163.  */
  164.  
  165. extern os_error *xfileinfo_set_modified (bits flags,
  166.       toolbox_o file_info,
  167.       bool modified);
  168. extern void fileinfo_set_modified (bits flags,
  169.       toolbox_o file_info,
  170.       bool modified);
  171.  
  172. /* ------------------------------------------------------------------------
  173.  * Function:      fileinfo_get_modified()
  174.  *
  175.  * Description:   Gets the modified flag for the specified file info object
  176.  *
  177.  * Input:         flags - value of R0 on entry
  178.  *                file_info - value of R1 on entry
  179.  *
  180.  * Output:        modified - value of R0 on exit (X version only)
  181.  *
  182.  * Returns:       R0 (non-X version only)
  183.  *
  184.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0x2.
  185.  */
  186.  
  187. extern os_error *xfileinfo_get_modified (bits flags,
  188.       toolbox_o file_info,
  189.       bool *modified);
  190. extern bool fileinfo_get_modified (bits flags,
  191.       toolbox_o file_info);
  192.  
  193. /* ------------------------------------------------------------------------
  194.  * Function:      fileinfo_set_file_type()
  195.  *
  196.  * Description:   Sets the file type for the specified file info object
  197.  *
  198.  * Input:         flags - value of R0 on entry
  199.  *                file_info - value of R1 on entry
  200.  *                file_type - value of R3 on entry
  201.  *
  202.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0x3.
  203.  */
  204.  
  205. extern os_error *xfileinfo_set_file_type (bits flags,
  206.       toolbox_o file_info,
  207.       bits file_type);
  208. extern void fileinfo_set_file_type (bits flags,
  209.       toolbox_o file_info,
  210.       bits file_type);
  211.  
  212. /* ------------------------------------------------------------------------
  213.  * Function:      fileinfo_get_file_type()
  214.  *
  215.  * Description:   Gets the file type for the specified file info object
  216.  *
  217.  * Input:         flags - value of R0 on entry
  218.  *                file_info - value of R1 on entry
  219.  *
  220.  * Output:        file_type - value of R0 on exit (X version only)
  221.  *
  222.  * Returns:       R0 (non-X version only)
  223.  *
  224.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0x4.
  225.  */
  226.  
  227. extern os_error *xfileinfo_get_file_type (bits flags,
  228.       toolbox_o file_info,
  229.       bits *file_type);
  230. extern bits fileinfo_get_file_type (bits flags,
  231.       toolbox_o file_info);
  232.  
  233. /* ------------------------------------------------------------------------
  234.  * Function:      fileinfo_set_file_name()
  235.  *
  236.  * Description:   Sets the file name for the specified file info object
  237.  *
  238.  * Input:         flags - value of R0 on entry
  239.  *                file_info - value of R1 on entry
  240.  *                file_name - value of R3 on entry
  241.  *
  242.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0x5.
  243.  */
  244.  
  245. extern os_error *xfileinfo_set_file_name (bits flags,
  246.       toolbox_o file_info,
  247.       char const *file_name);
  248. extern void fileinfo_set_file_name (bits flags,
  249.       toolbox_o file_info,
  250.       char const *file_name);
  251.  
  252. /* ------------------------------------------------------------------------
  253.  * Function:      fileinfo_get_file_name()
  254.  *
  255.  * Description:   Gets the file name from the specified file info object
  256.  *
  257.  * Input:         flags - value of R0 on entry
  258.  *                file_info - value of R1 on entry
  259.  *                buffer - value of R3 on entry
  260.  *                size - value of R4 on entry
  261.  *
  262.  * Output:        used - value of R4 on exit (X version only)
  263.  *
  264.  * Returns:       R4 (non-X version only)
  265.  *
  266.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0x6.
  267.  */
  268.  
  269. extern os_error *xfileinfo_get_file_name (bits flags,
  270.       toolbox_o file_info,
  271.       char *buffer,
  272.       int size,
  273.       int *used);
  274. extern int fileinfo_get_file_name (bits flags,
  275.       toolbox_o file_info,
  276.       char *buffer,
  277.       int size);
  278.  
  279. /* ------------------------------------------------------------------------
  280.  * Function:      fileinfo_set_file_size()
  281.  *
  282.  * Description:   Sets the file size for the specified file info object
  283.  *
  284.  * Input:         flags - value of R0 on entry
  285.  *                file_info - value of R1 on entry
  286.  *                file_size - value of R3 on entry
  287.  *
  288.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0x7.
  289.  */
  290.  
  291. extern os_error *xfileinfo_set_file_size (bits flags,
  292.       toolbox_o file_info,
  293.       int file_size);
  294. extern void fileinfo_set_file_size (bits flags,
  295.       toolbox_o file_info,
  296.       int file_size);
  297.  
  298. /* ------------------------------------------------------------------------
  299.  * Function:      fileinfo_get_file_size()
  300.  *
  301.  * Description:   Gets the file size from the specified file info object
  302.  *
  303.  * Input:         flags - value of R0 on entry
  304.  *                file_info - value of R1 on entry
  305.  *
  306.  * Output:        file_size - value of R0 on exit (X version only)
  307.  *
  308.  * Returns:       R0 (non-X version only)
  309.  *
  310.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0x8.
  311.  */
  312.  
  313. extern os_error *xfileinfo_get_file_size (bits flags,
  314.       toolbox_o file_info,
  315.       int *file_size);
  316. extern int fileinfo_get_file_size (bits flags,
  317.       toolbox_o file_info);
  318.  
  319. /* ------------------------------------------------------------------------
  320.  * Function:      fileinfo_set_date()
  321.  *
  322.  * Description:   Sets the date and time for the specified file info object
  323.  *
  324.  * Input:         flags - value of R0 on entry
  325.  *                file_info - value of R1 on entry
  326.  *                date_and_time - value of R3 on entry
  327.  *
  328.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0x9.
  329.  */
  330.  
  331. extern os_error *xfileinfo_set_date (bits flags,
  332.       toolbox_o file_info,
  333.       os_date_and_time const *date_and_time);
  334. extern void fileinfo_set_date (bits flags,
  335.       toolbox_o file_info,
  336.       os_date_and_time const *date_and_time);
  337.  
  338. /* ------------------------------------------------------------------------
  339.  * Function:      fileinfo_get_date()
  340.  *
  341.  * Description:   Gets the date and time for the specified file info object
  342.  *
  343.  * Input:         flags - value of R0 on entry
  344.  *                file_info - value of R1 on entry
  345.  *                date_and_time - value of R3 on entry
  346.  *
  347.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0xA.
  348.  */
  349.  
  350. extern os_error *xfileinfo_get_date (bits flags,
  351.       toolbox_o file_info,
  352.       os_date_and_time *date_and_time);
  353. extern void fileinfo_get_date (bits flags,
  354.       toolbox_o file_info,
  355.       os_date_and_time *date_and_time);
  356.  
  357. /* ------------------------------------------------------------------------
  358.  * Function:      fileinfo_set_title()
  359.  *
  360.  * Description:   Sets the title for the specified file info object
  361.  *
  362.  * Input:         flags - value of R0 on entry
  363.  *                file_info - value of R1 on entry
  364.  *                title - value of R3 on entry
  365.  *
  366.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0xB.
  367.  */
  368.  
  369. extern os_error *xfileinfo_set_title (bits flags,
  370.       toolbox_o file_info,
  371.       char const *title);
  372. extern void fileinfo_set_title (bits flags,
  373.       toolbox_o file_info,
  374.       char const *title);
  375.  
  376. /* ------------------------------------------------------------------------
  377.  * Function:      fileinfo_get_title()
  378.  *
  379.  * Description:   Gets the title from the specified file info object
  380.  *
  381.  * Input:         flags - value of R0 on entry
  382.  *                file_info - value of R1 on entry
  383.  *                buffer - value of R3 on entry
  384.  *                size - value of R4 on entry
  385.  *
  386.  * Output:        used - value of R4 on exit (X version only)
  387.  *
  388.  * Returns:       R4 (non-X version only)
  389.  *
  390.  * Other notes:   Calls SWI 0x44EC6 with R2 = 0xC.
  391.  */
  392.  
  393. extern os_error *xfileinfo_get_title (bits flags,
  394.       toolbox_o file_info,
  395.       char *buffer,
  396.       int size,
  397.       int *used);
  398. extern int fileinfo_get_title (bits flags,
  399.       toolbox_o file_info,
  400.       char *buffer,
  401.       int size);
  402.  
  403. #ifdef __cplusplus
  404.    }
  405. #endif
  406.  
  407. #endif
  408.