From owner-p4-projects@FreeBSD.ORG Mon Jul 7 20:25:54 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 407EB106566C; Mon, 7 Jul 2008 20:25:54 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04CBB106567A for ; Mon, 7 Jul 2008 20:25:54 +0000 (UTC) (envelope-from strauss@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id E684E8FC21 for ; Mon, 7 Jul 2008 20:25:53 +0000 (UTC) (envelope-from strauss@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m67KPrie097800 for ; Mon, 7 Jul 2008 20:25:53 GMT (envelope-from strauss@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m67KPrsO097798 for perforce@freebsd.org; Mon, 7 Jul 2008 20:25:53 GMT (envelope-from strauss@FreeBSD.org) Date: Mon, 7 Jul 2008 20:25:53 GMT Message-Id: <200807072025.m67KPrsO097798@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to strauss@FreeBSD.org using -f From: Anselm Strauss To: Perforce Change Reviews Cc: Subject: PERFORCE change 144846 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jul 2008 20:25:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=144846 Change 144846 by strauss@strauss_marvelman on 2008/07/07 20:25:22 - Now I know why to use format_octal() - Added ZIP writer to Makefile (the good thing about place holder methods is that they compile easily ;-) Affected files ... .. //depot/projects/soc2008/strauss_libarchive/Makefile.am#5 edit .. //depot/projects/soc2008/strauss_libarchive/libarchive/archive_write_set_format_zip.c#2 edit Differences ... ==== //depot/projects/soc2008/strauss_libarchive/Makefile.am#5 (text+ko) ==== @@ -133,6 +133,7 @@ libarchive/archive_write_set_format_pax.c \ libarchive/archive_write_set_format_shar.c \ libarchive/archive_write_set_format_ustar.c \ + libarchive/archive_write_set_format_zip.c \ libarchive/config_freebsd.h \ libarchive/config_windows.h \ libarchive/filter_fork.c \ ==== //depot/projects/soc2008/strauss_libarchive/libarchive/archive_write_set_format_zip.c#2 (text+ko) ==== @@ -104,23 +104,23 @@ memset(&h, 0, sizeof(h)); - h.signature = 0x04034b50; - h.version = 0x0200; /* TODO: Set individually for each file entry. */ - h.flags = 0x0008; /* Flagging bit 3 for using data descriptor. */ - h.compression = 0x0000; /* No compression. */ - h.timedate = 0x0000; /* TODO: Using zero (means standard input) for now. */ + format_octal(0x04034b50, &h.signature, sizeof(h.signature)); + format_octal(0x0200, &h.version, sizeof(h.version)); /* TODO: Set individually for each file entry. */ + format_octal(8, &h.flags, sizeof(h.flags)); /* Flagging bit 3 for using data descriptor. */ + format_octal(0, &h.compression, sizeof(h.compression)); /* No compression. */ + format_octal(0, &h.timedate, sizeof(h.timedate)); /* TODO: Using zero (means standard input) for now. */ /* Next 3 fields are specified in the data descriptor after writing file data. * Can't compute them before having seen the data stream. */ - h.crc32 = h.compressed_size = h.uncompressed_size = 0x00000000; - h.filename_length = sizeof(archive_entry_pathname(entry)); - h.extra_length = 0x0000; + format_octal(0, &h.crc32, sizeof(h.crc32)); + format_octal(0, &h.compressed_size, sizeof(h.compressed_size)); + format_octal(0, &h.uncompressed_size, sizeof(h.uncompressed_size)); + format_octal(sizeof(archive_entry_pathname(entry)), &h.filename_length, sizeof(h.filename_length)); + format_octal(0x0000, &h.extra_length, sizeof(h.extra_length)); /* Not using. */ ret = (a->compressor.write)(a, &h, sizeof(h)); if (ret != ARCHIVE_OK) return (ARCHIVE_FATAL); - zip->entry_bytes_remaining = archive_entry_size(entry); - return (ret); }