aboutsummaryrefslogtreecommitdiffstats
path: root/openobex-apps/openobex-apps-1.0.0/gcc34.patch
blob: 6dac1725b6b1c46cb3633ba8a2c2a2b6a0c5b062 (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
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
diff -Naur openobex-apps-1.0.0-clean/src/obex_put_common.c openobex-apps-1.0.0/src/obex_put_common.c
--- openobex-apps-1.0.0-clean/src/obex_put_common.c	2002-12-01 18:34:41.000000000 +0100
+++ openobex-apps-1.0.0/src/obex_put_common.c	2004-05-12 12:57:37.000000000 +0200
@@ -82,7 +82,7 @@
 			break;
 		
 		default:
-			printf(__FUNCTION__ "() Skipped header %02x\n", hi);
+			printf("%s() Skipped header %02x\n", __func__,  hi);
 		}
 	}
 	if(!body)	{
@@ -123,7 +123,7 @@
 		OBEX_ObjectSetRsp(object, OBEX_RSP_SUCCESS, OBEX_RSP_SUCCESS);
 		break;
 	default:
-		printf(__FUNCTION__ "() Denied %02x request\n", cmd);
+		printf("%s() Denied %02x request\n", __func__,  cmd);
 		OBEX_ObjectSetRsp(object, OBEX_RSP_NOT_IMPLEMENTED, OBEX_RSP_NOT_IMPLEMENTED);
 		break;
 	}
diff -Naur openobex-apps-1.0.0-clean/src/obex_test_cable.h openobex-apps-1.0.0/src/obex_test_cable.h
--- openobex-apps-1.0.0-clean/src/obex_test_cable.h	2002-12-01 18:34:41.000000000 +0100
+++ openobex-apps-1.0.0/src/obex_test_cable.h	2004-05-12 13:23:11.000000000 +0200
@@ -1,16 +1,16 @@
 /*********************************************************************
- *                
+ *
  * Filename:      obex_test_cable.h
- * Version:       
- * Description:   
+ * Version:
+ * Description:
  * Status:        Experimental.
  * Author:        Pontus Fuchs <pontus.fuchs@tactel.se>
  * Created at:    Wed Nov 17 22:05:16 1999
  * Modified at:   Sun Aug 13 10:55:20 PM CEST 2000
  * Modified by:   Pontus Fuchs <pontus.fuchs@tactel.se>
- * 
+ *
  *     Copyright (c) 1999, 2000 Pontus Fuchs, All Rights Reserved.
- *      
+ *
  *     This library is free software; you can redistribute it and/or
  *     modify it under the terms of the GNU Lesser General Public
  *     License as published by the Free Software Foundation; either
@@ -23,9 +23,9 @@
  *
  *     You should have received a copy of the GNU Lesser General Public
  *     License along with this library; if not, write to the Free Software
- *     Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
+ *     Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  *     MA  02111-1307  USA
- *     
+ *
  ********************************************************************/
 
 #ifndef OBEX_TEST_CABLE_H
@@ -38,7 +38,7 @@
 #include <openobex/obex.h>
 
 #ifdef CABLE_DEBUG
-#define CDEBUG(args...) printf(__FUNCTION__ "() " args)
+#define CDEBUG(args...) printf("%s() ", __func__, args)
 #else
 #define CDEBUG(args...)
 #endif
diff -Naur openobex-apps-1.0.0-clean/src/obex_test_cable.h~ openobex-apps-1.0.0/src/obex_test_cable.h~
--- openobex-apps-1.0.0-clean/src/obex_test_cable.h~	1970-01-01 01:00:00.000000000 +0100
+++ openobex-apps-1.0.0/src/obex_test_cable.h~	2004-05-12 13:22:48.000000000 +0200
@@ -0,0 +1,66 @@
+/*********************************************************************
+ *
+ * Filename:      obex_test_cable.h
+ * Version:
+ * Description:
+ * Status:        Experimental.
+ * Author:        Pontus Fuchs <pontus.fuchs@tactel.se>
+ * Created at:    Wed Nov 17 22:05:16 1999
+ * Modified at:   Sun Aug 13 10:55:20 PM CEST 2000
+ * Modified by:   Pontus Fuchs <pontus.fuchs@tactel.se>
+ *
+ *     Copyright (c) 1999, 2000 Pontus Fuchs, All Rights Reserved.
+ *
+ *     This library is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU Lesser General Public
+ *     License as published by the Free Software Foundation; either
+ *     version 2 of the License, or (at your option) any later version.
+ *
+ *     This library is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *     Lesser General Public License for more details.
+ *
+ *     You should have received a copy of the GNU Lesser General Public
+ *     License along with this library; if not, write to the Free Software
+ *     Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *     MA  02111-1307  USA
+ *
+ ********************************************************************/
+
+#ifndef OBEX_TEST_CABLE_H
+#define OBEX_TEST_CABLE_H
+
+#define CABLE_DEBUG 1
+
+
+#include <termios.h>
+#include <openobex/obex.h>
+
+#ifdef CABLE_DEBUG
+#define CDEBUG(args...) printf("%s() " __func__, args)
+#else
+#define CDEBUG(args...)
+#endif
+
+struct cobex_context
+{
+	const char *portname;
+	int ttyfd;
+	char inputbuf[500];
+	struct termios oldtio, newtio;
+	int r320;
+};
+
+/* User function */
+struct cobex_context *cobex_open(const char *port, int r320);
+void cobex_close(struct cobex_context *gt);
+int cobex_do_at_cmd(struct cobex_context *gt, char *cmd, char *rspbuf, int rspbuflen, int timeout);
+
+/* Callbacks */
+int cobex_handle_input(obex_t *handle, void * userdata, int timeout);
+int cobex_write(obex_t *self, void * userdata, uint8_t *buffer, int length);
+int cobex_connect(obex_t *handle, void * userdata);
+int cobex_disconnect(obex_t *handle, void * userdata);
+
+#endif
diff -Naur openobex-apps-1.0.0-clean/src/obex_test_client.c openobex-apps-1.0.0/src/obex_test_client.c
--- openobex-apps-1.0.0-clean/src/obex_test_client.c	2002-12-01 18:34:41.000000000 +0100
+++ openobex-apps-1.0.0/src/obex_test_client.c	2004-05-12 13:07:24.000000000 +0200
@@ -370,13 +370,13 @@
 
 	while(OBEX_ObjectGetNextHeader(handle, object, &hi, &hv, &hlen))	{
 		if(hi == OBEX_HDR_BODY)	{
-		printf(__FUNCTION__ "() Found body\n");
+		printf("%s() Found body\n", __func__);
 			body = hv.bs;
 			body_len = hlen;
 			break;
 		}
 		else	{
-			printf(__FUNCTION__ "() Skipped header %02x\n", hi);
+			printf("%s() Skipped header %02x\n", __func__,  hi);
 		}
 	}
 
