(* Epoc C header for use with CLIB include file *)
(* Release 1.00F NSM *)
(* Copyright (C) Psion PLC 1991 *)

include "epocdefs.inc"

module iclib

section

segment _TEXT(CODE,68H)

segment STACK(STACK,74H)
public  __stack_start:

segment _MAGIC(MAGIC,68H)
public _DatWordDead: dw 0
public _DatHandNext: dw 0
public _DatHandPrev: dw 0
public _DatCountrySeg: dw 0
public _DatClassHandle: dw 0
public _DatClassPtr: dw 0
public _DatEClassHandle: dw 0
public _DatEClassPtr: dw 0
public _DatEnterFramePtr: dw 0
public _w_ws: dw 0
public _w_am: dw 0
public _wClientData: dw 0
public _wserv_channel: dw 0
public _T: dw 0
public _r: dw 0
public _DatOsFramePtr: dw 0
public _DatATFlag: db 0
public _DatHeapLocked: db 0
public _DatProcessNamePtr: dw 0
public _DatCommandPtr: dw 0
public _DatTest: dw 0
public _DatApp1: dw 0
public _DatApp2: dw 0
public _DatApp3: dw 0
public _DatApp4: dw 0
public _DatApp5: dw 0
public _DatApp6: dw 0
public _DatApp7: dw 0
public _DatDialogPtr: dw 0
public _DatGate: dw 0
public _DatLocked: dw 0
public _DatStatusNamePtr: dw 0
public _DatUsedPathNamePtr: dw 0
org	StackSize-40H

segment _INIT(DATA,48H)
public __init_start:

segment _CONST(DATA,48H)
public __const_start:
    	dw	0

segment _DATA(DATA,68H)
public __data_start:

segment _BSS(BSS,68H)
public __bss_start:

segment _BSS_END(BSS,68H)
public __bss_end:

group DGROUP(_MAGIC,_INIT,_CONST,_DATA,_BSS,_BSS_END)

select _TEXT

extrn __startup
extrn _exit
extrn _ExtCatTable
extrn _ClassTable

public __begin :

	call	__startup
	ret	far 0

	dw	__bss_start
	dw	_ExtCatTable
	dw	_ClassTable
	dw	_DatWordDead
	dw	__bss_end

public _p_leave:
	int	LibLeave
	int	LibSendExit

    	dw	__init_start
    	dw	__const_start

public _p_exit:
        mov     ax, bx
        jmp     _exit

public _p_abort:
	mov	ax, FailedToStartErr
	jmp	_exit

end *
