;-------------------------------------------------------------------C ; File_Utilities.Mar c ; c ; FORMER NAME = SFFILER January 1983 c ; Written by Denny Thury of Texas Instruments. Stolen and added C ; Directory Managment (DM) by John C. Hayre, Texas Instruments. C ; Send suggestions and/or complaints to: C ; C ; Texas Instruments C ; P.O. Box 225012, MS 3618 C ; Dallas, Texas 75265 C ; (Attention John Hayre) C ; C ; Phone: 214-995-3575 C ;-------------------------------------------------------------------C .TITLE FILEOPNS -- FILE UTILITIES .SUBTITLE MACRO DEFINITIONS ; .MACRO ON_ERROR DEST,?L BLBS R0,L BRW DEST L: .ENDM $DSCDEF .SUBTITLE DATA STRUCTURES ; ; THIS MODULE DEFINES ENTRY POINTS TO OPTIMIZE THE FILE OPERATIONS ; OF THE SHOWFILE PROGRAM. ; ; DATA STRUCTURES ; .PSECT FILEDATA,LONG,RD,WRT,NOSHR,PIC,NOEXE,REL,CON ; REC_SIZE=132 ; DEFAULT RECORD SIZE ; SF_FAB: $FAB FAC= ; FAB - FILE NAME IS PASSED ; SF_RAB: $RAB FAB=SF_FAB ; OP_FAB: $FAB XAB=PR_XAB,SHR= PR_XAB: $XABPRO NXT=DA_XAB DA_XAB: $XABDAT NXT=SZ_XAB SZ_XAB: $XABFHC ; ER_FAB: $FAB FAC= ; R1_FAB: $FAB FAC= R2_FAB: $FAB FAC= ; ;-------------------------------------------------------------------- ; ; THE FOLLOWING PSECT MAPS WITH A FORTRAN COMMON SECTION DEFINING THE ; USER'S READ BUFFER. ; ;-------------------------------------------------------------------- ; ; .PSECT LINE_BUFF,PIC,OVR,REL,GBL,SHR,NOEXE,RD,WRT,LONG ;LINE_BUFF: .BLKB REC_SIZE ; .PSECT LDATE,PIC,OVR,REL,GBL,SHR,NOEXE,RD,WRT,LONG LDATE: .BLKB 8 .PSECT LPROT,PIC,OVR,REL,GBL,SHR,NOEXE,RD,WRT,LONG LPROT: .BLKB 4 .PSECT LUIC1,PIC,OVR,REL,GBL,SHR,NOEXE,RD,WRT,LONG LUIC1: .BLKB 2 .PSECT LUIC2,PIC,OVR,REL,GBL,SHR,NOEXE,RD,WRT,LONG LUIC2: .BLKB 2 .PSECT DERR,PIC,OVR,REL,GBL,SHR,NOEXE,RD,WRT,LONG DERR: .BLKB 4 .PSECT FILE_SIZE,PIC,OVR,REL,GBL,SHR,NOEXE,RD,WRT,LONG FILE_SIZE: .BLKB 4 .PSECT FRST_FREE,PIC,OVR,REL,GBL,SHR,NOEXE,RD,WRT,LONG FRST_FREE: .BLKB 2 ; .PSECT CHKSUM,PIC,OVR,REL,GBL,SHR,NOEXE,RD,WRT,LONG ;CHKSUM: .BLKB 4 ; .PSECT CHKSIZ,PIC,OVR,REL,GBL,SHR,NOEXE,RD,WRT,LONG ;CHKSIZ: .BLKB 4 ; .PAGE .SUBTITLE FILE OPERATIONS -- FILE CHARACTERISTICS AND FILE DELETE ; .PSECT FILEMGR,PIC,EXE,SHR,NOWRT,RD,REL,CON,LONG ; ; DEFINE STACK DISPLACEMENT FOR FILE NAME DESCRIPTOR ADDRESS ; FILENAME=4 ; ;---------------------------------------------------------; ; FORTRAN LOOK: GET SOME OF THE FILE CHARACTERISTICS ; ;---------------------------------------------------------; .ENTRY FLOOK,^M ; CLRL DERR ;ASSUME NO ERROR MOVL FILENAME(AP),R2 ; GET ADDRESS OF FILE ; DESCRIPTOR AND SET FILE NAME AND SIZE IN FAB MOVL DSC$A_POINTER(R2),OP_FAB+FAB$L_FNA MOVB DSC$W_LENGTH(R2),OP_FAB+FAB$B_FNS ; $OPEN FAB=OP_FAB ; OPEN SO CAN CLOSE ON_ERROR BADX ; DERR = 0 FOR NO ERROR MOVQ DA_XAB+XAB$Q_CDT,LDATE ; DATE MOVW PR_XAB+XAB$W_PRO,LPROT CLRW LPROT+2 ; FILE PROTECTION MOVW PR_XAB+XAB$W_GRP,LUIC1 ; GROUP MOVW PR_XAB+XAB$W_MBM,LUIC2 ; MEMBER MOVL SZ_XAB+XAB$L_EBK,FILE_SIZE ;FILE SIZE MOVW SZ_XAB+XAB$W_FFB,FRST_FREE ;1ST FREE BYTE $CLOSE FAB=OP_FAB ; CLOSE ON_ERROR EXIT ; TERMINATE IF ERROR ; RET ; RETURN TO CALLER ; BADX: MOVL R2,DERR RET ; ERROR RETURN ; EXIT: $EXIT_S R0 ; ERROR -- TERMINATE IMAGE .END