diff -Naur openobex-apps-1.0.0-clean/src/obex_test_server.c openobex-apps-1.0.0/src/obex_test_server.c
--- openobex-apps-1.0.0-clean/src/obex_test_server.c	2002-12-01 18:34:41.000000000 +0100
+++ openobex-apps-1.0.0/src/obex_test_server.c	2004-05-12 13:07:33.000000000 +0200
@@ -54,17 +54,17 @@
 	char *name = NULL;
 	char *namebuf = NULL;
 
-	printf(__FUNCTION__ "()\n");
+	printf("%s()\n", __func__);
 
 	while(OBEX_ObjectGetNextHeader(handle, object, &hi, &hv, &hlen))	{
 		switch(hi)	{
 		case OBEX_HDR_BODY:
-			printf(__FUNCTION__ "() Found body\n");
+			printf("%s() Found body\n", __func__);
 			body = hv.bs;
 			body_len = hlen;
 			break;
 		case OBEX_HDR_NAME:
-			printf(__FUNCTION__ "() Found name\n");
+			printf("%s() Found name\n", __func__);
 			if( (namebuf = malloc(hlen / 2)))	{
 				OBEX_UnicodeToChar(namebuf, hv.bs, hlen);
 				name = namebuf;
@@ -72,7 +72,7 @@
 			break;
 		
 		default:
-			printf(__FUNCTION__ "() Skipped header %02x\n", hi);
+			printf("%s() Skipped header %02x\n", __func__,  hi);
 		}
 	}
 	if(!body)	{
@@ -103,12 +103,12 @@
 	char *name = NULL;
 	char *namebuf = NULL;
 
-	printf(__FUNCTION__ "()\n");
+	printf("%s()\n", __func__);
 
 	while(OBEX_ObjectGetNextHeader(handle, object, &hi, &hv, &hlen))	{
 		switch(hi)	{
 		case OBEX_HDR_NAME:
-			printf(__FUNCTION__ "() Found name\n");
+			printf("%s() Found name\n", __func__);
 			if( (namebuf = malloc(hlen / 2)))	{
 				OBEX_UnicodeToChar(namebuf, hv.bs, hlen);
 				name = namebuf;
@@ -116,16 +116,16 @@
 			break;
 		
 		default:
-			printf(__FUNCTION__ "() Skipped header %02x\n", hi);
+			printf("%s() Skipped header %02x\n", __func__,  hi);
 		}
 	}
 
 	if(!name)	{
-		printf(__FUNCTION__ "() Got a GET without a name-header!\n");
+		printf("%s() Got a GET without a name-header!\n", __func__);
 		OBEX_ObjectSetRsp(object, OBEX_RSP_NOT_FOUND, OBEX_RSP_NOT_FOUND);
 		return;
 	}
-	printf(__FUNCTION__ "() Got a request for %s\n", name);
+	printf("%s() Got a request for %s\n", __func__,  name);
 
 	buf = easy_readfile(name, &file_size);
 	if(buf == NULL) {
@@ -154,7 +154,7 @@
 
 	const uint8_t *who = NULL;
 	int who_len = 0;
-	printf(__FUNCTION__ "()\n");
+	printf("%s()\n", __func__);
 
 	while(OBEX_ObjectGetNextHeader(handle, object, &hi, &hv, &hlen))	{
 		if(hi == OBEX_HDR_WHO)	{
@@ -162,7 +162,7 @@
 			who_len = hlen;
 		}
 		else	{
-			printf(__FUNCTION__ "() Skipped header %02x\n", hi);
+			printf("%s() Skipped header %02x\n", __func__,  hi);
 		}
 	}
 	if (who_len == 6)	{
@@ -199,7 +199,7 @@
 		OBEX_ObjectSetRsp(object, OBEX_RSP_CONTINUE, OBEX_RSP_SUCCESS);
 		break;
 	default:
-		printf(__FUNCTION__ "() Denied %02x request\n", cmd);
+		printf("%s() Denied %02x request\n", __func__,  cmd);
 		OBEX_ObjectSetRsp(object, OBEX_RSP_NOT_IMPLEMENTED, OBEX_RSP_NOT_IMPLEMENTED);
 		break;
 	}
@@ -224,7 +224,7 @@
 		break;
 
 	default:
-		printf(__FUNCTION__ "() Command (%02x) has now finished\n", obex_cmd);
+		printf("%s() Command (%02x) has now finished\n", __func__,  obex_cmd);
 		break;
 	}
 }