.title init_handler : setup a condition handler at image startup time .ident /V1.0-0/ .disable global ;++ ; ; Facility: General utilities ; ; Functional description: ; ; This module setup a condition handler at image startup time. This ; condition handler will be called by VMS for each error not dismissed by ; a previous condition handler. ; ; To setup the condition handler, just link this module with your ; code (no call neccessary), and with a routine nammed CONDITION_HANDLER. ; ; Environment: VAX/VMS, user mode ; ; Author: Francois FOUCHET, Creation-date: 09-Jan-1991 ; ; *** GIVEN AS IS TO DECUS _ USE AT YOUR OWN RISK *** ; *************************************************** ; ;-- .sbttl initialization code ;++ ; ; These definitions are used to call INIT_HANDLER at image ; startup time (for more informations on LIB$INITIALIZE, see ; VAX RTL manual, chapter 7). ; ;-- .extrn lib$initialize .psect lib$initialize nopic,usr,con,rel,gbl,noshr,noexe,rd,nowrt,long .address init_handler .sbttl init_handler routine .psect init_code,exe,nowrt,shr,pic,long ;++ ; ; Functional description: ; ; This routine is called by LIB$INITIALIZE at image startup to set ; "CONDITION_HANDLER" as ... condition handler. ; ; Calling sequence: ; ; call init_handler (init_coroutine, cli_coroutine) ; Note : this routine is called by VMS at image startup, *NOT* ; directly by a user. ; ; Input parameters: ; ; Init_coroutine : initialization coroutine entry point ; VMS usage : procedure entry point ; Type : longword (unsigned) ; Access : read only ; Mechanism : by reference ; ; Cli_coroutine : cli coroutine entry point ; VMS usage : procedure entry point ; Type : longword (unsigned) ; Access : read only ; Mechanism : by reference ; ; Implicit inputs: ; ; None ; ; Output parameters: ; ; None ; ; Implicit outputs: ; ; None ; ; Completion codes: ; ; R0 contains the value set by the called coroutine. ; ; Side effects: ; ; Setup a condition handler in current frame ; Call init coroutine ; ;-- .extrn condition_handler .entry init_handler,^m<> movab condition_handler,(fp) ; Setup condition handler callg (ap),@4(ap) ; Call coroutine ret ; Here at image exit .end