Empty -> Unsupported

This commit is contained in:
gingerBill
2025-11-14 11:17:38 +00:00
parent 51536fecf4
commit e4fcebe4bf
17 changed files with 23 additions and 23 deletions

View File

@@ -38,5 +38,5 @@ _read_writer_procedure := proc(stream_data: rawptr, mode: io.Stream_Mode, p: []b
case .Query:
return io.query_utility({.Flush, .Read, .Write, .Query})
}
return 0, .Empty
return 0, .Unsupported
}

View File

@@ -347,7 +347,7 @@ _reader_proc :: proc(stream_data: rawptr, mode: io.Stream_Mode, p: []byte, offse
case .Query:
return io.query_utility({.Read, .Destroy, .Query})
}
return 0, .Empty
return 0, .Unsupported
}
//

View File

@@ -249,5 +249,5 @@ _writer_proc :: proc(stream_data: rawptr, mode: io.Stream_Mode, p: []byte, offse
case .Query:
return io.query_utility({.Flush, .Write, .Destroy, .Query})
}
return 0, .Empty
return 0, .Unsupported
}

View File

@@ -434,5 +434,5 @@ _buffer_proc :: proc(stream_data: rawptr, mode: io.Stream_Mode, p: []byte, offse
case .Query:
return io.query_utility({.Read, .Read_At, .Write, .Write_At, .Seek, .Size, .Destroy, .Query})
}
return 0, .Empty
return 0, .Unsupported
}

View File

@@ -160,6 +160,6 @@ _reader_proc :: proc(stream_data: rawptr, mode: io.Stream_Mode, p: []byte, offse
case .Query:
return io.query_utility({.Read, .Read_At, .Seek, .Size, .Query})
}
return 0, .Empty
return 0, .Unsupported
}

View File

@@ -390,7 +390,7 @@ to_stream :: proc(file: ^FILE) -> io.Stream {
}
case .Destroy:
return 0, .Empty
return 0, .Unsupported
case .Query:
return io.query_utility({ .Close, .Flush, .Read, .Read_At, .Write, .Write_At, .Seek, .Size, .Query })

View File

@@ -297,7 +297,7 @@ peek_data_from_stream :: #force_inline proc(z: ^Context_Stream_Input, $T: typeid
curr := z.input->impl_seek(0, .Current) or_return
r, e1 := io.to_reader_at(z.input)
if !e1 {
return T{}, .Empty
return T{}, .Unsupported
}
when size <= 128 {
b: [size]u8
@@ -306,7 +306,7 @@ peek_data_from_stream :: #force_inline proc(z: ^Context_Stream_Input, $T: typeid
}
_, e2 := io.read_at(r, b[:], curr)
if e2 != .None {
return T{}, .Empty
return T{}, .Unsupported
}
res = (^T)(&b[0])^
@@ -324,7 +324,7 @@ peek_data_at_offset_from_stream :: #force_inline proc(z: ^Context_Stream_Input,
r, e3 := io.to_reader_at(z.input)
if !e3 {
return T{}, .Empty
return T{}, .Unsupported
}
when size <= 128 {
b: [size]u8
@@ -333,7 +333,7 @@ peek_data_at_offset_from_stream :: #force_inline proc(z: ^Context_Stream_Input,
}
_, e4 := io.read_at(r, b[:], pos)
if e4 != .None {
return T{}, .Empty
return T{}, .Unsupported
}
// Return read head to original position.

View File

@@ -19,7 +19,7 @@ write_stream_proc :: proc(stream_data: rawptr, mode: io.Stream_Mode, p: []byte,
write(fd, p)
return i64(len(p)), nil
}
return 0, .Empty
return 0, .Unsupported
}
@(private="file")

View File

