Differences From Artifact [6d77e77ea7]:
- File
src/file.c
— part of check-in
[17c1d8f6b0]
at
2012-09-29 22:34:49
on branch trunk
— Add tcpsocket.
TODO:
* check for getaddrinfo() in configure
* fallback if getaddrinfo() is unavailable (user: js, size: 4039) [annotate] [blame] [check-ins using]
To Artifact [6570f4dc53]:
- File src/file.c — part of check-in [999088161e] at 2012-09-29 22:50:49 on branch trunk — Add cfw_std{in,out,err}. (user: js, size: 4621) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
21 22 23 24 25 26 27 28 29 30 31 32 33 34 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #include <string.h> #include <fcntl.h> #include <unistd.h> #include "stream.h" #include "file.h" | > | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #include <string.h> #include <limits.h> #include <fcntl.h> #include <unistd.h> #include "stream.h" #include "file.h" |
︙ | ︙ | |||
167 168 169 170 171 172 173 | static CFWClass class = { .name = "CFWFile", .size = sizeof(CFWFile), .ctor = ctor, .dtor = dtor }; CFWClass *cfw_file = &class; | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | static CFWClass class = { .name = "CFWFile", .size = sizeof(CFWFile), .ctor = ctor, .dtor = dtor }; CFWClass *cfw_file = &class; static CFWFile cfw_stdin_ = { .stream = { .obj = { .cls = &class, .ref_cnt = INT_MAX }, .ops = &stream_ops }, .fd = 0, .eof = false }; static CFWFile cfw_stdout_ = { .stream = { .obj = { .cls = &class, .ref_cnt = INT_MAX }, .ops = &stream_ops }, .fd = 1, .eof = false }; static CFWFile cfw_stderr_ = { .stream = { .obj = { .cls = &class, .ref_cnt = INT_MAX }, .ops = &stream_ops }, .fd = 2, .eof = false }; CFWFile *cfw_stdin = &cfw_stdin_; CFWFile *cfw_stdout = &cfw_stdout_; CFWFile *cfw_stderr = &cfw_stderr_; |