📄 io.c
字号:
#ifndef lint#ifdef sccsstatic char sccsid[] = "@(#)io.c 1.1 92/07/30 Copyr 1985 Sun Micro";#endif#endif/* * Copyright (c) 1985 by Sun Microsystems, Inc. */#include <sunwindow/io_stream.h>/* GENERIC FUNCTIONS THAT APPLY TO BOTH INPUT AND OUTPUT */voidstream_close(stream) STREAM *stream;{ switch (stream->stream_type) { case Input: { struct input_ops_vector *ops = stream->ops.input_ops; (*(ops->close)) (stream); goto out; } case Output: { struct output_ops_vector *ops = stream->ops.output_ops; (*(ops->close)) (stream); goto out; } default: exit(1); }out: free((char *) stream); /* client should have freed the client data */}struct posrecstream_get_pos(stream) STREAM *stream;{ switch (stream->stream_type) { case Input: { struct input_ops_vector *ops = stream->ops.input_ops; return (*ops->get_pos) (stream); } case Output: { struct output_ops_vector *ops = stream->ops.output_ops; return (*ops->get_pos) (stream); } default: exit(1); /* NOTREACHED */ }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -