Changeset 18 for trunk

Show
Ignore:
Timestamp:
06/29/06 02:00:00 (3 years ago)
Author:
zany
Message:

Release 0.9

Location:
trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r10 r18  
     12006-06-12  Christian W. Zuckschwerdt  <zany@triq.net> 
     2 
     3        * 64-bit safe printf format (Roberto Pariset) 
     4 
     52006-03-07  Christian W. Zuckschwerdt  <zany@triq.net> 
     6 
     7        * added usb support (Stanislav Nikolov) 
     8        * device/channel code cleanup 
     9 
    1102005-09-23  Christian W. Zuckschwerdt  <zany@triq.net> 
    211 
  • trunk/configure.in

    r16 r18  
    1 AC_INIT(ObexFS, 0.8, zany@triq.net) 
     1AC_INIT(ObexFS, 0.9, zany@triq.net) 
    22#AC_CONFIG_SRCDIR(src/foo.c) 
    33AM_INIT_AUTOMAKE 
  • trunk/fuse/obexautofs.c

    r16 r18  
    3434#include <stdlib.h> 
    3535#include <unistd.h> 
     36#include <inttypes.h> 
    3637#include <string.h> 
    3738#include <time.h> 
     
    9899static int discover_usb(void) { return -1; } 
    99100 
    100 static int discover_tty(char *port) { return -1; } 
     101static int discover_tty(char *UNUSED(port)) { return -1; } 
    101102 
    102103static int discover_bt(void) 
     
    399400} 
    400401 
    401 static int ofs_readlink (const char *path, char *link, size_t size) 
     402static int ofs_readlink (const char *path, char *link, size_t UNUSED(size)) 
    402403{ 
    403404        connection_t *conn; 
     
    616617        if (actual > size) 
    617618                actual = size; 
    618         DEBUG("reading %s at %lld for %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]); 
    619620        memcpy(buf, wb->data + offset, actual); 
    620621 
     
    626627        data_buffer_t *wb; 
    627628        size_t newsize; 
    628         DEBUG("Writing %s at %lld for %d\n", path, offset, size); 
     629        DEBUG("Writing %s at %" PRId64 " for %d\n", path, offset, size); 
    629630        wb = (data_buffer_t *)fi->fh; 
    630631 
     
    646647        wb->write_mode = 1; 
    647648 
    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); 
    649650        (void) memcpy(&wb->data[offset], buf, size); 
    650651 
     
    663664        DEBUG("Releasing: %s (%p)\n", path, wb); 
    664665        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]); 
    666667 
    667668                conn = ofs_find_connection(path, &filepath); 
     
    688689{ 
    689690        connection_t *conn; 
    690         int res; 
    691691        int size = 0, free = 0; 
    692692 
     
    737737} 
    738738 
    739 static void ofs_destroy(void *private_data) { 
     739static void ofs_destroy(void *UNUSED(private_data)) { 
    740740        connection_t *conn; 
    741741         
     
    785785int main(int argc, char *argv[]) 
    786786{ 
    787         int res; 
    788          
    789787        while (1) { 
    790788                int option_index = 0; 
  • trunk/fuse/obexfs.c

    r16 r18  
    3333#include <stdlib.h> 
    3434#include <unistd.h> 
     35#include <inttypes.h> 
    3536#include <string.h> 
    3637#include <time.h> 
     
    6768 
    6869static obexftp_client_t *cli = NULL; 
    69 static char *tty = NULL; // "/dev/ttyS0"; 
    7070static int transport = 0; 
    71 static char *btaddr = NULL; // "00:11:22:33:44:55"; 
    72 static int btchannel = 6; // 10; 
     71static char *device = NULL; // "00:11:22:33:44:55"; "/dev/ttyS0"; 
     72static int channel = 6; // 10; 
    7373 
    7474static int nonblock = 0; 
     
    9696 
    9797                /* Connect */ 
    98                 if (obexftp_connect (cli, btaddr, btchannel) >= 0) 
     98                if (obexftp_connect (cli, device, channel) >= 0) 
    9999                        return 0; 
    100100                /* Still trying to connect */ 
     
    351351        if (actual > size) 
    352352                actual = size; 
    353         DEBUG("reading %s at %lld for %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]); 
    354354        memcpy(buf, wb->data + offset, actual); 
    355355 
     
    361361        data_buffer_t *wb; 
    362362        size_t newsize; 
    363         DEBUG("Writing %s at %lld for %d\n", path, offset, size); 
     363        DEBUG("Writing %s at %" PRId64 " for %d\n", path, offset, size); 
    364364        wb = (data_buffer_t *)fi->fh; 
    365365 
     
    381381        wb->write_mode = 1; 
    382382 
    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); 
    384384        (void) memcpy(&wb->data[offset], buf, size); 
    385385 
     
    396396        DEBUG("Releasing: %s (%p)\n", path, wb); 
    397397        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]); 
    399399 
    400400                res = ofs_connect(); 
     
    426426        /* for S45 */ 
    427427        (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)); 
    429429  
    430430        /* Retrieve Infos */ 
     
    437437  
    438438        (void) obexftp_disconnect (cli); 
    439         (void) obexftp_connect (cli, btaddr, btchannel); 
     439        (void) obexftp_connect (cli, device, channel); 
    440440 
    441441        ofs_disconnect(); 
     
    458458} 
    459459 
    460 static void ofs_destroy(void *private_data) { 
     460static void ofs_destroy(void *UNUSED(private_data)) { 
    461461        fprintf(stderr, "terminating...\n"); 
    462462        cli_close(); 
     
    504504                        {"bluetooth",   required_argument, NULL, 'b'}, 
    505505                        {"channel",     required_argument, NULL, 'B'}, 
     506                        {"usb",         required_argument, NULL, 'u'}, 
    506507                        {"tty",         required_argument, NULL, 't'}, 
     508                        {"network",     required_argument, NULL, 'n'}, 
    507509                        {"nonblock",    no_argument, NULL, 'N'}, 
    508510                        {"help",        no_argument, NULL, 'h'}, 
     
    511513                }; 
    512514                 
    513                 c = getopt_long (argc, argv, "+ib:B:t:Nh", 
     515                c = getopt_long (argc, argv, "+ib:B:u:t:n:Nh", 
    514516                                 long_options, &option_index); 
    515517                if (c == -1) 
     
    520522                case 'i': 
    521523                        transport = OBEX_TRANS_IRDA; 
     524                        if (device != NULL) 
     525                                free(device); 
     526                        device = NULL; 
     527                        channel = 0; 
    522528                        break; 
    523529                 
    524530                case 'b': 
    525531                        transport = OBEX_TRANS_BLUETOOTH; 
    526                         if (btaddr != NULL) 
    527                                 free (btaddr); 
    528                         btaddr = optarg; 
     532                        if (device != NULL) 
     533                                free (device); 
     534                        device = optarg; 
    529535                        break; 
    530536                         
    531537                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); 
    533549                        break; 
    534550                 
    535551                case 't': 
    536552                        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; 
    540557 
    541558                        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                        } 
    543573                        break; 
    544574                         
     
    556586                                " -b, --bluetooth <device>    connect to this bluetooth device\n" 
    557587                                " -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" 
    559591                                " -N, --nonblock              nonblocking mode\n\n" 
    560592                                " -h, --help, --usage         this help text\n\n"