home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
archives
/
intel86.tar.gz
/
intel86.tar
/
itemize.p86
< prev
next >
Wrap
Text File
|
1986-06-06
|
3KB
|
84 lines
$large
itemize: do;
/*
* This program copies each pathname given by the input filespec
* to the corresponding output file. It is intended to be used
* with a single output file and a wild-card input pathname, in
* which case it places in that output file all pathnames matching
* the input filespec.
*
* by Albert J. Goodman; Edit date: 6-June-1985
*/
/* Get all iRMX 86 system call external declarations */
$include(:I:RMX.EXT)
declare
CR literally '0Dh', /* ASCII Carriage-return character */
LF literally '0Ah', /* ASCII Line-feed character */
( input$pathname, output$pathname ) structure(
len byte,
ch(80) byte),
output$preposition byte,
output$connection token,
( bytes$written, status ) word,
exception$handler$info structure(
offset word,
base word,
mode byte);
check$excep: procedure; /* Check for an exception code */
if ( status <> E$OK ) then /* we got an exceptional condition */
call rq$exit$io$job( status, 0, @status ); /* abort the program */
end check$excep;
/* begin ITEMIZE */
/* Disable our exception handler, so control never passes to it. */
exception$handler$info.offset = 0;
exception$handler$info.base = 0;
exception$handler$info.mode = 0;
call rq$set$exception$handler( @exception$handler$info, @status );
call check$excep;
/* get the first input pathname */
call rq$c$get$input$pathname( @input$pathname, size( input$pathname ),
@status );
call check$excep;
/* while we have any more pathnames */
do while ( input$pathname.len > 0 );
/* Get the matching output pathname (default to command output) */
output$preposition = rq$c$get$output$pathname( @output$pathname,
size( output$pathname ),
@( 7,'TO :CO:' ), @status );
call check$excep;
/* Get a connection to the output file */
output$connection = rq$c$get$output$connection( @output$pathname,
output$preposition, @status );
call check$excep;
/* Copy the input pathname to the output file */
bytes$written = rq$s$write$move( output$connection, @input$pathname.ch,
input$pathname.len, @status );
call check$excep;
/* Append a carriage-return/line-feed line terminator */
bytes$written = rq$s$write$move( output$connection, @( CR,LF ),
2, @status );
call check$excep;
/* Close the output file */
call rq$s$close( output$connection, @status );
call check$excep;
/* And delete the output connection */
call rq$s$delete$connection( output$connection, @status );
call check$excep;
/* Get the next input pathname, if any */
call rq$c$get$input$pathname( @input$pathname, size( input$pathname ),
@status );
call check$excep;
end; /* do while ( input$pathname.len > 0 ) */
/* Terminate the program, signalling O.K. */
call rq$exit$io$job( E$OK, 0, @status );
end itemize;