]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Issue 269. Stop using deprecated functions in example source code.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sun, 2 Dec 2012 12:34:24 +0000 (21:34 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sun, 2 Dec 2012 12:34:24 +0000 (21:34 +0900)
examples/minitar/minitar.c
examples/untar.c

index 2d6d4208a22acc62ec25a81cecb8ba65b2cb12e9..0ff6263ebf84b9e65bed510716d77cb091f5b590 100644 (file)
@@ -231,27 +231,27 @@ create(const char *filename, int compress, const char **argv)
        switch (compress) {
 #ifndef NO_BZIP2_CREATE
        case 'j': case 'y':
-               archive_write_set_compression_bzip2(a);
+               archive_write_add_filter_bzip2(a);
                break;
 #endif
 #ifndef NO_COMPRESS_CREATE
        case 'Z':
-               archive_write_set_compression_compress(a);
+               archive_write_add_filter_compress(a);
                break;
 #endif
 #ifndef NO_GZIP_CREATE
        case 'z':
-               archive_write_set_compression_gzip(a);
+               archive_write_add_filter_gzip(a);
                break;
 #endif
        default:
-               archive_write_set_compression_none(a);
+               archive_write_add_filter_none(a);
                break;
        }
        archive_write_set_format_ustar(a);
        if (strcmp(filename, "-") == 0)
                filename = NULL;
-       archive_write_open_file(a, filename);
+       archive_write_open_filename(a, filename);
 
        disk = archive_read_disk_new();
 #ifndef NO_LOOKUP
@@ -361,7 +361,7 @@ extract(const char *filename, int do_extract, int flags)
 #endif
        if (filename != NULL && strcmp(filename, "-") == 0)
                filename = NULL;
-       if ((r = archive_read_open_file(a, filename, 10240))) {
+       if ((r = archive_read_open_filename(a, filename, 10240))) {
                errmsg(archive_error_string(a));
                errmsg("\n");
                exit(r);
index c027f7735b870cf1b2f2d6253d3afbf95138e0c0..b22d8361a0127316c2fa79e9aacc81bb1cdad5ef 100644 (file)
@@ -158,8 +158,8 @@ extract(const char *filename, int do_extract, int flags)
         */
        if (filename != NULL && strcmp(filename, "-") == 0)
                filename = NULL;
-       if ((r = archive_read_open_file(a, filename, 10240)))
-               fail("archive_read_open_file()",
+       if ((r = archive_read_open_filename(a, filename, 10240)))
+               fail("archive_read_open_filename()",
                    archive_error_string(a), r);
        for (;;) {
                r = archive_read_next_header(a, &entry);