@ GNU AS assembler header file for NetPrint
@ Written by DefMod (Dec  9 2012) on Sun Dec  9 15:47:15 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.

#ifndef NetPrint_Hdr
#  define NetPrint_Hdr

#  ifndef Get_Types
#    define Get_Types
#    include "oslib/Types.Hdr"
#  endif

#  ifndef Get_OS
#    define Get_OS
#    include "oslib/OS.Hdr"
#  endif

@Symbols for constants
#  define NetPrint_PSNameLimit 0x100
#  define NetPrint_StatusReady 0x0
#  define NetPrint_StatusBusy 0x1
#  define NetPrint_StatusJammed 0x2
#  define NetPrint_StatusOffline 0x6
#  define NetPrint_StatusOpen 0x7
#  define Error_NetPrintNameTooLong 0x10c00
#  define Error_NetPrintSingleStream 0x10c01
#  define Error_NetPrintAllPrintersBusy 0x10c02
#  define Error_NetPrintOffLine 0x10c09
#  define Error_NetPrintNotFound 0x10c0a
#  define Error_NetPrintInternalError 0x10c0b

@Symbols for structure offsets and sizes
        .struct 0
        .skip   Byte
NetPrint_Status                : 

        .struct 0
NetPrint_BriefEntry_station_no : .skip   Byte
NetPrint_BriefEntry_net_no     : .skip   Byte
NetPrint_BriefEntry_ps_name    : .skip   256*Char
NetPrint_BriefEntry            : 

        .struct 0
NetPrint_NameEntry_ps_name     : .skip   256*Char
NetPrint_NameEntry             : 

        .struct 0
NetPrint_FullEntry_station_no  : .skip   Byte
NetPrint_FullEntry_net_no      : .skip   Byte
NetPrint_FullEntry_status      : .skip   NetPrint_Status
NetPrint_FullEntry_status_station_no: .skip   Byte
NetPrint_FullEntry_status_net_no: .skip   Byte
NetPrint_FullEntry_ps_name     : .skip   256*Char
NetPrint_FullEntry             : 


@Symbols for SWI's and SWI reason codes
.set XNetPrint_ReadPSNumber,0x60200
.set NetPrint_ReadPSNumber,0x40200
   @Exit
   @  R0 = station_no (Byte)
   @  R1 = net_no (Byte)

.set XNetPrint_SetPSNumber,0x60201
.set NetPrint_SetPSNumber,0x40201
   @Entry
   @  R0 = station_no (Byte)
   @  R1 = net_no (Byte)

.set XNetPrint_ReadPSName,0x60202
.set NetPrint_ReadPSName,0x40202
   @Entry
   @  R1 = buffer (pointer to String)
   @  R2 = size (Int)
   @Exit
   @  R0 corrupted
   @  R1 -> end (Char)
   @  R2 corrupted

.set XNetPrint_SetPSName,0x60203
.set NetPrint_SetPSName,0x40203
   @Entry
   @  R0 -> ps_name (String)

.set XNetPrint_ReadPSTimeouts,0x60204
.set NetPrint_ReadPSTimeouts,0x40204
   @Exit
   @  R0 = transmit_count (Int)
   @  R1 = transmit_delay (Int)
   @  R2 = peek_count (Int)
   @  R3 = peek_delay (Int)
   @  R4 = receive_delay (Int)
   @  R5 = broadcast_delay (Int)

.set XNetPrint_SetPSTimeouts,0x60205
.set NetPrint_SetPSTimeouts,0x40205
   @Entry
   @  R0 = transmit_count (Int)
   @  R1 = transmit_delay (Int)
   @  R2 = peek_count (Int)
   @  R3 = peek_delay (Int)
   @  R4 = receive_delay (Int)
   @  R5 = broadcast_delay (Int)

.set XNetPrint_BindPSName,0x60206
.set NetPrint_BindPSName,0x40206
   @Entry
   @  R0 -> ps_name (String)
   @Exit
   @  R0 = station_no (Byte)
   @  R1 = net_no (Byte)

.set XNetPrint_ListServers,0x60207
.set NetPrint_ListServers,0x40207

#  define NetPrintListServers_Brief 0x0
   @Entry
   @  R0 = &0
   @  R1 = entries (pointer to NetPrint_BriefEntry)
   @  R2 = size (Int)
   @  R3 = timeout (Int)
   @Exit
   @  R0 = entry_count (Int)
   @  R3 = no_more (Bool)

#  define NetPrintListServers_Name 0x1
   @Entry
   @  R0 = &1
   @  R1 = entries (pointer to NetPrint_NameEntry)
   @  R2 = size (Int)
   @  R3 = timeout (Int)
   @Exit
   @  R0 = entry_count (Int)
   @  R3 = no_more (Bool)

#  define NetPrintListServers_Full 0x2
   @Entry
   @  R0 = &2
   @  R1 = entries (pointer to NetPrint_FullEntry)
   @  R2 = size (Int)
   @  R3 = timeout (Int)
   @Exit
   @  R0 = entry_count (Int)
   @  R3 = no_more (Bool)

.set XNetPrint_ConvertStatusToString,0x60208
.set NetPrint_ConvertStatusToString,0x40208
   @Entry
   @  R0 -> status_station_net (Bits)
   @  R1 = buffer (pointer to String)
   @  R2 = size (Int)
   @Exit
   @  R0 corrupted
   @  R1 -> end (Char)
   @  R2 corrupted

#  define Service_NetPrintCheckD1 0x40200
   @Entry
   @  R1 = &40200
   @Exit
   @  R1 = unclaimed (Bool)

#endif
