wok-current view w3m/stuff/file_handle.patch @ rev 22481
updated ansible (1.5.3 -> 2.9.2)
author | Hans-G?nter Theisgen |
---|---|
date | Mon Dec 30 14:41:15 2019 +0100 (2019-12-30) |
parents | |
children |
line source
1 diff -Naur old/istream.c new/istream.c
2 --- istream.c 2011-01-04 20:22:22.000000000 +1100
3 +++ istream.c 2012-07-04 21:50:51.529661517 +1000
4 @@ -22,8 +22,8 @@
5 static void basic_close(int *handle);
6 static int basic_read(int *handle, char *buf, int len);
8 -static void file_close(struct file_handle *handle);
9 -static int file_read(struct file_handle *handle, char *buf, int len);
10 +static void file_close(struct file_handle_rofl *handle);
11 +static int file_read(struct file_handle_rofl *handle, char *buf, int len);
13 static int str_read(Str handle, char *buf, int len);
15 @@ -114,7 +114,7 @@
16 stream = New(union input_stream);
17 init_base_stream(&stream->base, STREAM_BUF_SIZE);
18 stream->file.type = IST_FILE;
19 - stream->file.handle = New(struct file_handle);
20 + stream->file.handle = New(struct file_handle_rofl);
21 stream->file.handle->f = f;
22 if (closep)
23 stream->file.handle->close = closep;
24 @@ -658,13 +658,13 @@
25 }
27 static void
28 -file_close(struct file_handle *handle)
29 +file_close(struct file_handle_rofl *handle)
30 {
31 handle->close(handle->f);
32 }
34 static int
35 -file_read(struct file_handle *handle, char *buf, int len)
36 +file_read(struct file_handle_rofl *handle, char *buf, int len)
37 {
38 return fread(buf, 1, len, handle->f);
39 }
40 diff -Naur old/istream.h new/istream.h
41 --- istream.h 2003-10-21 02:41:56.000000000 +1000
42 +++ istream.h 2012-07-04 21:50:51.529661517 +1000
43 @@ -20,7 +20,7 @@
45 typedef struct stream_buffer *StreamBuffer;
47 -struct file_handle {
48 +struct file_handle_rofl {
49 FILE *f;
50 void (*close) ();
51 };
52 @@ -53,7 +53,7 @@
54 struct file_stream {
55 struct stream_buffer stream;
56 - struct file_handle *handle;
57 + struct file_handle_rofl *handle;
58 char type;
59 char iseos;
60 int (*read) ();