Changeset 185
- Timestamp:
- 08/29/07 22:05:15 (15 months ago)
- Location:
- trunk
- Files:
-
- 3 added
- 3 removed
- 14 modified
-
Doxyfile (added)
-
Doxyfile.coverpage (added)
-
Doxyfile.developer (added)
-
Makefile.am (modified) (1 diff)
-
bfb/bfb.c (modified) (16 diffs)
-
bfb/bfb.h (modified) (3 diffs)
-
doc/Makefile.am (modified) (1 diff)
-
doc/docproc.c (deleted)
-
doc/kernel-doc (deleted)
-
doc/obexftp.tmpl (deleted)
-
includes/common.h (modified) (1 diff)
-
multicobex/multi_cobex.c (modified) (8 diffs)
-
multicobex/multi_cobex.h (modified) (1 diff)
-
obexftp/cache.c (modified) (12 diffs)
-
obexftp/client.c (modified) (24 diffs)
-
obexftp/client.h (modified) (1 diff)
-
obexftp/obexftp.h (modified) (4 diffs)
-
obexftp/object.c (modified) (7 diffs)
-
obexftp/object.h (modified) (2 diffs)
-
obexftp/uuid.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Makefile.am
r182 r185 4 4 obexftp.spec \ 5 5 includes/common.h \ 6 Doxyfile \ 7 Doxyfile.developer \ 8 Doxyfile.coverpage \ 6 9 config.rpath \ 7 tcl.m4 10 tcl.m4 8 11 9 12 # no uninstall for perl -- ignore it -
trunk/bfb/bfb.c
r156 r185 1 /* 2 * bfb/bfb.c: BFB transport encapsulation (used for Siemens mobile equipment) 1 /** 2 * \file bfb/bfb.c 3 * BFB transport encapsulation (used for Siemens mobile equipment). 4 * ObexFTP library - language bindings for OBEX file transfer. 3 5 * 4 * Copyright (c) 2002 Christian W. Zuckschwerdt <zany@triq.net>6 * Copyright (c) 2002-2007 Christian W. Zuckschwerdt <zany@triq.net> 5 7 * 6 8 * This program is free software; you can redistribute it and/or modify it … … 19 21 * 20 22 */ 21 /*22 * v0.1: Die, 5 Feb 2002 22:46:19 +010023 * v0.4: Don, 25 Jul 2002 03:16:41 +020024 */25 23 26 24 #ifdef HAVE_CONFIG_H … … 87 85 #endif 88 86 89 /* returns the whole buffer folded with xor. */ 87 88 /** 89 Returns the whole buffer folded with xor. 90 */ 90 91 uint8_t bfb_checksum(uint8_t *data, int len) 91 92 { … … 99 100 } 100 101 101 /* stuff data frame into serial cable encapsulation */ 102 /* buffer needs to be of at leaset len+7 size */ 103 /* Type 0x01: "prepare" command. */ 104 /* Type 0x02: first transmission in a row. */ 105 /* Type 0x03: continued transmission. */ 106 /* seq needs to be incremented afterwards. */ 102 103 /** 104 Stuff data frame into serial cable encapsulation. 105 buffer needs to be of at leaset len+7 size 106 Type 0x01: "prepare" command. 107 Type 0x02: first transmission in a row. 108 Type 0x03: continued transmission. 109 seq needs to be incremented afterwards. 110 */ 107 111 int bfb_stuff_data(uint8_t *buffer, uint8_t type, uint8_t *data, uint16_t len, uint8_t seq) 108 112 { … … 154 158 } 155 159 156 /* send a cmd, subcmd packet, add chk (no parameters) */ 160 161 /** 162 Send a cmd, subcmd packet, add chk (no parameters). 163 */ 157 164 int bfb_write_subcmd(fd_t fd, uint8_t type, uint8_t subtype) 158 165 { … … 165 172 } 166 173 167 /* send a cmd, subcmd packet */ 174 175 /** 176 Send a cmd, subcmd packet. 177 */ 168 178 int bfb_write_subcmd0(fd_t fd, uint8_t type, uint8_t subtype) 169 179 { … … 171 181 } 172 182 173 /* send a cmd, subcmd, data packet */ 183 184 /** 185 Send a cmd, subcmd, data packet. 186 */ 174 187 int bfb_write_subcmd8(fd_t fd, uint8_t type, uint8_t subtype, uint8_t p1) 175 188 { … … 182 195 } 183 196 184 /* send a cmd, subcmd packet, add chk (one word parameter) */ 197 198 /** 199 Send a cmd, subcmd packet, add chk (one word parameter). 200 */ 185 201 int bfb_write_subcmd1(fd_t fd, uint8_t type, uint8_t subtype, uint16_t p1) 186 202 { … … 200 216 } 201 217 202 /* send a cmd, subcmd packet, add chk (two word parameter) */ 218 219 /** 220 Send a cmd, subcmd packet, add chk (two word parameter). 221 */ 203 222 int bfb_write_subcmd2(fd_t fd, uint8_t type, uint8_t subtype, uint16_t p1, uint16_t p2) 204 223 { … … 222 241 } 223 242 224 /* send a cmd, subcmd packet, add chk (three word parameter) */ 243 244 /** 245 Send a cmd, subcmd packet, add chk (three word parameter). 246 */ 225 247 int bfb_write_subcmd3(fd_t fd, uint8_t type, uint8_t subtype, uint16_t p1, uint16_t p2, uint16_t p3) 226 248 { … … 247 269 } 248 270 249 /* send a cmd, subcmd packet, add long, word parameter */ 271 272 /** 273 Send a cmd, subcmd packet, add long, word parameter. 274 */ 250 275 int bfb_write_subcmd_lw(fd_t fd, uint8_t type, uint8_t subtype, uint32_t p1, uint16_t p2) 251 276 { … … 272 297 273 298 274 /* send actual packets */ 275 /* patch from Jorge Ventura to handle EAGAIN from write */ 299 /** 300 Send actual packets. 301 Patch from Jorge Ventura to handle EAGAIN from write. 302 */ 276 303 int bfb_write_packets(fd_t fd, uint8_t type, uint8_t *buffer, int length) 277 304 { … … 348 375 } 349 376 377 378 /** 379 Stuff data into packet buffers and send all packets. 380 */ 350 381 int bfb_send_data(fd_t fd, uint8_t type, uint8_t *data, uint16_t length, uint8_t seq) 351 382 { … … 369 400 370 401 371 /* retrieve actual packets */ 402 /** 403 Retrieve actual packets. 404 */ 372 405 /*@null@*/ 373 406 bfb_frame_t *bfb_read_packets(uint8_t *buffer, int *length) … … 423 456 } 424 457 458 459 /** 460 Append BFB frame to a data buffer. 461 */ 425 462 int bfb_assemble_data(bfb_data_t **data, int *size, int *len, bfb_frame_t *frame) 426 463 { … … 459 496 } 460 497 498 499 /** 500 Check if data buffer is complete and valid. 501 */ 461 502 int bfb_check_data(bfb_data_t *data, int len) 462 503 { -
trunk/bfb/bfb.h
r183 r185 1 /* 2 * bfb/bfb.h 1 /** 2 * \file bfb/bfb.h 3 * BFB transport encapsulation (used for Siemens mobile equipment). 4 * ObexFTP library - language bindings for OBEX file transfer. 3 5 * 4 * Copyright (c) 2002 Christian W. Zuckschwerdt <zany@triq.net>6 * Copyright (c) 2002-2007 Christian W. Zuckschwerdt <zany@triq.net> 5 7 * 6 8 * This program is free software; you can redistribute it and/or modify it … … 35 37 typedef int fd_t; 36 38 #endif 37 38 #define BFB_LOG_DOMAIN "bfb"39 39 40 40 #pragma pack(1) … … 84 84 int bfb_write_subcmd8(fd_t fd, uint8_t type, uint8_t subtype, uint8_t p1); 85 85 int bfb_write_subcmd1(fd_t fd, uint8_t type, uint8_t subtype, uint16_t p1); 86 87 /* send a cmd, subcmd packet, add chk (two word parameter) */88 86 int bfb_write_subcmd2(fd_t fd, uint8_t type, uint8_t subtype, uint16_t p1, uint16_t p2); 89 90 /* send a cmd, subcmd packet, add chk (three word parameter) */91 87 int bfb_write_subcmd3(fd_t fd, uint8_t type, uint8_t subtype, uint16_t p1, uint16_t p2, uint16_t p3); 92 93 /* send a cmd, subcmd packet, add long, word parameter */94 88 int bfb_write_subcmd_lw(fd_t fd, uint8_t type, uint8_t subtype, uint32_t p1, uint16_t p2); 95 89 -
trunk/doc/Makefile.am
r110 r185 2 2 # perl's pod2man, pod2html and pod2text needed 3 3 4 TOPDIR := .. 5 export TOPDIR 6 XSLBASE=http://docbook.sourceforge.net/release/xsl/current 7 8 obexftp.xml: obexftp.tmpl docproc ../obexftp/client.c 9 $(top_srcdir)/doc/docproc <$< >$@ 10 11 docproc_SOURCES = docproc.c 12 noinst_PROGRAMS = docproc 4 EXTRA_DIST = $(man_MANS) $(noinst_DATA) 13 5 14 6 man_MANS = obexftp.1 obexftpd.1 15 7 16 EXTRA_DIST = $(man_MANS) $(noinst_DATA) \17 kernel-doc obexftp.tmpl18 19 # transform [A-Z][A-Z]* Change*20 8 noinst_DATA = obexftp.pod obexftp.1.txt obexftp.1.html \ 21 9 obexftpd.pod obexftpd.1.txt obexftpd.1.html 22 10 23 11 if BUILD_DOCS 24 25 .PHONY: html26 27 html: obexftp.html28 29 %.html: %.xml30 xsltproc --output $@ $(XSLBASE)/xhtml/docbook.xsl $<31 12 32 13 %.1: %.pod -
trunk/includes/common.h
r106 r185 1 /* 2 * ObexFTP common Macros 1 /** 2 \file includes/common.h 3 ObexFTP common macros and debugging. 4 ObexFTP library - language bindings for OBEX file transfer. 3 5 */ 4 6 -
trunk/multicobex/multi_cobex.c
r156 r185 1 /* 2 * multi_cobex.c - Talk OBEX over a serial port (Siemens, Ericsson, New-Siemens) 1 /** 2 * \file multicobex/multi_cobex.c 3 * Detect, initiate and run OBEX over custom serial port protocols 4 * (Siemens, Ericsson, New-Siemens, Motorola, Generic). 5 * ObexFTP library - language bindings for OBEX file transfer. 3 6 * 4 * Copyright (c) 2002-200 5Christian W. Zuckschwerdt <zany@triq.net>7 * Copyright (c) 2002-2007 Christian W. Zuckschwerdt <zany@triq.net> 5 8 * 6 9 * This program is free software; you can redistribute it and/or modify it … … 19 22 * 20 23 */ 21 /*22 * Don, 17 Jan 2002 18:27:25 +010023 * v0.6 Fre, 15 Feb 2002 15:41:10 +010024 */25 24 26 25 #ifdef HAVE_CONFIG_H … … 90 89 } 91 90 91 /** 92 Called from OBEX-lib to set up a connection. 93 */ 92 94 int cobex_connect(obex_t *self, void *data) 93 95 { … … 133 135 } 134 136 137 /** 138 Called from OBEX-lib to tear down a connection. 139 */ 135 140 int cobex_disconnect(obex_t *self, void *data) 136 141 { … … 145 150 } 146 151 147 /* Called from OBEX-lib when data needs to be written */ 152 /** 153 Called from OBEX-lib when data needs to be written. 154 */ 148 155 int cobex_write(obex_t *self, void *data, uint8_t *buffer, int length) 149 156 { … … 192 199 } 193 200 194 /* Called when input data is needed */ 201 /** 202 Called when input data is needed. 203 */ 195 204 int cobex_handleinput(obex_t *self, void *data, int timeout) 196 205 { … … 298 307 }; 299 308 */ 309 310 /** 311 Create a new multi cobex instance for a given TTY. 312 313 \param tty the TTY to use. Defaults to the first serial TTY if NULL. 314 */ 300 315 obex_ctrans_t *cobex_ctrans (const char *tty) { 301 316 obex_ctrans_t *ctrans; … … 318 333 } 319 334 320 335 /** 336 Free all data related to a multi cobex instance. 337 */ 321 338 void cobex_free (obex_ctrans_t *ctrans) 322 339 { -
trunk/multicobex/multi_cobex.h
r96 r185 1 /* 2 * multi_cobex.h 1 /** 2 * \file multicobex/multi_cobex.h 3 * Detect, initiate and run OBEX over custom serial port protocols 4 * (Siemens, Ericsson, New-Siemens, Motorola, Generic). 5 * ObexFTP library - language bindings for OBEX file transfer. 3 6 * 4 * Copyright (c) 2002-200 5Christian W. Zuckschwerdt <zany@triq.net>7 * Copyright (c) 2002-2007 Christian W. Zuckschwerdt <zany@triq.net> 5 8 * 6 9 * This program is free software; you can redistribute it and/or modify it -
trunk/obexftp/cache.c
r156 r185 1 /* 2 * obexftp/cache.c: ObexFTP client library 1 /** 2 * \file obexftp/cache.c 3 * ObexFTP client API caching layer. 4 * ObexFTP library - language bindings for OBEX file transfer. 3 5 * 4 * Copyright (c) 2002 Christian W. Zuckschwerdt <zany@triq.net>6 * Copyright (c) 2002-2007 Christian W. Zuckschwerdt <zany@triq.net> 5 7 * 6 8 * This program is free software; you can redistribute it and/or modify it … … 53 55 54 56 55 /* 56 *Normalize the path argument, add/remove leading/trailing slash57 *turns relative paths into (most likely wrong) absolute ones58 * wont expand "../" or "./" 57 /** 58 Normalize the path argument, add/remove leading/trailing slash 59 turns relative paths into (most likely wrong) absolute ones 60 wont expand "../" or "./". 59 61 */ 60 62 static /*@only@*/ char *normalize_dir_path(int quirks, const char *name) … … 90 92 91 93 92 /* 93 * methods that need to invalidate cache lines: 94 * setpath (when create is on) 95 * put 96 * put_file 97 * del 98 * rename 94 /** 95 Purge all cache object at/below a given path. 96 Methods that need to invalidate cache lines: 97 - setpath (when create is on) 98 - put 99 - put_file 100 - del 101 - rename 99 102 */ 100 103 void cache_purge(cache_object_t **root, const char *path) … … 143 146 } 144 147 148 /** 149 Retrieve an object from the cache. 150 */ 145 151 int get_cache_object(const obexftp_client_t *cli, const char *name, char **object, int *size) 146 152 { … … 162 168 } 163 169 170 /** 171 Store an object in the cache. 172 */ 164 173 int put_cache_object(obexftp_client_t *cli, /*@only@*/ char *name, /*@only@*/ char *object, int size) 165 174 { … … 179 188 } 180 189 181 /* List a directory from cache, optionally loading it first. */ 190 /** 191 List a directory from cache, optionally loading it first. 192 */ 182 193 static char *obexftp_cache_list(obexftp_client_t *cli, const char *name) 183 194 { … … 216 227 /* simple xml parser */ 217 228 229 /** 230 Parse fixed format date string to time_t. 231 */ 218 232 static time_t atotime (const char *date) 219 233 { … … 231 245 } 232 246 233 /* very limited - not multi-byte character save */ 234 /* it is actually "const char *xml" but can't be declared as such */ 247 /** 248 Parse an XML file to array of stat_entry_t's. 249 Very limited - not multi-byte character save. 250 It's actually "const char *xml" but can't be declared as such. 251 */ 235 252 static stat_entry_t *parse_directory(char *xml) 236 253 { … … 340 357 } dir_stream_t; 341 358 359 /** 360 Prepare a directory for reading. 361 */ 342 362 void *obexftp_opendir(obexftp_client_t *cli, const char *name) 343 363 { … … 367 387 } 368 388 369 /* the stat entry is a cache object so we do nothing */ 389 /** 390 Close a directory after reading. 391 The stat entry is a cache object so we do nothing. 392 */ 370 393 int obexftp_closedir(void *dir) { 371 394 if (!dir) … … 375 398 } 376 399 400 /** 401 Read the next entry from an open directory. 402 */ 377 403 stat_entry_t *obexftp_readdir(void *dir) { 378 404 dir_stream_t *stream; … … 388 414 } 389 415 416 /** 417 Stat a directory entry. 418 */ 390 419 stat_entry_t *obexftp_stat(obexftp_client_t *cli, const char *name) 391 420 { -
trunk/obexftp/client.c
r183 r185 1 /* 2 * obexftp/client.c: ObexFTP client library 1 /** 2 * \file obexftp/client.c 3 * ObexFTP client API. 4 * ObexFTP library - language bindings for OBEX file transfer. 3 5 * 4 * Copyright (c) 2002 Christian W. Zuckschwerdt <zany@triq.net>6 * Copyright (c) 2002-2007 Christian W. Zuckschwerdt <zany@triq.net> 5 7 * 6 8 * This program is free software; you can redistribute it and/or modify it … … 96 98 #pragma pack() 97 99 100 98 101 #ifdef _WIN32 99 102 #ifdef HAVE_BLUETOOTH … … 117 120 #endif 118 121 122 123 /** 124 Empty callback used as default. 125 */ 119 126 static void dummy_info_cb(int UNUSED(event), const char *UNUSED(msg), int UNUSED(len), void *UNUSED(data)) 120 127 { 121 /* dummy */ 122 } 123 124 125 /* 126 * Normalize the path argument 127 * wont turn relative paths into (most likely wrong) absolute ones 128 * wont expand "../" or "./" 128 /* do nothing */ 129 } 130 131 132 /** 133 Normalize the path argument. 134 \note 135 wont turn relative paths into (most likely wrong) absolute ones. 136 wont expand "../" or "./". 129 137 */ 130 138 /* … … 156 164 */ 157 165 158 /* 159 * Normalize the path argument and split into pathname and basename 160 * wont turn relative paths into (most likely wrong) absolute ones 161 * wont expand "../" or "./" 162 * Will keep "telecom" prefix 163 * Do not use this function if there is no slash in the argument! 166 167 /** 168 Normalize the path argument and split into pathname and basename. 169 \note 170 Wont turn relative paths into (most likely wrong) absolute ones. 171 Wont expand "../" or "./". 172 Will keep "telecom" prefix. 173 \warning 174 Do not use this function if there is no slash in the argument! 164 175 */ 165 176 static void split_file_path(const char *name, /*@only@*/ char **basepath, /*@only@*/ char **basename) … … 213 224 214 225 215 /* Add more data from memory to stream. */ 226 /** 227 Add more data from memory to stream. 228 */ 216 229 static int cli_fillstream_from_memory(obexftp_client_t *cli, obex_object_t *object) 217 230 { … … 247 260 } 248 261 249 /* Add more data from file to stream. */ 262 263 /** 264 Add more data from file to stream. 265 */ 250 266 static int cli_fillstream_from_file(obexftp_client_t *cli, obex_object_t *object) 251 267 { … … 286 302 287 303 288 /* Save body from object or return application parameters */ 304 /** 305 Save body from object or return application parameters. 306 */ 289 307 static void client_done(obex_t *handle, obex_object_t *object, int UNUSED(obex_cmd), int UNUSED(obex_rsp)) 290 308 { … … 392 410 393 411 394 /* Incoming event from OpenOBEX. */ 412 /** 413 Handle incoming event from OpenOBEX. 414 */ 395 415 static void cli_obex_event(obex_t *handle, obex_object_t *object, int UNUSED(mode), int event, int obex_cmd, int obex_rsp) 396 416 { … … 434 454 435 455 436 /* Do an OBEX request sync. */ 456 /** 457 Wait for the OBEX client to finish. 458 */ 437 459 static int obexftp_sync(obexftp_client_t *cli) 438 460 { … … 457 479 return -1; 458 480 } 459 481 482 483 /** 484 Do an OBEX request synchronous. 485 */ 460 486 static int cli_sync_request(obexftp_client_t *cli, obex_object_t *object) 461 487 { … … 469 495 return obexftp_sync (cli); 470 496 } 471 472 473 /* Create an obexftp client */ 497 498 499 /** 500 Create an obexftp client. 501 502 \param transport the transport type that will be used 503 \param ctrans optional custom transport (don't use) 504 \param infocb optional info callback 505 \param infocb_data optional info callback data 506 507 \return a new all
