@ GNU AS assembler header file for Territory
@ Written by DefMod (Dec  9 2012) on Sun Dec  9 15:50:01 2012
@ Jonathan Coxhead, jonathan@doves.demon.co.uk, 19 May 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 Territory_Hdr
#  define Territory_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 Territory_Current 0xffffffff
#  define Territory_UK 0x1
#  define Territory_Master 0x2
#  define Territory_Compact 0x3
#  define Territory_Italy 0x4
#  define Territory_Spain 0x5
#  define Territory_France 0x6
#  define Territory_Germany 0x7
#  define Territory_Portugal 0x8
#  define Territory_Esperanto 0x9
#  define Territory_Greece 0xa
#  define Territory_Sweden 0xb
#  define Territory_Finland 0xc
#  define Territory_Denmark 0xe
#  define Territory_Norway 0xf
#  define Territory_Iceland 0x10
#  define Territory_Canada1 0x11
#  define Territory_Canada2 0x12
#  define Territory_Canada 0x13
#  define Territory_Turkey 0x14
#  define Territory_Arabic 0x15
#  define Territory_Ireland 0x16
#  define Territory_HongKong 0x17
#  define Territory_Russia 0x18
#  define Territory_Russia2 0x19
#  define Territory_Israel 0x1a
#  define Territory_Mexico 0x1b
#  define Territory_LatimAm 0x1c
#  define Territory_USA 0x30
#  define Territory_IgnoreCase 0x1
#  define Territory_IgnoreAccent 0x2
#  define Territory_AlphabetBFont 0x64
#  define Territory_AlphabetLatin1 0x65
#  define Territory_AlphabetLatin2 0x66
#  define Territory_AlphabetLatin3 0x67
#  define Territory_AlphabetLatin4 0x68
#  define Territory_AlphabetCyrillic 0x69
#  define Territory_AlphabetArabic 0x6a
#  define Territory_AlphabetGreek 0x6b
#  define Territory_AlphabetHebrew 0x6c
#  define Territory_AlphabetLatin5 0x6d
#  define Territory_AlphabetWelsh 0x6e
#  define Territory_AlphabetUTF8 0x6f
#  define Territory_AlphabetLatin9 0x70
#  define Territory_AlphabetLatin6 0x71
#  define Territory_AlphabetCyrillic2 0x78
#  define Error_TerritoryBadSWI 0x43062
#  define Error_TerritoryUnknown 0x190
#  define Error_TerritoryUnknownAlphabet 0x191
#  define Error_NoTerritory 0x192
#  define Territory_GivenTime 0x1
#  define Territory_GivenDate 0x2
#  define Territory_GivenDateAndTime 0x3
#  define Territory_WriteRightToLeft 0x1
#  define Territory_WriteBottomToTop 0x2
#  define Territory_WriteVertical 0x4
#  define Territory_PropertyControl 0x0
#  define Territory_PropertyUppercase 0x1
#  define Territory_PropertyLowercase 0x2
#  define Territory_PropertyAlphabetic 0x3
#  define Territory_PropertyPunctuation 0x4
#  define Territory_PropertyWhitespace 0x5
#  define Territory_PropertyDigit 0x6
#  define Territory_PropertyHexDigit 0x7
#  define Territory_PropertyAccented 0x8
#  define Territory_PropertyForward 0x9
#  define Territory_PropertyReverse 0xa
#  define Territory_SymbolDecimalPoint 0x0
#  define Territory_SymbolGroupSeparator 0x1
#  define Territory_SymbolGroupingList 0x2
#  define Territory_SymbolInternationalCurrencySymbol 0x3
#  define Territory_SymbolCurrencySymbol 0x4
#  define Territory_SymbolCurrencyPoint 0x5
#  define Territory_SymbolCurrencyGroupSeparator 0x6
#  define Territory_SymbolCurrencyGroupList 0x7
#  define Territory_SymbolCurrencyPlusSign 0x8
#  define Territory_SymbolCurrencyMinusSign 0x9
#  define Territory_SymbolInternationalCurrencyPrecision 0xa
#  define Territory_SymbolCurrencyPrecision 0xb
#  define Territory_SymbolCurrencySymbolPrecedesNonNegativeValue 0xc
#  define Territory_SymbolCurrencySymbolSeparatedFromNonNegativeValue 0xd
#  define Territory_SymbolCurrencySymbolPrecedesNegativeValue 0xe
#  define Territory_SymbolCurrencySymbolSeparatedFromNegativeValue 0xf
#  define Territory_SymbolCurrencyNonNegativeFormat 0x10
#  define Territory_SymbolCurrencyNegativeFormat 0x11
#  define Territory_SymbolListSeparator 0x12
#  define Territory_SymbolParenthesised 0x0
#  define Territory_SymbolSignPrecedes 0x1
#  define Territory_SymbolSignSucceeds 0x2
#  define Territory_SymbolSignImmediatelyPrecedes 0x3
#  define Territory_SymbolSignImmediatelySucceeds 0x4

