updated on Tue Jan 17 16:10:12 UTC 2012
[aur-mirror.git] / monotone / rcs_file.cc.patch
bloba5c635e95e1a6bdd2d8eb3be8a089cef1680b556
1 --- src/rcs_file.cc.orig 2011-03-26 02:41:01.000000000 -0400
2 +++ src/rcs_file.cc 2011-07-06 02:32:22.430729595 -0400
3 @@ -42,12 +42,12 @@
5 #ifdef HAVE_MMAP
6 struct
7 -file_handle
8 +rcs_file_handle
10 string const & filename;
11 off_t length;
12 int fd;
13 - file_handle(string const & fn) :
14 + rcs_file_handle(string const & fn) :
15 filename(fn),
16 length(0),
17 fd(-1)
18 @@ -60,13 +60,13 @@
19 if (fd == -1)
20 throw oops("open of " + filename + " failed");
22 - ~file_handle()
23 + ~rcs_file_handle()
25 if (close(fd) == -1)
26 throw oops("close of " + filename + " failed");
29 -struct file_source
30 +struct rcs_file_source
32 string const & filename;
33 int fd;
34 @@ -91,7 +91,7 @@
35 ++pos;
36 return good();
38 - file_source(string const & fn,
39 + rcs_file_source(string const & fn,
40 int f,
41 off_t len) :
42 filename(fn),
43 @@ -104,7 +104,7 @@
44 if (mapping == MAP_FAILED)
45 throw oops("mmap of " + filename + " failed");
47 - ~file_source()
48 + ~rcs_file_source()
50 if (munmap(mapping, length) == -1)
51 throw oops("munmapping " + filename + " failed, after reading RCS file");
52 @@ -112,12 +112,12 @@
54 #elif defined(WIN32)
55 struct
56 -file_handle
57 +rcs_file_handle
59 string const & filename;
60 off_t length;
61 HANDLE fd;
62 - file_handle(string const & fn) :
63 + rcs_file_handle(string const & fn) :
64 filename(fn),
65 length(0),
66 fd(NULL)
67 @@ -134,7 +134,7 @@
68 if (fd == NULL)
69 throw oops("open of " + filename + " failed");
71 - ~file_handle()
72 + ~rcs_file_handle()
74 if (CloseHandle(fd)==0)
75 throw oops("close of " + filename + " failed");
76 @@ -142,7 +142,7 @@
79 struct
80 -file_source
81 +rcs_file_source
83 string const & filename;
84 HANDLE fd,map;
85 @@ -167,7 +167,7 @@
86 ++pos;
87 return good();
89 - file_source(string const & fn,
90 + rcs_file_source(string const & fn,
91 HANDLE f,
92 off_t len) :
93 filename(fn),
94 @@ -183,7 +183,7 @@
95 if (mapping==NULL)
96 throw oops("MapViewOfFile of " + filename + " failed");
98 - ~file_source()
99 + ~rcs_file_source()
101 if (UnmapViewOfFile(mapping)==0)
102 throw oops("UnmapViewOfFile of " + filename + " failed");
103 @@ -193,7 +193,7 @@
105 #else
106 // no mmap at all
107 -typedef istream file_source;
108 +typedef istream rcs_file_source;
109 #endif
111 typedef enum
112 @@ -220,7 +220,7 @@
115 static token_type
116 -get_token(file_source & ist,
117 +get_token(rcs_file_source & ist,
118 string & str,
119 size_t & line,
120 size_t & col)
121 @@ -303,14 +303,14 @@
123 struct parser
125 - file_source & ist;
126 + rcs_file_source & ist;
127 rcs_file & r;
128 string token;
129 token_type ttype;
131 size_t line, col;
133 - parser(file_source & s,
134 + parser(rcs_file_source & s,
135 rcs_file & r)
136 : ist(s), r(r), line(1), col(1)
138 @@ -489,8 +489,8 @@
139 parse_rcs_file(string const & filename, rcs_file & r)
141 #if defined(HAVE_MMAP) || defined(WIN32)
142 - file_handle handle(filename);
143 - file_source ifs(filename, handle.fd, handle.length);
144 + rcs_file_handle handle(filename);
145 + rcs_file_source ifs(filename, handle.fd, handle.length);
146 #else
147 ifstream ifs(filename.c_str());
148 ifs.unsetf(ios_base::skipws);