;Assembler header file for URI
;written by DefMod (Apr 11 1999) on Mon Apr 19 22:00:20 1999
;Tom Hughes, tom@compton.nu, 27 Mar 1999

        [       :LNOT: :DEF: Get_Types
        GBLS    Get_Types
        ]
        [       :LNOT: :DEF: Types_Hdr
Get_Types                       SETS    "GET OS:Hdr.Types"
        |
Get_Types                       SETS    ""
        ]
        $Get_Types

        [       :LNOT: :DEF: Get_OS
        GBLS    Get_OS
        ]
        [       :LNOT: :DEF: OS_Hdr
Get_OS                          SETS    "GET OS:Hdr.OS"
        |
Get_OS                          SETS    ""
        ]
        $Get_OS

        [       :LNOT: :DEF: Get_WIMP
        GBLS    Get_WIMP
        ]
        [       :LNOT: :DEF: WIMP_Hdr
Get_WIMP                        SETS    "GET OS:Hdr.WIMP"
        |
Get_WIMP                        SETS    ""
        ]
        $Get_WIMP

        [       :LNOT: :DEF: URI_Hdr
        GBLS    URI_Hdr

;Symbols for constants
URI_FileType                    *       &F91
Message_URIHandlerStarted       *       &4E380
Message_URIHandlerDying         *       &4E381
Message_URIProcess              *       &4E382
Message_URIReturnResult         *       &4E383
Message_URIProcessAck           *       &4E384
URI_ProcessCheckOnly            *       &1
URI_ReturnResultNotClaimed      *       &1
URI_DispatchInformCaller        *       &1
URI_DispatchCheckOnly           *       &2
URI_DispatchNoExternalStartup   *       &4
URI_DispatchRequestRejected     *       &1
Error_URINoMemory               *       &810A01
Error_URIBadURI                 *       &810A02
Error_URIBadHandle              *       &810A03
Error_URIBadFile                *       &810A04

;Symbols for structure offsets and sizes
URI_H                           *       4 ;abstract type
URI_ProcessFlags                *       Bits

URI_ReturnResultFlags           *       Bits

                                ^       0
URI_MessageHandlerStarted_flags #       Bits
URI_MessageHandlerStarted       *       @

                                ^       0
URI_MessageHandlerDying_flags   #       Bits
URI_MessageHandlerDying         *       @

                                ^       0
URI_MessageProcess_flags        #       URI_ProcessFlags
URI_MessageProcess_uri          #       Ptr
URI_MessageProcess_handle       #       URI_H
URI_MessageProcess              *       @

                                ^       0
URI_MessageReturnResult_flags   #       URI_ReturnResultFlags
URI_MessageReturnResult_handle  #       URI_H
URI_MessageReturnResult         *       @

                                ^       0
URI_MessageProcessAck_flags     #       URI_ProcessFlags
URI_MessageProcessAck_uri       #       Ptr
URI_MessageProcessAck_handle    #       URI_H
URI_MessageProcessAck           *       @

URI_DispatchFlags               *       Bits

URI_DispatchResultFlags         *       Bits


;Symbols for SWIs and SWI reason codes
XURI_Version                    *       &6E380
URI_Version                     *       &4E380
   ;Entry
   ;  R0 = flags (Bits)
   ;Exit
   ;  R0 = version (Int)

XURI_Dispatch                   *       &6E381
URI_Dispatch                    *       &4E381
   ;Entry
   ;  R0 = flags (URI_DispatchFlags)
   ;  R1 -> uri (String)
   ;  R2 = source_task (Wimp_T)
   ;Exit
   ;  R0 = flags (URI_DispatchResultFlags)
   ;  R2 = handler_task (Wimp_T)
   ;  R3 = handle (URI_H)

XURI_RequestURISize             *       &6E382
URI_RequestURISize              *       &4E382
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = &0
   ;  R3 = handle (URI_H)
   ;Exit
   ;  R2 = buffer_size (Int)

XURI_RequestURI                 *       &6E382
URI_RequestURI                  *       &4E382
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = buffer (pointer to String)
   ;  R2 = buffer_size (Int)
   ;  R3 = handle (URI_H)
   ;Exit
   ;  R2 = length (Int)

XURI_InvalidateURI              *       &6E383
URI_InvalidateURI               *       &4E383
   ;Entry
   ;  R0 = flags (Bits)
   ;  R3 = handle (URI_H)

Service_URI                     *       &A7

ServiceURI_HandlerStarted       *       &0
   ;Entry
   ;  R0 = &0
   ;  R1 = &A7

ServiceURI_HandlerDying         *       &1
   ;Entry
   ;  R0 = &1
   ;  R1 = &A7

ServiceURI_Process              *       &2
   ;Entry
   ;  R0 = &2
   ;  R1 = &A7
   ;  R2 = flags (URI_ProcessFlags)
   ;  R3 -> uri (String)
   ;  R4 = handle (URI_H)
   ;Exit
   ;  R1 = unclaimed (Bool)

ServiceURI_ReturnResult         *       &3
   ;Entry
   ;  R0 = &3
   ;  R1 = &A7
   ;  R2 = flags (URI_ReturnResultFlags)
   ;  R3 = &0
   ;  R4 = handle (URI_H)

        ]

        END
