[Redbutton-devel] SF.net SVN: redbutton: [123] redbutton-download/trunk
Brought to you by:
skilvington
|
From: <ski...@us...> - 2006-06-24 08:56:09
|
Revision: 123 Author: skilvington Date: 2006-06-24 01:55:47 -0700 (Sat, 24 Jun 2006) ViewCVS: http://svn.sourceforge.net/redbutton/?rev=123&view=rev Log Message: ----------- add -v (verbose) flag Modified Paths: -------------- redbutton-download/trunk/TODO redbutton-download/trunk/biop.c redbutton-download/trunk/carousel.c redbutton-download/trunk/findmheg.c redbutton-download/trunk/fs.c redbutton-download/trunk/list.c redbutton-download/trunk/listen.c redbutton-download/trunk/module.c redbutton-download/trunk/rb-download.c redbutton-download/trunk/utils.c redbutton-download/trunk/utils.h Modified: redbutton-download/trunk/TODO =================================================================== --- redbutton-download/trunk/TODO 2006-06-22 09:06:51 UTC (rev 122) +++ redbutton-download/trunk/TODO 2006-06-24 08:55:47 UTC (rev 123) @@ -9,8 +9,6 @@ be able to read from a file -have a verbose flag - use a linked list of modules rather than an array in struct carousel => easier to delete/add modules Modified: redbutton-download/trunk/biop.c =================================================================== --- redbutton-download/trunk/biop.c 2006-06-22 09:06:51 UTC (rev 122) +++ redbutton-download/trunk/biop.c 2006-06-24 08:55:47 UTC (rev 123) @@ -47,8 +47,8 @@ struct biop_sequence file; char *dirname; -// printf("full BIOP, size=%u\n", size); -// hexdump((unsigned char *) data, size); + vverbose("Whole BIOP, size=%u", size); + vhexdump((unsigned char *) data, size); /* * we may get 0, 1 or more BIOP messages in a single block @@ -65,53 +65,53 @@ || data->message_type != BIOP_MSG_TYPE) fatal("Invalid BIOP header"); size = biop_uint32(data->byte_order, data->message_size); -// printf("BIOP message_size=%u\n", size); + vverbose("BIOP message_size=%u", size); if(bytes_left < sizeof(struct BIOPMessageHeader) + size) fatal("Not enough BIOP data"); /* process MessageSubHeader */ subhdr = ((unsigned char *) data) + sizeof(struct BIOPMessageHeader); -// hexdump(subhdr, size); + vhexdump(subhdr, size); subhdr += biop_sequence255(subhdr, &key); -// printf("objectKey:\n"); -// hexdump(key.data, key.size); + vverbose("objectKey:"); + vhexdump(key.data, key.size); subhdr += biop_sequence(data->byte_order, subhdr, &kind); -// printf("objectKind: '%.*s'\n", kind.size, kind.data); + vverbose("objectKind: '%.*s'", kind.size, kind.data); subhdr += biop_sequence65535(data->byte_order, subhdr, &info); -// printf("objectInfo:\n"); -// hexdump(info.data, info.size); + vverbose("objectInfo:"); + vhexdump(info.data, info.size); subhdr += biop_sequence255(subhdr, &service_context); -// printf("serviceContextList:\n"); -// hexdump(service_context.data, service_context.size); + vverbose("serviceContextList:"); + vhexdump(service_context.data, service_context.size); subhdr += biop_sequence(data->byte_order, subhdr, &body); -// printf("messageBody: %u bytes\n", body.size); + vverbose("messageBody: %u bytes", body.size); /* decode the message body, based on the objectKind field */ if(strcmp(kind.data, BIOP_DIR) == 0) { /* a directory */ - printf("DSM::Directory\n"); + verbose("DSM::Directory"); dirname = make_dir(kind.data, car->current_pid, mod->download_id, mod->module_id, key.data, key.size); process_biop_dir(data->byte_order, dirname, car, body.data, body.size); } else if(strcmp(kind.data, BIOP_SERVICEGATEWAY) == 0) { /* the service gateway is the root directory */ - printf("DSM::ServiceGateway\n"); + verbose("DSM::ServiceGateway"); dirname = make_dir(kind.data, car->current_pid, mod->download_id, mod->module_id, key.data, key.size); process_biop_dir(data->byte_order, dirname, car, body.data, body.size); } else if(strcmp(kind.data, BIOP_FILE) == 0) { /* a file */ - printf("DSM::File\n"); + verbose("DSM::File"); (void) biop_sequence(data->byte_order, body.data, &file); -// hexdump(file.data, file.size); + vhexdump(file.data, file.size); save_file(kind.data, car->current_pid, mod->download_id, mod->module_id, key.data, key.size, file.data, file.size); } else if(strcmp(kind.data, BIOP_STREAM) == 0) { /* a stream */ - printf("DSM::Stream\n"); -// hexdump(body.data, body.size); + verbose("DSM::Stream"); + vhexdump(body.data, body.size); /* * just save it for now * could parse the Taps to make it easier for the browser @@ -121,8 +121,8 @@ else if(strcmp(kind.data, BIOP_STREAMEVENT) == 0) { /* a stream event */ - printf("BIOP::StreamEvent\n"); -// hexdump(body.data, body.size); + verbose("BIOP::StreamEvent"); + vhexdump(body.data, body.size); /* * just save it for now * could parse it to make it easier for the browser @@ -161,28 +161,28 @@ nbindings = biop_uint16(byte_order, *((uint16_t *) data)); data += 2; -// printf("binding_count: %u\n", nbindings); + vverbose("binding_count: %u", nbindings); for(i=0; i<nbindings; i++) { -// printf(" binding %u\n", i); + vverbose(" binding %u", i); nnames = *data; data += 1; -// printf(" nameComponents: %u\n", nnames); + vverbose(" nameComponents: %u", nnames); /* only expecting 1 name, so just use the last one */ for(j=0; j<nnames; j++) { data += biop_sequence255(data, &name); -// printf(" name %u: '%.*s'\n", j, name.size, name.data); + vverbose(" name %u: '%.*s'", j, name.size, name.data); data += biop_sequence255(data, &kind); -// printf(" kind %u: '%.*s'\n", j, kind.size, kind.data); + vverbose(" kind %u: '%.*s'", j, kind.size, kind.data); } /* bindingType */ type = *data; data += 1; -// printf(" bindingType: %u\n", type); + vverbose(" bindingType: %u", type); /* objectRef */ -// printf(" objectRef:\n"); + vverbose(" objectRef:"); data += process_iop_ior(byte_order, data, &ior); /* make sure we are downloading the PID with this file on */ pid = stream2pid(&car->assoc, ior.association_tag); @@ -196,8 +196,8 @@ add_dir_entry(dirname, name.data, name.size, kind.data, pid, ior.carousel_id, ior.module_id, ior.key.data, ior.key.size); /* objectInfo */ data += biop_sequence65535(byte_order, data, &info); -// printf(" objectInfo:\n"); -// hexdump(info.data, info.size); + vverbose(" objectInfo:"); + vhexdump(info.data, info.size); } return; @@ -213,8 +213,8 @@ struct biop_iop_ior ior; uint16_t elementary_pid; - printf("BIOP::ServiceGatewayInfo\n"); -// hexdump(data, size); + verbose("BIOP::ServiceGatewayInfo"); + vhexdump(data, size); data += process_iop_ior(BIOP_BIGENDIAN, data, &ior); @@ -244,23 +244,23 @@ uint8_t taps_count; uint32_t transaction_id; -// printf("IOP::IOR\n"); + vverbose("IOP::IOR"); /* typeId - "dir\0", "fil\0", etc */ data += biop_sequence(byte_order, data, &type); -// printf(" typeId: '%.*s'\n", type.size, type.data); + vverbose(" typeId: '%.*s'", type.size, type.data); nprofiles = biop_uint32(byte_order, *((uint32_t *) data)); data += 4; -// printf(" taggedProfiles_count: %u\n", nprofiles); + vverbose(" taggedProfiles_count: %u", nprofiles); for(i=0; i<nprofiles; i++) { -// printf(" IOP::taggedProfile %u\n", i); + vverbose(" IOP::taggedProfile %u", i); tag = biop_uint32(byte_order, *((uint32_t *) data)); data += 4; data += biop_sequence(byte_order, data, &profile); if(tag == TAG_BIOP) { -// printf(" BIOPProfileBody:\n"); + vverbose(" BIOPProfileBody:"); /* profile_data_byte_order */ profile_bo = *(profile.data); profile.data += 1; @@ -275,11 +275,11 @@ /* carouselId */ ior->carousel_id = biop_uint32(profile_bo, *((uint32_t *) profile.data)); profile.data += 4; -// printf(" carouselId: %u\n", ior->carousel_id); + vverbose(" carouselId: %u", ior->carousel_id); /* moduleId */ ior->module_id = biop_uint16(profile_bo, *((uint32_t *) profile.data)); profile.data += 2; -// printf(" moduleId: %u\n", ior->module_id); + vverbose(" moduleId: %u", ior->module_id); /* BIOP version */ if(profile.data[0] != BIOP_VSN_MAJOR || profile.data[1] != BIOP_VSN_MINOR) @@ -287,30 +287,30 @@ profile.data += 2; /* objectKey */ profile.data += biop_sequence255(profile.data, &ior->key); -// printf(" objectKey: '%.*s'\n", ior->key.size, ior->key.data); -// hexdump(ior->key.data, ior->key.size); + vverbose(" objectKey: '%.*s'", ior->key.size, ior->key.data); + vhexdump(ior->key.data, ior->key.size); /* DSM::ConnBinder */ if(biop_uint32(profile_bo, *((uint32_t *) profile.data)) != TAG_ConnBinder) fatal("Expecting DSM::ConnBinder"); profile.data += 4; -// printf(" DSM::ConnBinder\n"); + vverbose(" DSM::ConnBinder"); /* component_data_length = *profile.data */ profile.data += 1; taps_count = *profile.data; profile.data += 1; -// printf(" taps_count: %u\n", taps_count); + vverbose(" taps_count: %u", taps_count); if(taps_count > 0) { -// printf(" BIOP::Tap\n"); + vverbose(" BIOP::Tap"); /* id = biop_uint16(profile_bo, *((uint16_t *) profile.data)) */ profile.data += 2; if(biop_uint16(profile_bo, *((uint16_t *) profile.data)) != BIOP_DELIVERY_PARA_USE) fatal("Expecting BIOP_DELIVERY_PARA_USE"); profile.data += 2; -// printf(" use: BIOP_DELIVERY_PARA_USE\n"); + vverbose(" use: BIOP_DELIVERY_PARA_USE"); ior->association_tag = biop_uint16(profile_bo, *((uint16_t *) profile.data)); profile.data += 2; -// printf(" association_tag: %u\n", ior->association_tag); + vverbose(" association_tag: %u", ior->association_tag); if(*profile.data != SELECTOR_TYPE_MESSAGE_LEN) fatal("Expecting selector_length %u", SELECTOR_TYPE_MESSAGE_LEN); profile.data += 1; @@ -319,7 +319,7 @@ profile.data += 2; transaction_id = biop_uint32(profile_bo, *((uint32_t *) profile.data)); profile.data += 4; -// printf(" transaction_id: %u\n", transaction_id); + vverbose(" transaction_id: %u", transaction_id); } } else if(tag == TAG_LITE_OPTIONS) Modified: redbutton-download/trunk/carousel.c =================================================================== --- redbutton-download/trunk/carousel.c 2006-06-22 09:06:51 UTC (rev 122) +++ redbutton-download/trunk/carousel.c 2006-06-24 08:55:47 UTC (rev 123) @@ -59,7 +59,7 @@ else if(ntohs(dsmcc->messageId) == DSMCC_MSGID_DDB) process_ddb(car, (struct DownloadDataBlock *) dsmccMessage(dsmcc), ntohl(dsmcc->transactionId), DDB_blockDataLength(dsmcc)); else - printf("Unknown DSMCC messageId: 0x%x\n", ntohs(dsmcc->messageId)); + error("Unknown DSMCC messageId: 0x%x", ntohs(dsmcc->messageId)); } } while(!done); @@ -73,27 +73,25 @@ unsigned int nmodules; unsigned int i; - printf("DownloadInfoIndication\n"); -// printf("transactionId: %u\n", transactionId); -// printf("downloadId: %u\n", ntohl(dii->downloadId)); + verbose("DownloadInfoIndication"); + vverbose("transactionId: %u", transactionId); + vverbose("downloadId: %u", ntohl(dii->downloadId)); nmodules = DII_numberOfModules(dii); -// printf("numberOfModules: %u\n", nmodules); + vverbose("numberOfModules: %u", nmodules); for(i=0; i<nmodules; i++) { struct DIIModule *mod; mod = DII_module(dii, i); -// printf("Module %u\n", i); -// printf(" moduleId: %u\n", ntohs(mod->moduleId)); -// printf(" moduleVersion: %u\n", mod->moduleVersion); -// printf(" moduleSize: %u\n", ntohl(mod->moduleSize)); + vverbose("Module %u", i); + vverbose(" moduleId: %u", ntohs(mod->moduleId)); + vverbose(" moduleVersion: %u", mod->moduleVersion); + vverbose(" moduleSize: %u", ntohl(mod->moduleSize)); if(find_module(car, ntohs(mod->moduleId), mod->moduleVersion, ntohl(dii->downloadId)) == NULL) add_module(car, dii, mod); } -// printf("\n"); - return; } @@ -102,7 +100,7 @@ { uint16_t elementary_pid; - printf("DownloadServerInitiate\n"); + verbose("DownloadServerInitiate"); /* * BBC1 (for example) just broadcasts a DSI @@ -122,8 +120,6 @@ /* make sure we are downloading data from the PID the DSI refers to */ add_dsmcc_pid(car, elementary_pid); -// printf("\n"); - return; } @@ -133,22 +129,20 @@ unsigned char *block; struct module *mod; - printf("DownloadDataBlock\n"); -// printf("downloadId: %u\n", downloadId); + verbose("DownloadDataBlock"); -// printf("moduleId: %u\n", ntohs(ddb->moduleId)); -// printf("moduleVersion: %u\n", ddb->moduleVersion); -// printf("blockNumber: %u\n", ntohs(ddb->blockNumber)); + vverbose("downloadId: %u", downloadId); + vverbose("moduleId: %u", ntohs(ddb->moduleId)); + vverbose("moduleVersion: %u", ddb->moduleVersion); + vverbose("blockNumber: %u", ntohs(ddb->blockNumber)); -// printf("blockLength: %u\n", blockLength); + vverbose("blockLength: %u", blockLength); block = DDB_blockDataByte(ddb); -// hexdump(block, blockLength); + vhexdump(block, blockLength); if((mod = find_module(car, ntohs(ddb->moduleId), ddb->moduleVersion, downloadId)) != NULL) download_block(car, mod, ntohs(ddb->blockNumber), block, blockLength); -// printf("\n"); - return; } Modified: redbutton-download/trunk/findmheg.c =================================================================== --- redbutton-download/trunk/findmheg.c 2006-06-22 09:06:51 UTC (rev 122) +++ redbutton-download/trunk/findmheg.c 2006-06-24 08:55:47 UTC (rev 123) @@ -151,7 +151,7 @@ if(!found) fatal("Unable to find programme_map_PID for service_id %u", service_id); -// printf("programme_map_PID: 0x%x\n", map_pid); + vverbose("programme_map_PID: 0x%x", map_pid); /* get the PMT */ if((pmt = read_table(_car.demux_device, map_pid, TID_PMT, timeout)) == NULL) @@ -196,7 +196,7 @@ { _car.carousel_id = ntohl(desc->carousel_id); add_dsmcc_pid(&_car, elementary_pid); -// printf("pid=0x%x carousel_id=%u\n", elementary_pid, _car.carousel_id); + vverbose("pid=0x%x carousel_id=%u", elementary_pid, _car.carousel_id); } } else if(desc_tag == TAG_STREAM_ID_DESCRIPTOR) @@ -204,7 +204,7 @@ struct stream_id_descriptor *desc; desc = (struct stream_id_descriptor *) &pmt[offset]; component_tag = desc->component_tag; -// printf("pid=0x%x component_tag=0x%x\n", elementary_pid, component_tag); + vverbose("pid=0x%x component_tag=0x%x", elementary_pid, component_tag); add_assoc(&_car.assoc, elementary_pid, desc->component_tag, stream_type); } else if(desc_tag == TAG_LANGUAGE_DESCRIPTOR && is_audio_stream(stream_type)) Modified: redbutton-download/trunk/fs.c =================================================================== --- redbutton-download/trunk/fs.c 2006-06-22 09:06:51 UTC (rev 122) +++ redbutton-download/trunk/fs.c 2006-06-24 08:55:47 UTC (rev 123) @@ -88,7 +88,7 @@ fclose(f); - printf("Created file '%s'\n", filename); + verbose("Created file '%s'", filename); return; } @@ -127,7 +127,7 @@ if(symlink(realfile, linkfile) < 0 && errno != EEXIST) fatal("Unable to create link '%s' to '%s': %s", linkfile, realfile, strerror(errno)); - printf("Added service root '%s' -> '%s'\n", linkfile, realfile); + verbose("Added service root '%s' -> '%s'", linkfile, realfile); return; } @@ -157,7 +157,7 @@ if(mkdir(_dirname, 0755) < 0 && errno != EEXIST) fatal("Unable to create directory '%s': %s", _dirname, strerror(errno)); - printf("Created directory '%s'\n", _dirname); + verbose("Created directory '%s'", _dirname); return _dirname; } @@ -189,7 +189,7 @@ if(symlink(realfile, linkfile) < 0) fatal("Unable to create link '%s' to '%s': %s", linkfile, realfile, strerror(errno)); - printf("Added directory entry '%s' -> '%s'\n", linkfile, realfile); + verbose("Added directory entry '%s' -> '%s'", linkfile, realfile); return; } Modified: redbutton-download/trunk/list.c =================================================================== --- redbutton-download/trunk/list.c 2006-06-22 09:06:51 UTC (rev 122) +++ redbutton-download/trunk/list.c 2006-06-24 08:55:47 UTC (rev 123) @@ -92,8 +92,8 @@ } else { -// printf("desc_tag: %u\n", desc_tag); -// hexdump(&sds[offset], desc_length); + vverbose("desc_tag: %u", desc_tag); + vhexdump(&sds[offset], desc_length); offset += desc_length; } desc_loop_length -= desc_length; Modified: redbutton-download/trunk/listen.c =================================================================== --- redbutton-download/trunk/listen.c 2006-06-22 09:06:51 UTC (rev 122) +++ redbutton-download/trunk/listen.c 2006-06-24 08:55:47 UTC (rev 123) @@ -140,7 +140,7 @@ /* parent continues */ /* listen on the given ip:port */ - printf("Listening on %s:%u\n", inet_ntoa(listen_data->addr.sin_addr), ntohs(listen_data->addr.sin_port)); + verbose("Listening on %s:%u", inet_ntoa(listen_data->addr.sin_addr), ntohs(listen_data->addr.sin_port)); if((listen_sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) fatal("socket: %s", strerror(errno)); @@ -218,7 +218,7 @@ size_t len; bool quit; - printf("Connection from %s:%d\n", inet_ntoa(client_addr->sin_addr), ntohs(client_addr->sin_port)); + verbose("Connection from %s:%d", inet_ntoa(client_addr->sin_addr), ntohs(client_addr->sin_port)); if((client = fdopen(client_sock, "r+")) == NULL) return; @@ -245,7 +245,7 @@ fclose(client); - printf("Connection from %s:%d closed\n", inet_ntoa(client_addr->sin_addr), ntohs(client_addr->sin_port)); + verbose("Connection from %s:%d closed", inet_ntoa(client_addr->sin_addr), ntohs(client_addr->sin_port)); return; } Modified: redbutton-download/trunk/module.c =================================================================== --- redbutton-download/trunk/module.c 2006-06-22 09:06:51 UTC (rev 122) +++ redbutton-download/trunk/module.c 2006-06-24 08:55:47 UTC (rev 123) @@ -83,7 +83,7 @@ mod->size = ntohl(diimod->moduleSize); mod->data = safe_malloc(mod->size); - printf("add_module: nmodules=%u module=%u size=%u\n", car->nmodules, mod->module_id, mod->size); + verbose("add_module: nmodules=%u module=%u size=%u", car->nmodules, mod->module_id, mod->size); return mod; } @@ -132,18 +132,18 @@ mod->blocks_left --; - printf("download_block: module=%u block=%u left=%u\n", mod->module_id, block, mod->blocks_left); + verbose("download_block: module=%u block=%u left=%u", mod->module_id, block, mod->blocks_left); /* have we got it all yet */ if(mod->blocks_left == 0) { - printf("got module %u (size=%u)\n", mod->module_id, mod->size); + verbose("got module %u (size=%u)", mod->module_id, mod->size); /* if it doesn't start with 'BIOP' assume it is compressed */ if(strncmp(mod->data, BIOP_MAGIC_STR, BIOP_MAGIC_LEN) != 0) { -// hexdump(mod->data, mod->size); + vhexdump(mod->data, mod->size); uncompress_module(mod); - printf("uncompressed size=%u\n", mod->size); + verbose("uncompressed size=%u", mod->size); } process_biop(car, mod, (struct BIOPMessageHeader *) mod->data, mod->size); /* we can free the data now, keep got_block so we don't download it again */ Modified: redbutton-download/trunk/rb-download.c =================================================================== --- redbutton-download/trunk/rb-download.c 2006-06-22 09:06:51 UTC (rev 122) +++ redbutton-download/trunk/rb-download.c 2006-06-24 08:55:47 UTC (rev 123) @@ -1,5 +1,5 @@ /* - * rb-download [-a <adapter>] [-b <base_dir>] [-t <timeout>] [-l[<listen-addr>]] [-c <carousel_id>] [<service_id>] + * rb-download [-v] [-a <adapter>] [-b <base_dir>] [-t <timeout>] [-l[<listen-addr>]] [-c <carousel_id>] [<service_id>] * * Download the DVB Object Carousel for the given channel onto the local hard disc * files will be stored under the current dir if no -b option is given @@ -23,6 +23,8 @@ * NOTE: because -l may or may not take an argument, you must not put a space between the -l and the value * (otherwise, "rb-download -l 1234", is ambiguous - listen on port 1234 or use service_id 1234?) * + * -v is verbose/debug mode, use more v's for more verbosity + * * the file structure will be: * ./services/<service_id> * this is a symlink to the root of the carousel @@ -72,6 +74,8 @@ #define DEFAULT_LISTEN_ADDR INADDR_ANY #define DEFAULT_LISTEN_PORT 10101 +static int _verbose = 0; + void usage(char *); int @@ -87,7 +91,7 @@ struct carousel *car; int arg; - while((arg = getopt(argc, argv, "a:b:t:l::c:")) != EOF) + while((arg = getopt(argc, argv, "a:b:t:l::c:v")) != EOF) { switch(arg) { @@ -118,6 +122,10 @@ carousel_id = strtoul(optarg, NULL, 0); break; + case 'v': + _verbose ++; + break; + default: usage(prog_name); break; @@ -132,9 +140,9 @@ { service_id = strtoul(argv[optind], NULL, 0); car = find_mheg(adapter, timeout, service_id, carousel_id); - printf("Carousel ID=%u\n", car->carousel_id); - printf("Video PID=%u\n", car->video_pid); - printf("Audio PID=%u\n", car->audio_pid); + verbose("Carousel ID=%u", car->carousel_id); + verbose("Video PID=%u", car->video_pid); + verbose("Audio PID=%u", car->audio_pid); if(listen) { listen_data.carousel = car; @@ -151,9 +159,51 @@ } void +verbose(char *message, ...) +{ + va_list ap; + + if(_verbose) + { + va_start(ap, message); + vprintf(message, ap); + printf("\n"); + va_end(ap); + } + + return; +} + +void +vverbose(char *message, ...) +{ + va_list ap; + + if(_verbose > 1) + { + va_start(ap, message); + vprintf(message, ap); + printf("\n"); + va_end(ap); + } + + return; +} + +void +vhexdump(unsigned char *data, size_t nbytes) +{ + if(_verbose > 1) + hexdump(data, nbytes); + + return; +} + +void usage(char *prog_name) { - fatal("Usage: %s [-a <adapter>] " + fatal("Usage: %s [-v] " + "[-a <adapter>] " "[-b <base_dir>] " "[-t <timeout>] " "[-l[<listen-addr>]] " Modified: redbutton-download/trunk/utils.c =================================================================== --- redbutton-download/trunk/utils.c 2006-06-22 09:06:51 UTC (rev 122) +++ redbutton-download/trunk/utils.c 2006-06-24 08:55:47 UTC (rev 123) @@ -110,12 +110,12 @@ void error(char *message, ...) { - va_list ap; + va_list ap; - va_start(ap, message); - vfprintf(stderr, message, ap); + va_start(ap, message); + vfprintf(stderr, message, ap); fprintf(stderr, "\n"); - va_end(ap); + va_end(ap); return; } @@ -123,12 +123,12 @@ void fatal(char *message, ...) { - va_list ap; + va_list ap; - va_start(ap, message); - vfprintf(stderr, message, ap); + va_start(ap, message); + vfprintf(stderr, message, ap); fprintf(stderr, "\n"); - va_end(ap); + va_end(ap); exit(EXIT_FAILURE); } Modified: redbutton-download/trunk/utils.h =================================================================== --- redbutton-download/trunk/utils.h 2006-06-22 09:06:51 UTC (rev 122) +++ redbutton-download/trunk/utils.h 2006-06-24 08:55:47 UTC (rev 123) @@ -50,5 +50,10 @@ void error(char *, ...); void fatal(char *, ...); +/* in rb-download.c */ +void verbose(char *, ...); +void vverbose(char *, ...); +void vhexdump(unsigned char *, size_t); + #endif /* __UTILS_H__ */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |