summaryrefslogtreecommitdiff
path: root/net/luasocket/files/patch-fnames
blob: 82d7bab9881c942205a00cdee9b65ef082169292 (plain) (blame)
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
--- src/buffer.c.orig	2014-02-11 11:38:27.000000000 -0800
+++ src/buffer.c	2014-02-11 11:42:32.000000000 -0800
@@ -31,7 +31,7 @@
 /*-------------------------------------------------------------------------*\
 * Initializes module
 \*-------------------------------------------------------------------------*/
-int buffer_open(lua_State *L) {
+int ls_buffer_open(lua_State *L) {
     (void) L;
     return 0;
 }
@@ -39,7 +39,7 @@
 /*-------------------------------------------------------------------------*\
 * Initializes C structure 
 \*-------------------------------------------------------------------------*/
-void buffer_init(p_buffer buf, p_io io, p_timeout tm) {
+void ls_buffer_init(p_buffer buf, p_io io, p_timeout tm) {
     buf->first = buf->last = 0;
     buf->io = io;
     buf->tm = tm;
@@ -50,7 +50,7 @@
 /*-------------------------------------------------------------------------*\
 * object:getstats() interface
 \*-------------------------------------------------------------------------*/
-int buffer_meth_getstats(lua_State *L, p_buffer buf) {
+int ls_buffer_meth_getstats(lua_State *L, p_buffer buf) {
     lua_pushnumber(L, (lua_Number) buf->received);
     lua_pushnumber(L, (lua_Number) buf->sent);
     lua_pushnumber(L, timeout_gettime() - buf->birthday);
@@ -60,7 +60,7 @@
 /*-------------------------------------------------------------------------*\
 * object:setstats() interface
 \*-------------------------------------------------------------------------*/
-int buffer_meth_setstats(lua_State *L, p_buffer buf) {
+int ls_buffer_meth_setstats(lua_State *L, p_buffer buf) {
     buf->received = (long) luaL_optnumber(L, 2, (lua_Number) buf->received); 
     buf->sent = (long) luaL_optnumber(L, 3, (lua_Number) buf->sent); 
     if (lua_isnumber(L, 4)) buf->birthday = timeout_gettime() - lua_tonumber(L, 4);
@@ -71,7 +71,7 @@
 /*-------------------------------------------------------------------------*\
 * object:send() interface
 \*-------------------------------------------------------------------------*/
-int buffer_meth_send(lua_State *L, p_buffer buf) {
+int ls_buffer_meth_send(lua_State *L, p_buffer buf) {
     int top = lua_gettop(L);
     int err = IO_DONE;
     size_t size = 0, sent = 0;
@@ -106,7 +106,7 @@
 /*-------------------------------------------------------------------------*\
 * object:receive() interface
 \*-------------------------------------------------------------------------*/
-int buffer_meth_receive(lua_State *L, p_buffer buf) {
+int ls_buffer_meth_receive(lua_State *L, p_buffer buf) {
     int err = IO_DONE, top = lua_gettop(L);
     luaL_Buffer b;
     size_t size;
@@ -157,7 +157,7 @@
 /*-------------------------------------------------------------------------*\
 * Determines if there is any data in the read buffer
 \*-------------------------------------------------------------------------*/
-int buffer_isempty(p_buffer buf) {
+int ls_buffer_isempty(p_buffer buf) {
     return buf->first >= buf->last;
 }
 
@@ -252,7 +252,7 @@
 static void buffer_skip(p_buffer buf, size_t count) {
     buf->received += count;
     buf->first += count;
-    if (buffer_isempty(buf)) 
+    if (ls_buffer_isempty(buf)) 
         buf->first = buf->last = 0;
 }
 
@@ -264,7 +264,7 @@
     int err = IO_DONE;
     p_io io = buf->io;
     p_timeout tm = buf->tm;
-    if (buffer_isempty(buf)) {
+    if (ls_buffer_isempty(buf)) {
         size_t got;
         err = io->recv(io->ctx, buf->data, BUF_SIZE, &got, tm);
         buf->first = 0;
--- src/buffer.h.orig	2014-02-11 11:43:12.000000000 -0800
+++ src/buffer.h	2014-02-11 11:43:46.000000000 -0800
@@ -34,12 +34,12 @@
 } t_buffer;
 typedef t_buffer *p_buffer;
 
-int buffer_open(lua_State *L);
-void buffer_init(p_buffer buf, p_io io, p_timeout tm);
-int buffer_meth_send(lua_State *L, p_buffer buf);
-int buffer_meth_receive(lua_State *L, p_buffer buf);
-int buffer_meth_getstats(lua_State *L, p_buffer buf);
-int buffer_meth_setstats(lua_State *L, p_buffer buf);
-int buffer_isempty(p_buffer buf);
+int ls_buffer_open(lua_State *L);
+void ls_buffer_init(p_buffer buf, p_io io, p_timeout tm);
+int ls_buffer_meth_send(lua_State *L, p_buffer buf);
+int ls_buffer_meth_receive(lua_State *L, p_buffer buf);
+int ls_buffer_meth_getstats(lua_State *L, p_buffer buf);
+int ls_buffer_meth_setstats(lua_State *L, p_buffer buf);
+int ls_buffer_isempty(p_buffer buf);
 
 #endif /* BUF_H */
--- src/luasocket.c.orig	2014-02-11 11:44:11.000000000 -0800
+++ src/luasocket.c	2014-02-11 11:44:37.000000000 -0800
@@ -46,7 +46,7 @@
     {"auxiliar", auxiliar_open},
     {"except", except_open},
     {"timeout", timeout_open},
-    {"buffer", buffer_open},
+    {"buffer", ls_buffer_open},
     {"inet", inet_open},
     {"tcp", tcp_open},
     {"udp", udp_open},
--- src/tcp.c.orig	2014-02-11 11:45:12.000000000 -0800
+++ src/tcp.c	2014-02-11 11:46:27.000000000 -0800
@@ -124,22 +124,22 @@
 \*-------------------------------------------------------------------------*/
 static int meth_send(lua_State *L) {
     p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1);
-    return buffer_meth_send(L, &tcp->buf);
+    return ls_buffer_meth_send(L, &tcp->buf);
 }
 
 static int meth_receive(lua_State *L) {
     p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1);
-    return buffer_meth_receive(L, &tcp->buf);
+    return ls_buffer_meth_receive(L, &tcp->buf);
 }
 
 static int meth_getstats(lua_State *L) {
     p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1);
-    return buffer_meth_getstats(L, &tcp->buf);
+    return ls_buffer_meth_getstats(L, &tcp->buf);
 }
 
 static int meth_setstats(lua_State *L) {
     p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1);
-    return buffer_meth_setstats(L, &tcp->buf);
+    return ls_buffer_meth_setstats(L, &tcp->buf);
 }
 
 /*-------------------------------------------------------------------------*\
@@ -178,7 +178,7 @@
 static int meth_dirty(lua_State *L)
 {
     p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1);
-    lua_pushboolean(L, !buffer_isempty(&tcp->buf));
+    lua_pushboolean(L, !ls_buffer_isempty(&tcp->buf));
     return 1;
 }
 
@@ -203,7 +203,7 @@
         io_init(&clnt->io, (p_send) socket_send, (p_recv) socket_recv,
                 (p_error) socket_ioerror, &clnt->sock);
         timeout_init(&clnt->tm, -1, -1);
-        buffer_init(&clnt->buf, &clnt->io, &clnt->tm);
+        ls_buffer_init(&clnt->buf, &clnt->io, &clnt->tm);
         clnt->family = server->family;
         return 1;
     } else {
@@ -375,7 +375,7 @@
         io_init(&tcp->io, (p_send) socket_send, (p_recv) socket_recv,
                 (p_error) socket_ioerror, &tcp->sock);
         timeout_init(&tcp->tm, -1, -1);
-        buffer_init(&tcp->buf, &tcp->io, &tcp->tm);
+        ls_buffer_init(&tcp->buf, &tcp->io, &tcp->tm);
         tcp->family = family;
         return 1;
     } else {
@@ -454,7 +454,7 @@
     io_init(&tcp->io, (p_send) socket_send, (p_recv) socket_recv,
             (p_error) socket_ioerror, &tcp->sock);
     timeout_init(&tcp->tm, -1, -1);
-    buffer_init(&tcp->buf, &tcp->io, &tcp->tm);
+    ls_buffer_init(&tcp->buf, &tcp->io, &tcp->tm);
     tcp->sock = SOCKET_INVALID;
     tcp->family = PF_UNSPEC;
     /* allow user to pick local address and port */
--- src/unix.c.orig	2014-02-11 11:46:51.000000000 -0800
+++ src/unix.c	2014-02-11 11:47:38.000000000 -0800
@@ -109,22 +109,22 @@
 \*-------------------------------------------------------------------------*/
 static int meth_send(lua_State *L) {
     p_unix un = (p_unix) auxiliar_checkclass(L, "unix{client}", 1);
-    return buffer_meth_send(L, &un->buf);
+    return ls_buffer_meth_send(L, &un->buf);
 }
 
 static int meth_receive(lua_State *L) {
     p_unix un = (p_unix) auxiliar_checkclass(L, "unix{client}", 1);
-    return buffer_meth_receive(L, &un->buf);
+    return ls_buffer_meth_receive(L, &un->buf);
 }
 
 static int meth_getstats(lua_State *L) {
     p_unix un = (p_unix) auxiliar_checkclass(L, "unix{client}", 1);
-    return buffer_meth_getstats(L, &un->buf);
+    return ls_buffer_meth_getstats(L, &un->buf);
 }
 
 static int meth_setstats(lua_State *L) {
     p_unix un = (p_unix) auxiliar_checkclass(L, "unix{client}", 1);
-    return buffer_meth_setstats(L, &un->buf);
+    return ls_buffer_meth_setstats(L, &un->buf);
 }
 
 /*-------------------------------------------------------------------------*\
@@ -153,7 +153,7 @@
 
 static int meth_dirty(lua_State *L) {
     p_unix un = (p_unix) auxiliar_checkgroup(L, "unix{any}", 1);
-    lua_pushboolean(L, !buffer_isempty(&un->buf));
+    lua_pushboolean(L, !ls_buffer_isempty(&un->buf));
     return 1;
 }
 
@@ -176,7 +176,7 @@
         io_init(&clnt->io, (p_send)socket_send, (p_recv)socket_recv, 
                 (p_error) socket_ioerror, &clnt->sock);
         timeout_init(&clnt->tm, -1, -1);
-        buffer_init(&clnt->buf, &clnt->io, &clnt->tm);
+        ls_buffer_init(&clnt->buf, &clnt->io, &clnt->tm);
         return 1;
     } else {
         lua_pushnil(L); 
@@ -336,7 +336,7 @@
         io_init(&un->io, (p_send) socket_send, (p_recv) socket_recv, 
                 (p_error) socket_ioerror, &un->sock);
         timeout_init(&un->tm, -1, -1);
-        buffer_init(&un->buf, &un->io, &un->tm);
+        ls_buffer_init(&un->buf, &un->io, &un->tm);
         return 1;
     } else {
         lua_pushnil(L);
--- src/serial.c.orig	2014-02-11 11:53:16.000000000 -0800
+++ src/serial.c	2014-02-11 11:54:45.000000000 -0800
@@ -90,22 +90,22 @@
 \*-------------------------------------------------------------------------*/
 static int meth_send(lua_State *L) {
     p_unix un = (p_unix) auxiliar_checkclass(L, "serial{client}", 1);
-    return buffer_meth_send(L, &un->buf);
+    return ls_buffer_meth_send(L, &un->buf);
 }
 
 static int meth_receive(lua_State *L) {
     p_unix un = (p_unix) auxiliar_checkclass(L, "serial{client}", 1);
-    return buffer_meth_receive(L, &un->buf);
+    return ls_buffer_meth_receive(L, &un->buf);
 }
 
 static int meth_getstats(lua_State *L) {
     p_unix un = (p_unix) auxiliar_checkclass(L, "serial{client}", 1);
-    return buffer_meth_getstats(L, &un->buf);
+    return ls_buffer_meth_getstats(L, &un->buf);
 }
 
 static int meth_setstats(lua_State *L) {
     p_unix un = (p_unix) auxiliar_checkclass(L, "serial{client}", 1);
-    return buffer_meth_setstats(L, &un->buf);
+    return ls_buffer_meth_setstats(L, &un->buf);
 }
 
 /*-------------------------------------------------------------------------*\
@@ -126,7 +126,7 @@
 
 static int meth_dirty(lua_State *L) {
     p_unix un = (p_unix) auxiliar_checkgroup(L, "serial{any}", 1);
-    lua_pushboolean(L, !buffer_isempty(&un->buf));
+    lua_pushboolean(L, !ls_buffer_isempty(&un->buf));
     return 1;
 }
 
@@ -183,6 +183,6 @@
     io_init(&un->io, (p_send) socket_write, (p_recv) socket_read, 
             (p_error) socket_ioerror, &un->sock);
     timeout_init(&un->tm, -1, -1);
-    buffer_init(&un->buf, &un->io, &un->tm);
+    ls_buffer_init(&un->buf, &un->io, &un->tm);
     return 1;
 }