home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 1 / AU_CD1.iso / internet / arcweb / !ArcWeb / h / requester
Text File  |  1995-02-16  |  9KB  |  224 lines

  1. /*
  2.  * ArcWeb
  3.  *
  4.  * Copyright (C) Stewart Brodie, 1994,1995
  5.  *
  6.  * This product is supplied under the terms laid down in the `Terms' file.
  7.  *
  8.  * This file may be distributed freely with any ArcWeb related software,
  9.  * provided it meets with the definition of 'free' in the 'Terms' file.
  10.  *
  11.  * This file: requester.h
  12.  *
  13.  *   A WIMP-library-independent interface definition.  All structures are
  14.  *   defined in terms of basic types.
  15.  *
  16.  */
  17. #ifndef _requester_h_included
  18. #define _requester_h_included
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22.  
  23. #define arcweb_MAXURL           (200)
  24.  
  25.  
  26. #define msg_Arcweb__base        (0x4A240)
  27. #define swi_Arcweb__base        (msg_Arcweb__base)
  28. #define err_Arcweb__base        (0x80D200)
  29.  
  30. typedef enum {
  31.  
  32.         Message_ArcwebFetchRequest    = (msg_Arcweb__base +  0),
  33.         Message_ArcwebFetchDone       = (msg_Arcweb__base +  1),
  34.         Message_ArcwebRenderRequest   = (msg_Arcweb__base +  2),
  35.         Message_ArcwebRenderDone      = (msg_Arcweb__base +  3),
  36.         Message_ArcwebPostRequest     = (msg_Arcweb__base +  4),
  37.         Message_ArcwebPostDone        = (msg_Arcweb__base +  5),
  38.         Message_ArcwebEMailRequest    = (msg_Arcweb__base +  6),
  39.         Message_ArcwebEMailDone       = (msg_Arcweb__base +  7),
  40.  
  41.         Message_ArcwebImageSize       = (msg_Arcweb__base + 16),
  42.         Message_ArcwebImageComplete   = (msg_Arcweb__base + 17),
  43.  
  44.         Message_ArcwebQuit            = (msg_Arcweb__base + 32),
  45.         Message_ArcwebExpire          = (msg_Arcweb__base + 33),
  46.         Message_ArcwebAbortRequest    = (msg_Arcweb__base + 34),
  47.         Message_ArcwebTransferStatus  = (msg_Arcweb__base + 35)
  48.  
  49. } arcweb_msgid;
  50.  
  51.  
  52. /* Use these constants in the flag words in the messages below */
  53.  
  54. #define arcweb_FLAGS_error              0x80000000
  55. #define arcweb_FLAGS_typeknown          0x40000000
  56. #define arcweb_FLAGS_inhibit_render     0x20000000
  57. #define arcweb_FLAGS_want_symlink       0x10000000
  58. #define arcweb_FLAGS_url_changed        0x08000000
  59. #define arcweb_FLAGS_close_previous     0x04000000
  60. #define arcweb_FLAGS_image_fetch        0x02000000
  61. #define arcweb_FLAGS_error_handled      0x01000000
  62. #define arcweb_FLAGS_inhibit_display    0x00800000
  63. #define arcweb_FLAGS_extended_url       0x00400000
  64. #define arcweb_FLAGS_email_complete     0x00200000
  65. #define arcweb_FLAGS_images_disabled    0x00100000
  66. #define arcweb_FLAGS_reserved_mask      0x000e0000
  67. #define arcweb_FLAGS_extended_type      0x00010000
  68. #define arcweb_FLAGS_typemask           0x0001ffff
  69.  
  70. #define arcweb_TYPES_plaintext          0x00010000
  71. #define arcweb_TYPES_html               0x00010001
  72. #define arcweb_TYPES_image              0x00010002
  73. #define arcweb_TYPES_audio              0x00010003
  74. #define arcweb_TYPES_video              0x00010004
  75. #define arcweb_TYPES_binary             0x00010005
  76. #define arcweb_TYPES_image_jpeg         0x00010100
  77. #define arcweb_TYPES_image_gif          0x00010101
  78. #define arcweb_TYPES_image_jfif         0x00010102
  79. #define arcweb_TYPES_image_mswinbitmap  0x00010103
  80. #define arcweb_TYPES_image_xbm          0x00010104
  81. #define arcweb_TYPES_image_clear        0x00010105
  82. #define arcweb_TYPES_image_tiff         0x00010106
  83. #define arcweb_TYPES_video_mpeg         0x00010200
  84. #define arcweb_TYPES_video_armovie      0x00010201
  85. #define arcweb_TYPES_audio_simple       0x00010301
  86. #define arcweb_TYPES_audio_aiff         0x00010302
  87. #define arcweb_TYPES_unknown            0x0001ffff
  88.  
  89. #define arcweb_XFER_xmit_running        0x00000001
  90. #define arcweb_XFER_recv_running        0x00000002
  91. #define arcweb_XFER_xmit_complete       0x00000004
  92. #define arcweb_XFER_recv_complete       0x00000008
  93. #define arcweb_XFER_misc_running        0x00000010
  94. #define arcweb_XFER_reserved            0xffffffe0
  95.  
  96.  
  97. /* Flag bit meanings:
  98.  *
  99.  *      bits 0 to 15    : RISC OS/Arcweb filetype indicator
  100.  *      bit 16          : if set, type is arcweb_TYPES_*, else RISC OS type
  101.  *      bits 17 to 19   : reserved (must be preserved in replies)
  102.  *      bit 20          : If set, user has disabled image fetching
  103.  *      bit 21          : if set, the e-mail message is complete
  104.  *      bit 22          : if set, this is an extended URL
  105.  *      bit 23          : if set, Arcweb will not display the results of the render
  106.  *      bit 24          : if set, Arcweb wont raise any error to user
  107.  *      bit 25          : if set, this is an inline image fetch, not a page fetch
  108.  *      bit 26          : if set, the previous Arcweb window should be closed
  109.  *      bit 27          : if set, URL has been changed (+ is in URL file)
  110.  *      bit 28          : if set, request use of symbolic link in host filesystem
  111.  *      bit 29          : if set, (in FetchDone), Arcweb will not render it
  112.  *      bit 30          : if set, bits 0-16 are valid, else they are invalid
  113.  *      bit 31          : if set, the buffer contains an error message
  114.  *
  115.  */
  116.  
  117. typedef struct {
  118.         struct arcweb_msghdr {    /* message block header. */
  119.           int size;               /* 20<=size<=256, multiple of 4 */
  120.           int task;               /* task handle of sender (filled in by wimp) */
  121.           int my_ref;             /* unique ref number (filled in by wimp) */
  122.           int your_ref;           /* (0==>none) if non-zero, acknowledge */
  123.           arcweb_msgid action;    /* message action code */
  124.         } hdr;
  125.         void           *handle;         /* MUST be preserved */
  126.         int             flags;          /* See above */
  127.         union {
  128.                 int  _arcweb_words[57]; /* Ensure the right size */
  129.                 char _arcweb_data[228]; /* a char version        */
  130.  
  131.                 struct {
  132.                         int     localfile;  /* *RISC OS* file handle */
  133.                         union {
  134.                                 int     url_file;            /* if bit 22 set */
  135.                                 char    URL[arcweb_MAXURL];  /* if bit 22 clr */
  136.                         } url;
  137.                 } fetch_request;
  138.  
  139.                 union {
  140.                         struct {
  141.                                 int     use_given_expiry;
  142.                                 int     use_default_expiry;
  143.                                 char    date[8]; /* to stop Cv5 warnings */
  144.                         } expiry;
  145.                         char    error[228];
  146.                 } fetch_done;
  147.  
  148.                 struct {
  149.                         int     localsrc;
  150.                         int     localtmp;
  151.                         int     localdiag;
  152.                         int     locallink;
  153.                         int     size_in_msg;
  154.                         char    fileheader[228-5*sizeof(int)];
  155.                 } render_request;
  156.  
  157.                 struct {
  158.                         char    error[228];
  159.                 } render_done;
  160.  
  161.                 struct {
  162.                         int     formfile;
  163.                 } email_request;
  164.  
  165.                 struct {
  166.                         char    error[228]; /* Do I want this? */
  167.                 } email_done;
  168.  
  169.                 struct {
  170.                         union {
  171.                                 int  url_file;           /* if bit 22 set   */
  172.                                 char URL[arcweb_MAXURL]; /* if bit 22 clear */
  173.                         } url;
  174.                 } expire;
  175.  
  176.                 struct {
  177.                         int     localfile;
  178.                         int     formfile;
  179.                         union {
  180.                                 int     url_file;           /* If bit 22 set   */
  181.                                 char    URL[arcweb_MAXURL]; /* If bit 22 clear */
  182.                         } url;
  183.                 } post_request;
  184.  
  185.                 union {
  186.                         struct {
  187.                                 int     use_given_expiry;
  188.                                 int     use_default_expiry;
  189.                                 char    date[5];
  190.                         } expiry;
  191.                         char    error[228];
  192.                 } post_done;
  193.  
  194.                 struct {
  195.                         int     flags;
  196.                         int     transmit_total;
  197.                         int     transmit_sofar;
  198.                         int     receive_total;
  199.                         int     receive_sofar;
  200.                         char    message[208];
  201.                 } status_report;
  202.  
  203.                 struct {
  204.                         char    reason[228];
  205.                 } abort_request;
  206.  
  207.                 struct {
  208.                         int     renderer_handle;
  209.                         int     x_os_units;
  210.                         int     y_os_units;
  211.                 } image_size;
  212.  
  213.                 struct {
  214.                         int     renderer_handle;
  215.                 } image_complete;
  216.  
  217.         } data;
  218. } arcweb_msg; /* use as a wimp_msgstr */
  219.  
  220. #ifdef __cplusplus
  221. }
  222. #endif
  223. #endif
  224.