home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / os9 / 1563 < prev    next >
Encoding:
Internet Message Format  |  1992-12-29  |  2.7 KB

  1. Path: sparky!uunet!mcsun!Germany.EU.net!news.Hamburg.Germany.EU.net!abqhh!keihh!kt
  2. From: kt@keihh.hanse.de (Kei Thomsen)
  3. Newsgroups: comp.os.os9
  4. Subject: Program for filenames with all (' '..'~') F$PrsNam
  5. Message-ID: <315@keihh.hanse.de>
  6. Distribution: world
  7. Date: 28 Dec 1992 06:39:42 GMT
  8. Lines: 111
  9.  
  10.  
  11. This is a system-state-program which replaces the F$PrsNam call of
  12. the kernel to allow all characters in your filename except / @
  13. The module can be installed as a system-extention in your init module.
  14. Enjoy it...
  15.  
  16. Kei, Stephan, Guido
  17.  
  18. ------------ Makefile --------------
  19.  
  20. RFLAGS=
  21. RC = r68
  22.  
  23. prsnam:
  24.   l68 -gO=$* $*.r -l=/h0/lib/sys.l
  25.  
  26. ------------ prsnam.a --------------
  27. *
  28. * PrsNam for filenames with all characters ! - ~
  29. * 26.12.92 Stephan Paschedag, Kei Thomsen, Guidoh Scheil
  30. *
  31.  
  32.  use <oskdefs.d>
  33.  
  34.  
  35. Edition equ 1 current Edition number
  36. Typ_Lang set (Systm<<8)+Objct
  37. Attr_Rev set ((ReEnt+SupStat)<<8)+0
  38.  
  39.  psect prsnam,Typ_Lang,Attr_Rev,Edition,0,Entry
  40.  
  41.  vsect
  42.  ds.l 1
  43.  ends
  44.  
  45. Entry: move.l a1,-(a7)
  46.  lea SvcTab(pc),a1
  47.  os9 F$SSvc
  48.  movem.l (a7)+,a1
  49.  rts
  50.  
  51. SvcTab: dc.w F$PrsNam
  52.  dc.w PrsNam-*-2
  53.  dc.w F$PrsNam+SysTrap
  54.  dc.w PrsNam-*-2
  55.  dc.w -1
  56.  
  57. *
  58. * Input  :   (a0) = name
  59. *
  60. * Output :    d0  = pathlist delimiter
  61. *             d1  = length of pathlist element
  62. *             a0  = pathlist pointer updated past the optional "/" char
  63. *             a1  = address of the last character of the name + 1
  64. *
  65. PrsNam: moveq.l #0,d0             clear char counter
  66.        move.b (a0)+,d0            get first char
  67.        cmpi.b #'/',d0             absolute path ?
  68.        bne.b Prs1                 ..no
  69.        move.b (a0)+,d0            get next char
  70. Prs1   lea.l -1(a0),a1            adjust pointer
  71.        moveq.l #0,d1
  72.        bsr.b PrsTst
  73.        bcs.b Prs2
  74. Prs3   addq.w #1,d1
  75.        move.b (a0)+,d0
  76.        bsr.b PrsTst
  77.        bcc.b Prs3
  78.        move.b -(a0),d0
  79.        bclr #31,d1
  80.        bne.b Prs4
  81.        move.b (a1),d0
  82. Prs2   movea.l a1,a0
  83.        move.w #E$BNam,d1
  84.        ori.b #Carry,ccr
  85. Prs4   exg a1,a0
  86.        movem.l d0-d1,R$d0(a5)
  87.        movem.l a0-a1,R$a0(a5)
  88.        rts
  89.  
  90. PrsTst cmpi.b #'~',d0
  91.        bhi.b PrsErr
  92.        cmpi.b #' ',d0
  93.        bls.b PrsErr
  94.        cmpi.b #'@',d0
  95.        beq.s PrsErr
  96.        cmpi.b #'.',d0
  97.        beq.b PrsT3
  98.        cmpi.b #'/',d0
  99.        beq.b PrsErr
  100. PrsOK  bset #31,d1
  101. PrsT3  andi.b #255-Carry,ccr
  102.        rts
  103. PrsErr ori.b #Carry,ccr
  104.        rts
  105.  
  106.  ends
  107.  
  108.                    /\
  109.                   |^^|
  110.                   |{}|
  111.    _______________/~~\________________
  112.   / Kei Thomsen   |  | keihh.hanse.de \
  113.  `========--------.  .---------========'
  114.                   ||||
  115.  Wildermuthring 90 || kt@keihh.hanse.de
  116.  2000 Hamburg 62   ||    OS-9 68030 
  117.  Home: 040/5205921 || Modem: 040/5200428
  118.  FH-Wedel:         ||  1200-14400 Baud
  119.  04103/804841  ,---||---, (V32bis)
  120.                '---<>---'
  121.