1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2024-08-25 03:28:58 +00:00
This commit is contained in:
David Schmenk 2023-01-01 13:01:15 -08:00
commit f0d89f6b5c
11 changed files with 47 additions and 84 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -2,4 +2,5 @@ import matchfiles
predef matchName(src, exp)#1
predef matchList(pathptr, exp)#2
predef isWildName(exp)#1
predef fileFromPath(filestr, pathstr)#0
end

View File

@ -113,5 +113,18 @@ export def isWildName(exp)#1
fin
return FALSE
end
done
//
// Utility routine to separate filename from path
//
export def fileFromPath(filestr, pathstr)#0
byte i
for i = ^pathstr downto 1
if pathstr->[i] == '/'
break
fin
next
^filestr = ^pathstr - i
memcpy(filestr + 1, pathstr + 1 + i, ^filestr)
end
done

View File

@ -485,11 +485,11 @@ $(MON): utilsrc/apple/mon.pla $(PLASM)
./$(PLASM) -AMOW < utilsrc/apple/mon.pla > utilsrc/apple/mon.a
acme --setpc 4094 -o $(MON) utilsrc/apple/mon.a
$(COPY): utilsrc/apple/copy.pla $(PLASM)
$(COPY): utilsrc/apple/copy.pla $(MATCHFILES) $(PLASM)
./$(PLASM) -AMOW < utilsrc/apple/copy.pla > utilsrc/apple/copy.a
acme --setpc 4094 -o $(COPY) utilsrc/apple/copy.a
$(DEL): utilsrc/apple/del.pla $(PLASM)
$(DEL): utilsrc/apple/del.pla $(MATCHFILES) $(PLASM)
./$(PLASM) -AMOW < utilsrc/apple/del.pla > utilsrc/apple/del.a
acme --setpc 4094 -o $(DEL) utilsrc/apple/del.a
@ -497,7 +497,7 @@ $(REN): utilsrc/apple/ren.pla $(PLASM)
./$(PLASM) -AMOW < utilsrc/apple/ren.pla > utilsrc/apple/ren.a
acme --setpc 4094 -o $(REN) utilsrc/apple/ren.a
$(CAT): utilsrc/apple/cat.pla $(PLASM)
$(CAT): utilsrc/apple/cat.pla $(MATCHFILES) $(PLASM)
./$(PLASM) -AMOW < utilsrc/apple/cat.pla > utilsrc/apple/cat.a
acme --setpc 4094 -o $(CAT) utilsrc/apple/cat.a

View File

@ -1,4 +1,4 @@
#!/usr/bin/python3
#!/usr/bin/python
import sys
#from mido import MidiFile

View File

@ -12,23 +12,6 @@ char[64] path, wildname
res[t_fileinfo] fileinfo
res[t_fileentry] fileentry
//
// Convert byte to two hex chars
//
def putb(b)#0
char h
h = ((b >> 4) & $0F) + '0'
if h > '9'
h = h + 7
fin
putc(h)
h = (b & $0F) + '0'
if h > '9'
h = h + 7
fin
putc(h)
end
//
// Copy string with upper case conversion
//
def struprcpy(dst, src)#0
@ -46,17 +29,6 @@ def struprcpy(dst, src)#0
fin
^dst = ^src
end
def filefrompath(filestr, pathstr)#0
byte i
for i = ^pathstr downto 1
if pathstr->[i] == '/'
break
fin
next
^filestr = ^pathstr - i
memcpy(filestr + 1, pathstr + 1 + i, ^filestr)
end
//
// Print out a directory entry
//

View File

@ -67,17 +67,6 @@ def pathdiff(path1, path2)#1
next
return FALSE
end
def filefrompath(filestr, pathstr)#0
byte i
for i = ^pathstr + 1 downto 1
if pathstr->[i] == '/'
break
fin
next
^filestr = ^pathstr - i
memcpy(filestr + 1, pathstr + 1 + i, ^filestr)
end
//
// Check destination path
//
@ -115,7 +104,7 @@ def copyfiles(srcfile, dstfile)#0
strcpy(@srcpath, srcfile)
wildname = 0
if fileio:getfileinfo(@srcpath, @srcfileinfo) <> FILE_ERR_OK or (srcfileinfo.storage_type & $0D <> $0D)
filefrompath(@wildname, @srcpath)
fileFromPath(@wildname, @srcpath)
srcpath = srcpath - wildname
fin
entrylist, entrycnt = matchList(@srcpath, @wildname)

View File

@ -25,17 +25,6 @@ def struprcpy(dst, src)#0
fin
^dst = ^src
end
def filefrompath(filestr, pathstr)#0
byte i
for i = ^pathstr downto 1
if pathstr->[i] == '/'
break
fin
next
^filestr = ^pathstr - i
memcpy(filestr + 1, pathstr + 1 + i, ^filestr)
end
//
// Check filename
//
@ -81,9 +70,8 @@ def delfiles(delfile)#0
strcpy(@delpath, delfile)
wildname = 0
//if fileio:getfileinfo(@delpath, @fileinfo) <> FILE_ERR_OK or fileinfo.file_type <> $0F
if delpath[delpath] <> '/'
filefrompath(@wildname, @delpath)
fileFromPath(@wildname, @delpath)
delpath = delpath - wildname
fin
//

View File

@ -8,20 +8,20 @@ var arg, type, aux
//
// Convert byte to two hex chars
//
def putb(b)#0
char h
h = ((b >> 4) & $0F) + '0'
if h > '9'
h = h + 7
fin
putc(h)
h = (b & $0F) + '0'
if h > '9'
h = h + 7
fin
putc(h)
end
//def putb(b)#0
// char h
//
// h = ((b >> 4) & $0F) + '0'
// if h > '9'
// h = h + 7
// fin
// putc(h)
// h = (b & $0F) + '0'
// if h > '9'
// h = h + 7
// fin
// putc(h)
//end
def htoi(hexptr)
var val, i, n