diff --git a/pkgs/racket-doc/scribblings/inside/values.scrbl b/pkgs/racket-doc/scribblings/inside/values.scrbl index e484fa0f7d..11e9af9c9c 100644 --- a/pkgs/racket-doc/scribblings/inside/values.scrbl +++ b/pkgs/racket-doc/scribblings/inside/values.scrbl @@ -186,13 +186,15 @@ types: extracts/sets the user data pointer; test for just this type with @cppdef{SCHEME_INPORTP}, but use @cppdef{SCHEME_INPUT_PORTP} to recognize all input ports (including structures with the - @racket[prop:input-port] property)} + @racket[prop:input-port] property), and use @cppi{scheme_input_port_record} + to extract a @cppi{scheme_input_port_type} value from a general input port} @item{@cppdef{scheme_output_port_type} --- @cppdef{SCHEME_OUTPORT_VAL} extracts/sets the user data pointer; test for just this type with @cppdef{SCHEME_OUTPORTP}, but use @cppdef{SCHEME_OUTPUT_PORTP} to recognize all output ports (including structures with the - @racket[prop:output-port] property)} + @racket[prop:output-port] property), and use @cppi{scheme_output_port_record} + to extract a @cppi{scheme_output_port_type} value from a general input port} @item{@cppdef{scheme_thread_type} --- thread descriptors; test for this type with @cppdef{SCHEME_THREADP}} diff --git a/racket/src/racket/include/scheme.h b/racket/src/racket/include/scheme.h index 75379d55bd..2182d49a2e 100644 --- a/racket/src/racket/include/scheme.h +++ b/racket/src/racket/include/scheme.h @@ -1543,6 +1543,8 @@ struct Scheme_Input_Port #endif }; +#define SCHEME_INPORT_VAL(i) (((Scheme_Input_Port *)i)->port_data) + struct Scheme_Output_Port { struct Scheme_Port p; @@ -1566,6 +1568,8 @@ struct Scheme_Output_Port struct Scheme_Input_Port *input_half; }; +#define SCHEME_OUTPORT_VAL(o) (((Scheme_Output_Port *)o)->port_data) + #define SCHEME_SPECIAL (-2) #define SCHEME_UNLESS_READY (-3)