mirror of
https://github.com/weiju/amiga-stuff
synced 2025-11-19 16:01:31 +00:00
dalf: read_string_list() now based on read_string()
This commit is contained in:
@ -47,15 +47,6 @@ def read_int16(infile):
|
|||||||
def read_uint16(infile):
|
def read_uint16(infile):
|
||||||
return struct.unpack('>H', infile.read(2))[0]
|
return struct.unpack('>H', infile.read(2))[0]
|
||||||
|
|
||||||
def read_string_list(infile):
|
|
||||||
result = []
|
|
||||||
strlen = read_int32(infile)
|
|
||||||
while strlen > 0:
|
|
||||||
result.append(str(infile.read(strlen)))
|
|
||||||
strlen = read_int32(infile)
|
|
||||||
|
|
||||||
return []
|
|
||||||
|
|
||||||
|
|
||||||
def read_string(infile):
|
def read_string(infile):
|
||||||
result = None
|
result = None
|
||||||
@ -67,6 +58,15 @@ def read_string(infile):
|
|||||||
return result[:idx]
|
return result[:idx]
|
||||||
|
|
||||||
|
|
||||||
|
def read_string_list(infile):
|
||||||
|
result = []
|
||||||
|
s = read_string(infile)
|
||||||
|
while s is not None:
|
||||||
|
result.append(s)
|
||||||
|
s = read_string(infile)
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
def read_symbols(infile):
|
def read_symbols(infile):
|
||||||
result = []
|
result = []
|
||||||
symbol = read_string(infile)
|
symbol = read_string(infile)
|
||||||
|
|||||||
Reference in New Issue
Block a user