@@ -28,8 +28,8 @@ and `startproc` have a default implementation.
28
28
Your codec type is denoted by `C` and its object by `codec`.
29
29
30
30
Errors that occur in these methods are supposed to be unrecoverable and the
31
- stream will go to the panic state . Only `Base.isopen` and `Base.close` are
32
- available in that state .
31
+ stream will go to the panic mode . Only `Base.isopen` and `Base.close` are
32
+ available in that mode .
33
33
34
34
### `expectedsize`
35
35
@@ -59,20 +59,20 @@ you need to release the memory before throwing an exception.
59
59
60
60
The `finalize(codec::C)::Void` method takes `codec` and returns `nothing`. This
61
61
is called once and only only once just before the transcoding stream goes to the
62
- close state (i.e. when `Base.close` is called) or just after `startproc` or
62
+ close mode (i.e. when `Base.close` is called) or just after `startproc` or
63
63
`process` throws an exception. Other errors that happen inside the stream (e.g.
64
64
`EOFError`) will not call this method. Therefore, you may finalize `codec` (e.g.
65
65
freeing memory) with this method. If finalization fails for some reason, it may
66
66
throw an exception. You should release the allocated memory in codec before
67
67
returning or throwing an exception in `finalize` because otherwise nobody cannot
68
68
release the memory. Even when an exception is thrown while finalizing a stream,
69
- the stream will become the close state for safety.
69
+ the stream will become the close mode for safety.
70
70
71
71
### `startproc`
72
72
73
- The `startproc(codec::C, state ::Symbol, error::Error)::Symbol` method takes
74
- `codec`, `state ` and `error`, and returns a status code. This is called just
75
- before the stream starts reading or writing data. `state ` is either `:read` or
73
+ The `startproc(codec::C, mode ::Symbol, error::Error)::Symbol` method takes
74
+ `codec`, `mode ` and `error`, and returns a status code. This is called just
75
+ before the stream starts reading or writing data. `mode ` is either `:read` or
76
76
`:write` and then the stream starts reading or writing, respectively. The
77
77
return code must be `:ok` if `codec` is ready to read or write data. Otherwise,
78
78
it must be `:error` and the `error` argument must be set to an exception object.
@@ -146,13 +146,13 @@ function finalize(codec::Codec)::Void
146
146
end
147
147
148
148
"""
149
- startproc(codec::Codec, state ::Symbol, error::Error)::Symbol
149
+ startproc(codec::Codec, mode ::Symbol, error::Error)::Symbol
150
150
151
- Start data processing with `codec` of `state `.
151
+ Start data processing with `codec` of `mode `.
152
152
153
153
The default method does nothing and returns `:ok`.
154
154
"""
155
- function startproc (codec:: Codec , state :: Symbol , error:: Error ):: Symbol
155
+ function startproc (codec:: Codec , mode :: Symbol , error:: Error ):: Symbol
156
156
return :ok
157
157
end
158
158
0 commit comments