- Timestamp:
- 06/29/06 02:00:00 (3 years ago)
- Location:
- trunk
- Files:
-
- 4 modified
-
ChangeLog (modified) (1 diff)
-
configure.in (modified) (1 diff)
-
fuse/obexautofs.c (modified) (10 diffs)
-
fuse/obexfs.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r10 r18 1 2006-06-12 Christian W. Zuckschwerdt <zany@triq.net> 2 3 * 64-bit safe printf format (Roberto Pariset) 4 5 2006-03-07 Christian W. Zuckschwerdt <zany@triq.net> 6 7 * added usb support (Stanislav Nikolov) 8 * device/channel code cleanup 9 1 10 2005-09-23 Christian W. Zuckschwerdt <zany@triq.net> 2 11 -
trunk/configure.in
r16 r18 1 AC_INIT(ObexFS, 0. 8, zany@triq.net)1 AC_INIT(ObexFS, 0.9, zany@triq.net) 2 2 #AC_CONFIG_SRCDIR(src/foo.c) 3 3 AM_INIT_AUTOMAKE -
trunk/fuse/obexautofs.c
r16 r18 34 34 #include <stdlib.h> 35 35 #include <unistd.h> 36 #include <inttypes.h> 36 37 #include <string.h> 37 38 #include <time.h> … … 98 99 static int discover_usb(void) { return -1; } 99 100 100 static int discover_tty(char * port) { return -1; }101 static int discover_tty(char *UNUSED(port)) { return -1; } 101 102 102 103 static int discover_bt(void) … … 399 400 } 400 401 401 static int ofs_readlink (const char *path, char *link, size_t size)402 static int ofs_readlink (const char *path, char *link, size_t UNUSED(size)) 402 403 { 403 404 connection_t *conn; … … 616 617 if (actual > size) 617 618 actual = size; 618 DEBUG("reading %s at % lldfor %d (peek: %02x\n", path, offset, actual, wb->data[offset]);619 DEBUG("reading %s at %" PRId64 " for %d (peek: %02x\n", path, offset, actual, wb->data[offset]); 619 620 memcpy(buf, wb->data + offset, actual); 620 621 … … 626 627 data_buffer_t *wb; 627 628 size_t newsize; 628 DEBUG("Writing %s at % lldfor %d\n", path, offset, size);629 DEBUG("Writing %s at %" PRId64 " for %d\n", path, offset, size); 629 630 wb = (data_buffer_t *)fi->fh; 630 631 … … 646 647 wb->write_mode = 1; 647 648 648 DEBUG("memcpy to %p (%p) from %p cnt % d\n", wb->data + offset, wb->data, buf, size);649 DEBUG("memcpy to %p (%p) from %p cnt %zu\n", wb->data + offset, wb->data, buf, size); 649 650 (void) memcpy(&wb->data[offset], buf, size); 650 651 … … 663 664 DEBUG("Releasing: %s (%p)\n", path, wb); 664 665 if (wb && wb->data && wb->write_mode) { 665 DEBUG("Now writing %s for % d(%02x)\n", path, wb->size, wb->data[0]);666 DEBUG("Now writing %s for %zu (%02x)\n", path, wb->size, wb->data[0]); 666 667 667 668 conn = ofs_find_connection(path, &filepath); … … 688 689 { 689 690 connection_t *conn; 690 int res;691 691 int size = 0, free = 0; 692 692 … … 737 737 } 738 738 739 static void ofs_destroy(void * private_data) {739 static void ofs_destroy(void *UNUSED(private_data)) { 740 740 connection_t *conn; 741 741 … … 785 785 int main(int argc, char *argv[]) 786 786 { 787 int res;788 789 787 while (1) { 790 788 int option_index = 0; -
trunk/fuse/obexfs.c
r16 r18 33 33 #include <stdlib.h> 34 34 #include <unistd.h> 35 #include <inttypes.h> 35 36 #include <string.h> 36 37 #include <time.h> … … 67 68 68 69 static obexftp_client_t *cli = NULL; 69 static char *tty = NULL; // "/dev/ttyS0";70 70 static int transport = 0; 71 static char * btaddr = NULL; // "00:11:22:33:44:55";72 static int btchannel = 6; // 10;71 static char *device = NULL; // "00:11:22:33:44:55"; "/dev/ttyS0"; 72 static int channel = 6; // 10; 73 73 74 74 static int nonblock = 0; … … 96 96 97 97 /* Connect */ 98 if (obexftp_connect (cli, btaddr, btchannel) >= 0)98 if (obexftp_connect (cli, device, channel) >= 0) 99 99 return 0; 100 100 /* Still trying to connect */ … … 351 351 if (actual > size) 352 352 actual = size; 353 DEBUG("reading %s at % lldfor %d (peek: %02x\n", path, offset, actual, wb->data[offset]);353 DEBUG("reading %s at %" PRId64 " for %d (peek: %02x\n", path, offset, actual, wb->data[offset]); 354 354 memcpy(buf, wb->data + offset, actual); 355 355 … … 361 361 data_buffer_t *wb; 362 362 size_t newsize; 363 DEBUG("Writing %s at % lldfor %d\n", path, offset, size);363 DEBUG("Writing %s at %" PRId64 " for %d\n", path, offset, size); 364 364 wb = (data_buffer_t *)fi->fh; 365 365 … … 381 381 wb->write_mode = 1; 382 382 383 DEBUG("memcpy to %p (%p) from %p cnt % d\n", wb->data + offset, wb->data, buf, size);383 DEBUG("memcpy to %p (%p) from %p cnt %zu\n", wb->data + offset, wb->data, buf, size); 384 384 (void) memcpy(&wb->data[offset], buf, size); 385 385 … … 396 396 DEBUG("Releasing: %s (%p)\n", path, wb); 397 397 if (wb && wb->data && wb->write_mode) { 398 DEBUG("Now writing %s for % d(%02x)\n", path, wb->size, wb->data[0]);398 DEBUG("Now writing %s for %zu (%02x)\n", path, wb->size, wb->data[0]); 399 399 400 400 res = ofs_connect(); … … 426 426 /* for S45 */ 427 427 (void) obexftp_disconnect (cli); 428 (void) obexftp_connect_uuid (cli, btaddr, btchannel, UUID_S45, sizeof(UUID_S45));428 (void) obexftp_connect_uuid (cli, device, channel, UUID_S45, sizeof(UUID_S45)); 429 429 430 430 /* Retrieve Infos */ … … 437 437 438 438 (void) obexftp_disconnect (cli); 439 (void) obexftp_connect (cli, btaddr, btchannel);439 (void) obexftp_connect (cli, device, channel); 440 440 441 441 ofs_disconnect(); … … 458 458 } 459 459 460 static void ofs_destroy(void * private_data) {460 static void ofs_destroy(void *UNUSED(private_data)) { 461 461 fprintf(stderr, "terminating...\n"); 462 462 cli_close(); … … 504 504 {"bluetooth", required_argument, NULL, 'b'}, 505 505 {"channel", required_argument, NULL, 'B'}, 506 {"usb", required_argument, NULL, 'u'}, 506 507 {"tty", required_argument, NULL, 't'}, 508 {"network", required_argument, NULL, 'n'}, 507 509 {"nonblock", no_argument, NULL, 'N'}, 508 510 {"help", no_argument, NULL, 'h'}, … … 511 513 }; 512 514 513 c = getopt_long (argc, argv, "+ib:B: t:Nh",515 c = getopt_long (argc, argv, "+ib:B:u:t:n:Nh", 514 516 long_options, &option_index); 515 517 if (c == -1) … … 520 522 case 'i': 521 523 transport = OBEX_TRANS_IRDA; 524 if (device != NULL) 525 free(device); 526 device = NULL; 527 channel = 0; 522 528 break; 523 529 524 530 case 'b': 525 531 transport = OBEX_TRANS_BLUETOOTH; 526 if ( btaddr!= NULL)527 free ( btaddr);528 btaddr= optarg;532 if (device != NULL) 533 free (device); 534 device = optarg; 529 535 break; 530 536 531 537 case 'B': 532 btchannel = atoi(optarg); 538 channel = atoi(optarg); 539 break; 540 541 case 'u': 542 if (geteuid() != 0) 543 fprintf(stderr, "If USB doesn't work setup permissions in udev or run as superuser.\n"); 544 transport = OBEX_TRANS_USB; 545 if (device != NULL) 546 free(device); 547 device = NULL; 548 channel = atoi(optarg); 533 549 break; 534 550 535 551 case 't': 536 552 transport = OBEX_TRANS_CUSTOM; 537 if (tty != NULL) 538 free (tty); 539 tty = NULL; 553 if (device != NULL) 554 free(device); 555 device = NULL; 556 channel = 0; 540 557 541 558 if (strcasecmp(optarg, "irda")) 542 tty = optarg; 559 device = optarg; 560 break; 561 562 case 'n': 563 transport = OBEX_TRANS_INET; 564 if (device != NULL) 565 free(device); 566 device = optarg; 567 channel = 650; 568 { 569 int n; 570 if (sscanf(optarg, "%d.%d.%d.%d", &n, &n, &n, &n) != 4) 571 fprintf(stderr, "Please use dotted quad notation.\n"); 572 } 543 573 break; 544 574 … … 556 586 " -b, --bluetooth <device> connect to this bluetooth device\n" 557 587 " -B, --channel <number> use this bluetooth channel when connecting\n" 558 " -t, --tty <device> connect to this tty using a custom transport\n\n" 588 " -u, --usb <interface> connect to this usb interface number\n" 589 " -t, --tty <device> connect to this tty using a custom transport\n" 590 " -n, --network <device> connect to this network host\n\n" 559 591 " -N, --nonblock nonblocking mode\n\n" 560 592 " -h, --help, --usage this help text\n\n"