@@ -8,7 +8,7 @@ _multi_reader_proc :: proc(stream_data: rawptr, mode: Stream_Mode, p: []byte, of
if mode == .Query {
return query_utility({.Read, .Query})
} else if mode != .Read {
return 0, .Empty
return 0, .Unsupported
}
mr := (^Multi_Reader)(stream_data)
for len(mr.readers) > 0 {
@@ -61,7 +61,7 @@ _multi_writer_proc :: proc(stream_data: rawptr, mode: Stream_Mode, p: []byte, of
if mode == .Query {
return query_utility({.Write, .Query})
} else if mode != .Write {
return 0, .Empty
return 0, .Unsupported
}
mw := (^Multi_Writer)(stream_data)
for w in mw.writers {

View File

@@ -354,7 +354,7 @@ _tee_reader_proc :: proc(stream_data: rawptr, mode: Stream_Mode, p: []byte, offs
case .Query:
return query_utility({.Read, .Query})
}
return 0, .Empty
return 0, .Unsupported
}
// tee_reader_init returns a Reader that writes to 'w' what it reads from 'r'
@@ -404,7 +404,7 @@ _limited_reader_proc :: proc(stream_data: rawptr, mode: Stream_Mode, p: []byte,
case .Query:
return query_utility({.Read, .Query})
}
return 0, .Empty
return 0, .Unsupported
}
limited_reader_init :: proc(l: ^Limited_Reader, r: Reader, n: i64) -> Reader {

View File

@@ -515,7 +515,7 @@ _file_stream_proc :: proc(stream_data: rawptr, mode: io.Stream_Mode, p: []byte,
case .Query:
return io.query_utility({.Read, .Read_At, .Write, .Write_At, .Seek, .Size, .Flush, .Close, .Destroy, .Query})
}
return 0, .Empty
return 0, .Unsupported
}
@@ -559,6 +559,6 @@ _file_stream_buffered_proc :: proc(stream_data: rawptr, mode: io.Stream_Mode, p:
case .Query:
return io.query_utility({.Read, .Read_At, .Write, .Write_At, .Seek, .Size, .Flush, .Close, .Destroy, .Query})
}
return 0, .Empty
return 0, .Unsupported
}

View File

@@ -502,6 +502,6 @@ _file_stream_proc :: proc(stream_data: rawptr, mode: io.Stream_Mode, p: []byte,
return io.query_utility({.Read, .Read_At, .Write, .Write_At, .Seek, .Size, .Flush, .Close, .Destroy, .Query})
case:
return 0, .Empty
return 0, .Unsupported
}
}

View File

@@ -557,6 +557,6 @@ _file_stream_proc :: proc(stream_data: rawptr, mode: io.Stream_Mode, p: []byte,
return io.query_utility({.Read, .Read_At, .Write, .Write_At, .Seek, .Size, .Flush, .Close, .Destroy, .Query})
case:
return 0, .Empty
return 0, .Unsupported
}
}

View File

@@ -866,7 +866,7 @@ _file_stream_proc :: proc(stream_data: rawptr, mode: io.Stream_Mode, p: []byte,
case .Query:
return io.query_utility({.Read, .Read_At, .Write, .Write_At, .Seek, .Size, .Flush, .Close, .Destroy, .Query})
}
return 0, .Empty
return 0, .Unsupported
}

View File

@@ -62,7 +62,7 @@ _file_stream_proc :: proc(stream_data: rawptr, mode: io.Stream_Mode, p: []byte,
case .Size:
n, os_err = file_size(fd)
case .Destroy:
err = .Empty
err = .Unsupported
case .Query:
return io.query_utility({.Close, .Flush, .Read, .Read_At, .Write, .Write_At, .Seek, .Size, .Query})
}

View File

@@ -182,7 +182,7 @@ _builder_stream_proc :: proc(stream_data: rawptr, mode: io.Stream_Mode, p: []byt
case .Query:
return io.query_utility({.Write, .Size, .Destroy, .Query})
}
return 0, .Empty
return 0, .Unsupported
}
/*

View File

@@ -310,5 +310,5 @@ _reader_proc :: proc(stream_data: rawptr, mode: io.Stream_Mode, p: []byte, offse
case .Query:
return io.query_utility({.Size, .Read, .Read_At, .Seek, .Query})
}
return 0, .Empty
return 0, .Unsupported
}