aboutsummaryrefslogtreecommitdiffstats
path: root/testing/w3m/file_handle.patch
blob: 15422294f979c62939e6aa99f71c3b758a5df6ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
diff -Naur old/istream.c new/istream.c
--- old/istream.c	2011-01-04 20:22:22.000000000 +1100
+++ new/istream.c	2012-07-04 21:50:51.529661517 +1000
@@ -22,8 +22,8 @@
 static void basic_close(int *handle);
 static int basic_read(int *handle, char *buf, int len);
 
-static void file_close(struct file_handle *handle);
-static int file_read(struct file_handle *handle, char *buf, int len);
+static void file_close(struct file_handle_rofl *handle);
+static int file_read(struct file_handle_rofl *handle, char *buf, int len);
 
 static int str_read(Str handle, char *buf, int len);
 
@@ -114,7 +114,7 @@
     stream = New(union input_stream);
     init_base_stream(&stream->base, STREAM_BUF_SIZE);
     stream->file.type = IST_FILE;
-    stream->file.handle = New(struct file_handle);
+    stream->file.handle = New(struct file_handle_rofl);
     stream->file.handle->f = f;
     if (closep)
 	stream->file.handle->close = closep;
@@ -658,13 +658,13 @@
 }
 
 static void
-file_close(struct file_handle *handle)
+file_close(struct file_handle_rofl *handle)
 {
     handle->close(handle->f);
 }
 
 static int
-file_read(struct file_handle *handle, char *buf, int len)
+file_read(struct file_handle_rofl *handle, char *buf, int len)
 {
     return fread(buf, 1, len, handle->f);
 }
diff -Naur old/istream.h new/istream.h
--- old/istream.h	2003-10-21 02:41:56.000000000 +1000
+++ new/istream.h	2012-07-04 21:50:51.529661517 +1000
@@ -20,7 +20,7 @@
 
 typedef struct stream_buffer *StreamBuffer;
 
-struct file_handle {
+struct file_handle_rofl {
     FILE *f;
     void (*close) ();
 };
@@ -53,7 +53,7 @@
 
 struct file_stream {
     struct stream_buffer stream;
-    struct file_handle *handle;
+    struct file_handle_rofl *handle;
     char type;
     char iseos;
     int (*read) ();