mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-28 08:54:35 +00:00
Empty -> Unsupported
This commit is contained in:
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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 })
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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})
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user