home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
LIB
/
prsnam.a
< prev
next >
Wrap
Text File
|
2009-11-06
|
2KB
|
98 lines
This is a system-state-program which replaces the F$PrsNam call of
the kernel to allow all characters in your filename except / @
The module can be installed as a system-extention in your init module.
Enjoy it...
Kei, Stephan, Guido
------------ Makefile --------------
RFLAGS=
RC = r68
prsnam:
l68 -gO=$* $*.r -l=/h0/lib/sys.l
------------ prsnam.a --------------
*
* PrsNam for filenames with all characters ! - ~
* 26.12.92 Stephan Paschedag, Kei Thomsen, Guidoh Scheil
*
use <oskdefs.d>
Edition equ 1 current Edition number
Typ_Lang set (Systm<<8)+Objct
Attr_Rev set ((ReEnt+SupStat)<<8)+0
psect prsnam,Typ_Lang,Attr_Rev,Edition,0,Entry
vsect
ds.l 1
ends
Entry: move.l a1,-(a7)
lea SvcTab(pc),a1
os9 F$SSvc
movem.l (a7)+,a1
rts
SvcTab: dc.w F$PrsNam
dc.w PrsNam-*-2
dc.w F$PrsNam+SysTrap
dc.w PrsNam-*-2
dc.w -1
*
* Input : (a0) = name
*
* Output : d0 = pathlist delimiter
* d1 = length of pathlist element
* a0 = pathlist pointer updated past the optional "/" char
* a1 = address of the last character of the name + 1
*
PrsNam: moveq.l #0,d0 clear char counter
move.b (a0)+,d0 get first char
cmpi.b #'/',d0 absolute path ?
bne.b Prs1 ..no
move.b (a0)+,d0 get next char
Prs1 lea.l -1(a0),a1 adjust pointer
moveq.l #0,d1
bsr.b PrsTst
bcs.b Prs2
Prs3 addq.w #1,d1
move.b (a0)+,d0
bsr.b PrsTst
bcc.b Prs3
move.b -(a0),d0
bclr #31,d1
bne.b Prs4
move.b (a1),d0
Prs2 movea.l a1,a0
move.w #E$BNam,d1
ori.b #Carry,ccr
Prs4 exg a1,a0
movem.l d0-d1,R$d0(a5)
movem.l a0-a1,R$a0(a5)
rts
PrsTst cmpi.b #'~',d0
bhi.b PrsErr
cmpi.b #' ',d0
bls.b PrsErr
cmpi.b #'@',d0
beq.s PrsErr
cmpi.b #'.',d0
beq.b PrsT3
cmpi.b #'/',d0
beq.b PrsErr
PrsOK bset #31,d1
PrsT3 andi.b #255-Carry,ccr
rts
PrsErr ori.b #Carry,ccr
rts
ends