@Symbols for structure offsets and sizes
        .struct 0
        .skip   Int
Territory_T                    : 

        .struct 0
        .skip   Bits
Territory_CollateFlags         : 

        .struct 0
        .skip   Int
Territory_AlphabetNumber       : 

        .struct 0
Territory_Data_e               : .skip   43*Ptr
Territory_Data                 : 

        .struct 0
Territory_Ordinals_centisecond : .skip   Int
Territory_Ordinals_second      : .skip   Int
Territory_Ordinals_minute      : .skip   Int
Territory_Ordinals_hour        : .skip   Int
Territory_Ordinals_date        : .skip   Int
Territory_Ordinals_month       : .skip   Int
Territory_Ordinals_year        : .skip   Int
Territory_Ordinals_weekday     : .skip   Int
Territory_Ordinals_yearday     : .skip   Int
Territory_Ordinals             : 

        .struct 0
Territory_PropertyTable_p      : .skip   8*Bits
Territory_PropertyTable        : 

        .struct 0
Territory_Calendar_first_working_day: .skip   Int
Territory_Calendar_last_working_day: .skip   Int
Territory_Calendar_month_count : .skip   Int
Territory_Calendar_day_count   : .skip   Int
Territory_Calendar_pm_limit    : .skip   Int
Territory_Calendar_we_limit    : .skip   Int
Territory_Calendar_w3_limit    : .skip   Int
Territory_Calendar_dy_limit    : .skip   Int
Territory_Calendar_st_limit    : .skip   Int
Territory_Calendar_mo_limit    : .skip   Int
Territory_Calendar_m3_limit    : .skip   Int
Territory_Calendar_tz_limit    : .skip   Int
Territory_Calendar             : 

        .struct 0
        .skip   Bits
Territory_TimeStringFlags      : 

        .struct 0
        .skip   Bits
Territory_WriteFlags           : 

        .struct 0
        .skip   Int
Territory_CharacterProperty    : 

        .struct 0
        .skip   Int
Territory_SymbolNo             : 

        .struct 0
        .skip   Int
Territory_SymbolCurrencyNo     : 


@Symbols for SWI's and SWI reason codes
.set XTerritory_Number,0x63040
.set Territory_Number,0x43040
   @Exit
   @  R0 = territory (Territory_T)

.set XTerritory_Register,0x63041
.set Territory_Register,0x43041
   @Entry
   @  R0 = territory (Territory_T)
   @  R1 -> entries (Territory_Data)
   @  R2 = workspace (pointer to Void)

.set XTerritory_Deregister,0x63042
.set Territory_Deregister,0x43042
   @Entry
   @  R0 = territory (Territory_T)

.set XTerritory_NumberToName,0x63043
.set Territory_NumberToName,0x43043
   @Entry
   @  R0 = territory (Territory_T)
   @  R1 = name (pointer to String)
   @  R2 = size (Int)

.set XTerritory_Exists,0x63044
.set Territory_Exists,0x43044
   @Entry
   @  R0 = territory (Territory_T)

.set XTerritory_AlphabetNumberToName,0x63045
.set Territory_AlphabetNumberToName,0x43045
   @Entry
   @  R0 = alphabet (Territory_AlphabetNumber)
   @  R1 = name (pointer to String)
   @  R2 = size (Int)

.set XTerritory_SelectAlphabet,0x63046
.set Territory_SelectAlphabet,0x43046
   @Entry
   @  R0 = territory (Territory_T)

.set XTerritory_SetTime,0x63047
.set Territory_SetTime,0x43047
   @Entry
   @  R0 -> date_and_time (OS_DateAndTime)

.set XTerritory_ReadCurrentTimeZone,0x63048
.set Territory_ReadCurrentTimeZone,0x43048
   @Exit
   @  R0 -> timezone (String)
   @  R1 = offset (Int)

.set XTerritory_ConvertTimeToUTCOrdinals,0x63049
.set Territory_ConvertTimeToUTCOrdinals,0x43049
   @Entry
   @  R1 -> date_and_time (OS_DateAndTime)
   @  R2 = ordinals (pointer to Territory_Ordinals)
   @Exit
   @  R0 corrupted

.set XTerritory_ConvertTextToString,0x63075
.set Territory_ConvertTextToString,0x43075

.set XTerritory_ReadTimeZones,0x6304a
.set Territory_ReadTimeZones,0x4304a
   @Entry
   @  R0 = territory (Territory_T)
   @Exit
   @  R0 -> timezone (String)
   @  R1 -> dst_timezone (String)
   @  R2 = offset (Int)
   @  R3 = dst_offset (Int)

.set XTerritory_ConvertDateAndTime,0x6304b
.set Territory_ConvertDateAndTime,0x4304b
   @Entry
   @  R0 = territory (Territory_T)
   @  R1 -> date_and_time (OS_DateAndTime)
   @  R2 = buffer (pointer to String)
   @  R3 = size (Int)
   @  R4 -> format (String)
   @Exit
   @  R0 corrupted
   @  R1 -> end (Char)
   @  R2 corrupted
   @  R3 corrupted

.set XTerritory_ConvertStandardDateAndTime,0x6304c
.set Territory_ConvertStandardDateAndTime,0x4304c
   @Entry
   @  R0 = territory (Territory_T)
   @  R1 -> date_and_time (OS_DateAndTime)
   @  R2 = buffer (pointer to String)
   @  R3 = size (Int)
   @Exit
   @  R0 corrupted
   @  R1 -> end (Char)
   @  R2 corrupted

.set XTerritory_ConvertStandardDate,0x6304d
.set Territory_ConvertStandardDate,0x4304d
   @Entry
   @  R0 = territory (Territory_T)
   @  R1 -> date (OS_DateAndTime)
   @  R2 = buffer (pointer to String)
   @  R3 = size (Int)
   @Exit
   @  R0 corrupted
   @  R1 -> end (Char)
   @  R2 corrupted

.set XTerritory_ConvertStandardTime,0x6304e
.set Territory_ConvertStandardTime,0x4304e
   @Entry
   @  R0 = territory (Territory_T)
   @  R1 -> time (OS_DateAndTime)
   @  R2 = buffer (pointer to String)
   @  R3 = size (Int)
   @Exit
   @  R0 corrupted
   @  R1 -> end (Char)
   @  R2 corrupted

.set XTerritory_ConvertTimeToOrdinals,0x6304f
.set Territory_ConvertTimeToOrdinals,0x4304f
   @Entry
   @  R0 = territory (Territory_T)
   @  R1 -> date_and_time (OS_DateAndTime)
   @  R2 = ordinals (pointer to Territory_Ordinals)
   @Exit
   @  R0 corrupted

.set XTerritory_ConvertTimeStringToOrdinals,0x63050
.set Territory_ConvertTimeStringToOrdinals,0x43050
   @Entry
   @  R0 = territory (Territory_T)
   @  R1 = format (Territory_TimeStringFlags)
   @  R2 -> t (String)
   @  R3 = ordinals (pointer to Territory_Ordinals)
   @Exit
   @  R0 corrupted

.set XTerritory_ConvertOrdinalsToTime,0x63051
.set Territory_ConvertOrdinalsToTime,0x43051
   @Entry
   @  R0 = territory (Territory_T)
   @  R1 = buffer (pointer to OS_DateAndTime)
   @  R2 -> ordinals (Territory_Ordinals)
   @Exit
   @  R0 corrupted

.set XTerritory_Alphabet,0x63052
.set Territory_Alphabet,0x43052
   @Entry
   @  R0 = territory (Territory_T)
   @Exit
   @  R0 = alphabet (Territory_AlphabetNumber)

.set XTerritory_AlphabetIdentifier,0x63053
.set Territory_AlphabetIdentifier,0x43053
   @Entry
   @  R0 = territory (Territory_T)
   @Exit
   @  R0 -> alphabet_name (String)

.set XTerritory_SelectKeyboardHandler,0x63054
.set Territory_SelectKeyboardHandler,0x43054
   @Entry
   @  R0 = territory (Territory_T)
   @Exit
   @  R0 corrupted

.set XTerritory_WriteDirection,0x63055
.set Territory_WriteDirection,0x43055
   @Entry
   @  R0 = territory (Territory_T)
   @Exit
   @  R0 = flags (Territory_WriteFlags)

.set XTerritory_CharacterPropertyTable,0x63056
.set Territory_CharacterPropertyTable,0x43056
   @Entry
   @  R0 = territory (Territory_T)
   @  R1 = property (Territory_CharacterProperty)
   @Exit
   @  R0 -> table (Territory_PropertyTable)

.set XTerritory_LowerCaseTable,0x63057
.set Territory_LowerCaseTable,0x43057
   @Entry
   @  R0 = territory (Territory_T)
   @Exit
   @  R0 -> table (Char)

.set XTerritory_UpperCaseTable,0x63058
.set Territory_UpperCaseTable,0x43058
   @Entry
   @  R0 = territory (Territory_T)
   @Exit
   @  R0 -> table (Char)

.set XTerritory_ControlTable,0x63059
.set Territory_ControlTable,0x43059
   @Entry
   @  R0 = territory (Territory_T)
   @Exit
   @  R0 -> table (Char)

.set XTerritory_PlainTable,0x6305a
.set Territory_PlainTable,0x4305a
   @Entry
   @  R0 = territory (Territory_T)
   @Exit
   @  R0 -> table (Char)

.set XTerritory_ValueTable,0x6305b
.set Territory_ValueTable,0x4305b
   @Entry
   @  R0 = territory (Territory_T)
   @Exit
   @  R0 -> table (Char)

.set XTerritory_RepresentationTable,0x6305c
.set Territory_RepresentationTable,0x4305c
   @Entry
   @  R0 = territory (Territory_T)
   @Exit
   @  R0 -> table (Char)

.set XTerritory_Collate,0x6305d
.set Territory_Collate,0x4305d
   @Entry
   @  R0 = territory (Territory_T)
   @  R1 -> s1 (String)
   @  R2 -> s2 (String)
   @  R3 = flags (Territory_CollateFlags)
   @Exit
   @  R0 = collate (Int)

.set XTerritory_ReadSymbols,0x6305e
.set Territory_ReadSymbols,0x4305e

.set XTerritory_ReadBooleanSymbols,0x6305e
.set Territory_ReadBooleanSymbols,0x4305e
   @Entry
   @  R0 = territory (Territory_T)
   @  R1 = symbol_no (Territory_SymbolNo)
   @Exit
   @  R0 = symbol (Bool)

.set XTerritory_ReadIntegerSymbols,0x6305e
.set Territory_ReadIntegerSymbols,0x4305e
   @Entry
   @  R0 = territory (Territory_T)
   @  R1 = symbol_no (Territory_SymbolNo)
   @Exit
   @  R0 = symbol (Int)

.set XTerritory_ReadStringSymbols,0x6305e
.set Territory_ReadStringSymbols,0x4305e
   @Entry
   @  R0 = territory (Territory_T)
   @  R1 = symbol_no (Territory_SymbolNo)
   @Exit
   @  R0 -> symbol (String)

.set XTerritory_ReadCalendarInformation,0x6305f
.set Territory_ReadCalendarInformation,0x4305f
   @Entry
   @  R0 = territory (Territory_T)
   @  R1 -> date_and_time (OS_DateAndTime)
   @  R2 = calendar (pointer to Territory_Calendar)
   @Exit
   @  R0 corrupted

.set XTerritory_NameToNumber,0x63060
.set Territory_NameToNumber,0x43060
   @Entry
   @  R0 = territory (Territory_T)
   @  R1 -> name (String)
   @Exit
   @  R0 = territory_out (Territory_T)

.set XTerritory_TransformString,0x63061
.set Territory_TransformString,0x43061
   @Entry
   @  R0 = territory (Territory_T)
   @  R1 = buffer (pointer to String)
   @  R2 -> s (String)
   @  R3 = size (Int)
   @Exit
   @  R0 = used (Int)

#  define Service_TerritoryManagerLoaded 0x64
   @Entry
   @  R1 = &64

#  define Service_TerritoryStarted 0x75
   @Entry
   @  R1 = &75

#endif
