; Assembler header file for OSGBPB
; Written by DefMod (Dec  9 2012) on Sun Dec  9 15:43:44 2012
; Jonathan Coxhead, jonathan@doves.demon.co.uk, 21 Aug 1995

; OSLib---efficient, type-safe, transparent, extensible,
; register-safe API coverage of RISC OS
; 
; Copyright (c) 1994-2012 Jonathan Coxhead and OSLib maintainers
; 
; Licence:
; 
;    OSLib is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 1, or (at your option)
; any later version - and this with the following clarification and
; special exception:
; 
;    Linking this library statically or dynamically with other modules
; is making a combined work based on this library. Thus, the terms
; and conditions of the GNU General Public License cover the whole
; combination.
; 
;    As a special exception, the copyright holders of this library
; give you permission to link this library with independent modules
; to produce an executable, regardless of the license terms of these
; independent modules, and to copy and distribute the resulting
; executable under terms of your choice, provided that you also meet,
; for each linked independent module, the terms and conditions of the
; license of that module. An independent module is a module which is
; not derived from or based on this library. If you modify this
; library, you may extend this exception to your version of the library,
; but you are not obliged to do so. If you do not wish to do so, delete
; this exception statement from your version.
; 
;    OSLib is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.
; 
;    You should have received a copy of the GNU General Public License
; along with this programme; if not, write to the Free Software
; Foundation, Inc, 675 Mass Ave, Cambridge, MA 02139, USA.

        [       :LNOT: :DEF: OSGBPB_Hdr
        GBLS    OSGBPB_Hdr

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

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

        [       :LNOT: :DEF: Get_FileSwitch
        GBLS    Get_FileSwitch
        ]
        [       :LNOT: :DEF: FileSwitch_Hdr
Get_FileSwitch                  SETS    "GET oslib/FileSwitch.Hdr"
        |
Get_FileSwitch                  SETS    ""
        ]
        $Get_FileSwitch

;Symbols for constants
OSGBPB_PrivilegeOwner           *       &0
OSGBPB_PrivilegePublic          *       &FF
OSGBPB_NoMore                   *       -1

;Symbols for structure offsets and sizes
        ^       0
OSGBPB_Name_count               #       Byte
OSGBPB_Name_c                   #       Char
OSGBPB_Name                     *       @
        
        MACRO
$label                          OSGBPB_Name_MEMBERS
$label._count                   #       Byte
        MEND
        
        ^       0
OSGBPB_NameBase                 OSGBPB_Name_MEMBERS
OSGBPB_NameBase                 *       @

        ^       0
OSGBPB_DiscName_name            #       OSGBPB_Name
OSGBPB_DiscName                 *       @

        ^       0
OSGBPB_DirName_reserved         #       Byte
OSGBPB_DirName_name             #       OSGBPB_Name
OSGBPB_DirName                  *       @

        ^       0
OSGBPB_NameList_names           #       OSGBPB_Name
OSGBPB_NameList                 *       @

        ^       0
OSGBPB_Info_load_addr           #       Bits
OSGBPB_Info_exec_addr           #       Bits
OSGBPB_Info_size                #       Int
OSGBPB_Info_attr                #       FileSwitch_Attr
OSGBPB_Info_obj_type            #       FileSwitch_ObjectType
OSGBPB_Info_name                #       Char
OSGBPB_Info                     *       @
        
        MACRO
$label                          OSGBPB_Info_MEMBERS
$label._load_addr               #       Bits
$label._exec_addr               #       Bits
$label._size                    #       Int
$label._attr                    #       FileSwitch_Attr
$label._obj_type                #       FileSwitch_ObjectType
        MEND
        
        ^       0
OSGBPB_InfoBase                 OSGBPB_Info_MEMBERS
OSGBPB_InfoBase                 *       @

        ^       0
OSGBPB_SystemInfo_load_addr     #       Bits
OSGBPB_SystemInfo_exec_addr     #       Bits
OSGBPB_SystemInfo_size          #       Int
OSGBPB_SystemInfo_attr          #       FileSwitch_Attr
OSGBPB_SystemInfo_obj_type      #       FileSwitch_ObjectType
OSGBPB_SystemInfo_sin           #       Int
OSGBPB_SystemInfo_stamp         #       OS_DateAndTime
OSGBPB_SystemInfo_name          #       Char
OSGBPB_SystemInfo               *       @
        
        MACRO
$label                          OSGBPB_SystemInfo_MEMBERS
$label._load_addr               #       Bits
$label._exec_addr               #       Bits
$label._size                    #       Int
$label._attr                    #       FileSwitch_Attr
$label._obj_type                #       FileSwitch_ObjectType
$label._sin                     #       Int
$label._stamp                   #       OS_DateAndTime
        MEND
        
        ^       0
OSGBPB_SystemInfoBase           OSGBPB_SystemInfo_MEMBERS
OSGBPB_SystemInfoBase           *       @

        ^       0
OSGBPB_InfoStamped_load_addr    #       Bits
OSGBPB_InfoStamped_exec_addr    #       Bits
OSGBPB_InfoStamped_size         #       Int
OSGBPB_InfoStamped_attr         #       FileSwitch_Attr
OSGBPB_InfoStamped_obj_type     #       FileSwitch_ObjectType
OSGBPB_InfoStamped_file_type    #       Bits
OSGBPB_InfoStamped_name         #       Char
OSGBPB_InfoStamped              *       @
        
        MACRO
$label                          OSGBPB_InfoStamped_MEMBERS
$label._load_addr               #       Bits
$label._exec_addr               #       Bits
$label._size                    #       Int
$label._attr                    #       FileSwitch_Attr
$label._obj_type                #       FileSwitch_ObjectType
$label._file_type               #       Bits
        MEND
        
        ^       0
OSGBPB_InfoStampedBase          OSGBPB_InfoStamped_MEMBERS
OSGBPB_InfoStampedBase          *       @

        ^       0
OSGBPB_StringList_names         #       Skip
OSGBPB_StringList               *       @

        ^       0
OSGBPB_InfoList_info            #       OSGBPB_Info
OSGBPB_InfoList                 *       @

        ^       0
OSGBPB_SystemInfoList_info      #       OSGBPB_SystemInfo
OSGBPB_SystemInfoList           *       @

        ^       0
OSGBPB_InfoStampedList_info     #       OSGBPB_InfoStamped
OSGBPB_InfoStampedList          *       @

        ^       0
        #       Byte
OSGBPB_Privilege                *       @


;Symbols for SWI's and SWI reason codes
XOS_GBPB                        *       &2000C
OS_GBPB                         *       &C

OSGBPB_WriteAt                  *       &1
   ;Entry
   ;  R0 = &1
   ;  R1 = file (OS_F)
   ;  R2 -> data (data)
   ;  R3 = size (Int)
   ;  R4 = ptr (Int)
   ;Exit
   ;  R2 corrupted
   ;  R3 = unwritten (Int)
   ;  R4 corrupted

OSGBPB_WriteAtW                 *       &1
   ;Entry
   ;  R0 = &1
   ;  R1 = file (OS_FW)
   ;  R2 -> data (data)
   ;  R3 = size (Int)
   ;  R4 = ptr (Int)
   ;Exit
   ;  R2 corrupted
   ;  R3 = unwritten (Int)
   ;  R4 corrupted

OSGBPB_Write                    *       &2
   ;Entry
   ;  R0 = &2
   ;  R1 = file (OS_F)
   ;  R2 -> data (data)
   ;  R3 = size (Int)
   ;Exit
   ;  R2 corrupted
   ;  R3 = unwritten (Int)
   ;  R4 corrupted

OSGBPB_WriteW                   *       &2
   ;Entry
   ;  R0 = &2
   ;  R1 = file (OS_FW)
   ;  R2 -> data (data)
   ;  R3 = size (Int)
   ;Exit
   ;  R2 corrupted
   ;  R3 = unwritten (Int)
   ;  R4 corrupted

OSGBPB_ReadAt                   *       &3
   ;Entry
   ;  R0 = &3
   ;  R1 = file (OS_F)
   ;  R2 = buffer (pointer to data)
   ;  R3 = size (Int)
   ;  R4 = ptr (Int)
   ;Exit
   ;  R2 corrupted
   ;  R3 = unread (Int)
   ;  R4 corrupted

OSGBPB_ReadAtW                  *       &3
   ;Entry
   ;  R0 = &3
   ;  R1 = file (OS_FW)
   ;  R2 = buffer (pointer to data)
   ;  R3 = size (Int)
   ;  R4 = ptr (Int)
   ;Exit
   ;  R2 corrupted
   ;  R3 = unread (Int)
   ;  R4 corrupted

OSGBPB_Read                     *       &4
   ;Entry
   ;  R0 = &4
   ;  R1 = file (OS_F)
   ;  R2 = buffer (pointer to data)
   ;  R3 = size (Int)
   ;Exit
   ;  R2 corrupted
   ;  R3 = unread (Int)
   ;  R4 corrupted

OSGBPB_ReadW                    *       &4
   ;Entry
   ;  R0 = &4
   ;  R1 = file (OS_FW)
   ;  R2 = buffer (pointer to data)
   ;  R3 = size (Int)
   ;Exit
   ;  R2 corrupted
   ;  R3 = unread (Int)
   ;  R4 corrupted

OSGBPB_ReadDiscName             *       &5
   ;Entry
   ;  R0 = &5
   ;  R2 = disc_name (pointer to OSGBPB_DiscName)

OSGBPB_ReadCSDName              *       &6
   ;Entry
   ;  R0 = &6
   ;  R2 = csd_name (pointer to OSGBPB_DirName)

OSGBPB_ReadLibName              *       &7
   ;Entry
   ;  R0 = &7
   ;  R2 = lib_name (pointer to OSGBPB_DirName)

OSGBPB_CSDEntries               *       &8
   ;Entry
   ;  R0 = &8
   ;  R2 = name_list (pointer to OSGBPB_NameList)
   ;  R3 = count (Int)
   ;  R4 = context (Int)
   ;Exit
   ;  R3 = unread (Int)
   ;  R4 = context_out (Int)

OSGBPB_DirEntries               *       &9
   ;Entry
   ;  R0 = &9
   ;  R1 -> dir_name (String)
   ;  R2 = name_list (pointer to OSGBPB_StringList)
   ;  R3 = count (Int)
   ;  R4 = context (Int)
   ;  R5 = size (Int)
   ;  R6 -> entries (String)
   ;Exit
   ;  R3 = read_count (Int)
   ;  R4 = context_out (Int)

OSGBPB_DirEntriesInfo           *       &A
   ;Entry
   ;  R0 = &A
   ;  R1 -> dir_name (String)
   ;  R2 = info_list (pointer to OSGBPB_InfoList)
   ;  R3 = count (Int)
   ;  R4 = context (Int)
   ;  R5 = size (Int)
   ;  R6 -> entries (String)
   ;Exit
   ;  R3 = read_count (Int)
   ;  R4 = context_out (Int)

OSGBPB_DirEntriesSystemInfo     *       &B
   ;Entry
   ;  R0 = &B
   ;  R1 -> dir_name (String)
   ;  R2 = info_list (pointer to OSGBPB_SystemInfoList)
   ;  R3 = count (Int)
   ;  R4 = context (Int)
   ;  R5 = size (Int)
   ;  R6 -> entries (String)
   ;Exit
   ;  R3 = read_count (Int)
   ;  R4 = context_out (Int)

OSGBPB_DirEntriesInfoStamped    *       &C
   ;Entry
   ;  R0 = &C
   ;  R1 -> dir_name (String)
   ;  R2 = info_list (pointer to OSGBPB_InfoStampedList)
   ;  R3 = count (Int)
   ;  R4 = context (Int)
   ;  R5 = size (Int)
   ;  R6 -> entries (String)
   ;Exit
   ;  R3 = read_count (Int)
   ;  R4 = context_out (Int)

GBPBV                           *       &C

        ]
        END
