Mercurial > mxe-octave
annotate src/msvc-gcab-1.patch @ 3256:7fb479d0241c
Update build tools for native mingw
* src/build-m4.mk: do nothing for native mingw build
* Makefile.in:
- add bison, m4 as natve mingw, and python as jit build requirements.
- remove build-bison as a mingw build dependancy
* index.html: Add msys-bison to mingw required packages and mention ghostscript and python.
author | John Donoghue <john.donoghue@ieee.org> |
---|---|
date | Thu, 26 Sep 2013 21:18:39 -0400 |
parents | 5481abb52912 |
children |
rev | line source |
---|---|
3136
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
1 diff -ur gcab-0.4-orig/Makefile.in gcab-0.4/Makefile.in |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
2 --- gcab-0.4-orig/Makefile.in 2013-02-08 10:38:12 -0500 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
3 +++ gcab-0.4/Makefile.in 2013-07-13 17:02:16 -0400 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
4 @@ -474,8 +474,8 @@ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
5 libgcab_1_0_la_LIBADD = -lz $(GLIB_LIBS) |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
6 libgcab_1_0_la_LDFLAGS = \ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
7 -version-info 0:0:0 \ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
8 - -Wl,--version-script=${srcdir}/libgcab.syms \ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
9 -no-undefined \ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
10 + -export-symbols-regex "gcab_.*" \ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
11 $(NULL) |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
12 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
13 libgcab_1_0_la_DEPENDENCIES = libgcab.syms |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
14 diff -ur gcab-0.4-orig/gcab.c gcab-0.4/gcab.c |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
15 --- gcab-0.4-orig/gcab.c 2013-02-08 10:34:05 -0500 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
16 +++ gcab-0.4/gcab.c 2013-07-13 16:40:01 -0400 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
17 @@ -94,6 +94,14 @@ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
18 { NULL } |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
19 }; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
20 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
21 + gchar *s; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
22 + GCancellable *cancellable; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
23 + GCabCabinet *cabinet; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
24 + GCabFolder *folder; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
25 + GFile *outputfile; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
26 + GOutputStream *output; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
27 + GFile *cwd; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
28 + |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
29 setlocale (LC_ALL, ""); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
30 textdomain (GETTEXT_PACKAGE); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
31 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
32 @@ -105,7 +113,7 @@ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
33 g_set_prgname (PACKAGE_NAME); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
34 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
35 context = g_option_context_new (_("- create a Cabinet file")); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
36 - gchar *s = g_strdup_printf (_("Report bugs to <%s>"), PACKAGE_BUGREPORT); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
37 + s = g_strdup_printf (_("Report bugs to <%s>"), PACKAGE_BUGREPORT); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
38 g_option_context_set_description (context, s); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
39 g_free(s); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
40 g_option_context_set_summary (context, _("\ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
41 @@ -129,12 +137,8 @@ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
42 if (!args || args[0] == NULL) |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
43 gcab_error (_("cabinet file must be specified.")); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
44 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
45 - GCancellable *cancellable = g_cancellable_new (); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
46 - GCabCabinet *cabinet = gcab_cabinet_new (); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
47 - GCabFolder *folder; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
48 - GFile *outputfile; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
49 - GOutputStream *output; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
50 - GFile *cwd; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
51 + cancellable = g_cancellable_new (); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
52 + cabinet = gcab_cabinet_new (); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
53 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
54 if (list || extract) { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
55 GFile *file = g_file_new_for_commandline_arg (args[0]); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
56 diff -ur gcab-0.4-orig/libgcab/cabinet.c gcab-0.4/libgcab/cabinet.c |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
57 --- gcab-0.4-orig/libgcab/cabinet.c 2013-02-08 10:12:17 -0500 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
58 +++ gcab-0.4/libgcab/cabinet.c 2013-07-13 16:58:14 -0400 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
59 @@ -388,12 +388,15 @@ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
60 guint8 *data, size_t size, gsize *bytes_written, |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
61 GCancellable *cancellable, GError **error) |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
62 { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
63 + CHECKSUM datacsum; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
64 + GOutputStream *stream; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
65 + |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
66 if (!cdata_set(cd, type, data, size)) |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
67 return FALSE; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
68 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
69 - CHECKSUM datacsum = compute_checksum(cd->in, cd->ncbytes, 0); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
70 + datacsum = compute_checksum(cd->in, cd->ncbytes, 0); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
71 cd->checksum = compute_checksum ((guint8*)&cd->ncbytes, 4, datacsum); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
72 - GOutputStream *stream = g_filter_output_stream_get_base_stream (G_FILTER_OUTPUT_STREAM (out)); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
73 + stream = g_filter_output_stream_get_base_stream (G_FILTER_OUTPUT_STREAM (out)); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
74 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
75 *bytes_written = 0; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
76 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
77 @@ -482,10 +485,12 @@ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
78 } |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
79 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
80 if (compression == GCAB_COMPRESSION_MSZIP) { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
81 + z_stream *z; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
82 + |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
83 if (cd->in[0] != 'C' || cd->in[1] != 'K') |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
84 goto end; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
85 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
86 - z_stream *z = &cd->z; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
87 + z = &cd->z; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
88 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
89 z->avail_in = cd->ncbytes - 2; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
90 z->next_in = cd->in + 2; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
91 diff -ur gcab-0.4-orig/libgcab/gcab-cabinet.c gcab-0.4/libgcab/gcab-cabinet.c |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
92 --- gcab-0.4-orig/libgcab/gcab-cabinet.c 2013-02-08 10:10:26 -0500 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
93 +++ gcab-0.4/libgcab/gcab-cabinet.c 2013-07-13 16:49:56 -0400 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
94 @@ -62,8 +62,10 @@ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
95 static void |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
96 gcab_cabinet_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
97 { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
98 + GCabCabinet *self; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
99 + |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
100 g_return_if_fail (GCAB_IS_CABINET (object)); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
101 - GCabCabinet *self = GCAB_CABINET (object); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
102 + self = GCAB_CABINET (object); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
103 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
104 switch (prop_id) { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
105 case PROP_RESERVED: |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
106 @@ -80,8 +82,10 @@ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
107 static void |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
108 gcab_cabinet_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
109 { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
110 + GCabCabinet *self; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
111 + |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
112 g_return_if_fail (GCAB_IS_CABINET (object)); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
113 - GCabCabinet *self = GCAB_CABINET (object); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
114 + self = GCAB_CABINET (object); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
115 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
116 switch (prop_id) { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
117 case PROP_RESERVED: |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
118 @@ -178,22 +182,16 @@ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
119 GError **error) |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
120 { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
121 cheader_t header = { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
122 - .offsetfiles = CFI_START, // CFHEADER + 1 * CFFOLDER |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
123 - .nfolders = 1, // a single CAB folder is enough |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
124 + 0, 0, 0, |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
125 + /* .offsetfiles =*/ CFI_START, // CFHEADER + 1 * CFFOLDER |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
126 + 0, 0, 0, |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
127 + /* .nfolders =*/ 1, // a single CAB folder is enough |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
128 }; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
129 cfolder_t folder = { 0, }; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
130 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
131 - g_return_val_if_fail (GCAB_IS_CABINET (self), FALSE); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
132 - g_return_val_if_fail (G_IS_OUTPUT_STREAM (out), FALSE); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
133 - g_return_val_if_fail (G_IS_SEEKABLE (out), FALSE); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
134 - g_return_val_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable), FALSE); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
135 - g_return_val_if_fail (!error || *error == NULL, FALSE); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
136 - /* FIXME: current limitation of 1 folder */ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
137 - g_return_val_if_fail (self->folders->len == 1, FALSE); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
138 - |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
139 - GCabFolder *cabfolder = g_ptr_array_index (self->folders, 0); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
140 + GCabFolder *cabfolder; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
141 GCabFile *file; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
142 - gsize nfiles = gcab_folder_get_nfiles (cabfolder); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
143 + gsize nfiles; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
144 GInputStream *in = NULL; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
145 GDataOutputStream *dstream = NULL; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
146 gboolean success = FALSE; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
147 @@ -206,6 +204,17 @@ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
148 cfile_t *prevf = NULL; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
149 int i; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
150 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
151 + g_return_val_if_fail (GCAB_IS_CABINET (self), FALSE); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
152 + g_return_val_if_fail (G_IS_OUTPUT_STREAM (out), FALSE); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
153 + g_return_val_if_fail (G_IS_SEEKABLE (out), FALSE); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
154 + g_return_val_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable), FALSE); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
155 + g_return_val_if_fail (!error || *error == NULL, FALSE); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
156 + /* FIXME: current limitation of 1 folder */ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
157 + g_return_val_if_fail (self->folders->len == 1, FALSE); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
158 + |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
159 + cabfolder = g_ptr_array_index (self->folders, 0); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
160 + nfiles = gcab_folder_get_nfiles (cabfolder); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
161 + |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
162 dstream = g_data_output_stream_new (out); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
163 g_data_output_stream_set_byte_order (dstream, G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
164 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
165 @@ -342,20 +351,23 @@ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
166 GCancellable *cancellable, |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
167 GError **error) |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
168 { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
169 + gboolean success = FALSE; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
170 + cheader_t cheader; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
171 + int i; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
172 + GDataInputStream *in; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
173 + GPtrArray *folders; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
174 + |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
175 g_return_val_if_fail (GCAB_IS_CABINET (self), FALSE); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
176 g_return_val_if_fail (G_IS_INPUT_STREAM (stream), FALSE); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
177 g_return_val_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable), FALSE); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
178 g_return_val_if_fail (!error || *error == NULL, FALSE); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
179 g_return_val_if_fail (self->folders->len == 0, FALSE); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
180 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
181 - gboolean success = FALSE; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
182 - cheader_t cheader; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
183 - int i; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
184 - GDataInputStream *in = g_data_input_stream_new (stream); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
185 + in = g_data_input_stream_new (stream); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
186 g_filter_input_stream_set_close_base_stream (G_FILTER_INPUT_STREAM (in), FALSE); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
187 g_data_input_stream_set_byte_order (in, G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
188 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
189 - GPtrArray *folders = self->folders; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
190 + folders = self->folders; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
191 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
192 if (!cheader_read (&cheader, in, cancellable, error)) |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
193 goto end; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
194 @@ -367,10 +379,12 @@ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
195 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
196 for (i = 0; i < cheader.nfolders; i++) { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
197 cfolder_t cfolder = { 0, }; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
198 + GCabFolder *folder; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
199 + |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
200 if (!cfolder_read (&cfolder, cheader.res_folder, in, cancellable, error)) |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
201 goto end; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
202 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
203 - GCabFolder *folder = gcab_folder_new_with_cfolder (&cfolder, stream); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
204 + folder = gcab_folder_new_with_cfolder (&cfolder, stream); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
205 if (cfolder.reserved) |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
206 g_object_set (folder, "reserved", |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
207 g_byte_array_new_take (cfolder.reserved, cheader.res_folder), |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
208 @@ -381,11 +395,14 @@ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
209 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
210 for (i = 0; i < cheader.nfiles; i++) { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
211 cfile_t cfile = { 0, }; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
212 + GCabFile *file; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
213 + GCabFolder *folder; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
214 + |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
215 if (!cfile_read (&cfile, in, cancellable, error)) |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
216 goto end; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
217 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
218 - GCabFile *file = gcab_file_new_with_cfile (&cfile); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
219 - GCabFolder *folder = g_ptr_array_index (folders, cfile.index); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
220 + file = gcab_file_new_with_cfile (&cfile); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
221 + folder = g_ptr_array_index (folders, cfile.index); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
222 if (!gcab_folder_add_file (folder, file, FALSE, cancellable, error)) { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
223 g_object_unref (file); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
224 goto end; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
225 diff -ur gcab-0.4-orig/libgcab/gcab-file.c gcab-0.4/libgcab/gcab-file.c |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
226 --- gcab-0.4-orig/libgcab/gcab-file.c 2013-01-17 21:20:09 -0500 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
227 +++ gcab-0.4/libgcab/gcab-file.c 2013-07-13 16:56:03 -0400 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
228 @@ -69,8 +69,10 @@ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
229 static void |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
230 gcab_file_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
231 { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
232 + GCabFile *self; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
233 + |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
234 g_return_if_fail (GCAB_IS_FILE (object)); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
235 - GCabFile *self = GCAB_FILE (object); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
236 + self = GCAB_FILE (object); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
237 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
238 switch (prop_id) { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
239 case PROP_NAME: |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
240 @@ -88,8 +90,10 @@ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
241 static void |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
242 gcab_file_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
243 { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
244 + GCabFile *self; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
245 + |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
246 g_return_if_fail (GCAB_IS_FILE (object)); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
247 - GCabFile *self = GCAB_FILE(object); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
248 + self = GCAB_FILE(object); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
249 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
250 switch (prop_id) { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
251 case PROP_NAME: |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
252 @@ -220,11 +224,13 @@ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
253 G_GNUC_INTERNAL GCabFile * |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
254 gcab_file_new_with_cfile (const cfile_t *cfile) |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
255 { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
256 + GCabFile *file; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
257 + |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
258 g_return_val_if_fail (cfile != NULL, NULL); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
259 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
260 - GCabFile *file = g_object_new (GCAB_TYPE_FILE, |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
261 - "name", cfile->name, |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
262 - NULL); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
263 + file = g_object_new (GCAB_TYPE_FILE, |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
264 + "name", cfile->name, |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
265 + NULL); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
266 file->cfile = *cfile; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
267 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
268 return file; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
269 diff -ur gcab-0.4-orig/libgcab/gcab-folder.c gcab-0.4/libgcab/gcab-folder.c |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
270 --- gcab-0.4-orig/libgcab/gcab-folder.c 2013-02-08 10:27:33 -0500 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
271 +++ gcab-0.4/libgcab/gcab-folder.c 2013-07-13 16:54:39 -0400 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
272 @@ -60,8 +60,10 @@ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
273 static void |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
274 gcab_folder_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
275 { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
276 + GCabFolder *self; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
277 + |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
278 g_return_if_fail (GCAB_IS_FOLDER (object)); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
279 - GCabFolder *self = GCAB_FOLDER (object); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
280 + self = GCAB_FOLDER (object); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
281 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
282 switch (prop_id) { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
283 case PROP_COMPTYPE: |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
284 @@ -81,8 +83,10 @@ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
285 static void |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
286 gcab_folder_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
287 { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
288 + GCabFolder *self; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
289 + |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
290 g_return_if_fail (GCAB_IS_FOLDER (object)); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
291 - GCabFolder *self = GCAB_FOLDER (object); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
292 + self = GCAB_FOLDER (object); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
293 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
294 switch (prop_id) { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
295 case PROP_COMPRESSION: |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
296 @@ -164,10 +168,12 @@ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
297 GFileType file_type = g_file_info_get_file_type (info); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
298 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
299 if (file_type == G_FILE_TYPE_DIRECTORY) { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
300 + GFileEnumerator *dir; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
301 + |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
302 if (!recurse) |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
303 return TRUE; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
304 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
305 - GFileEnumerator *dir = g_file_enumerate_children (file->file, FILE_ATTRS, 0, NULL, error); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
306 + dir = g_file_enumerate_children (file->file, FILE_ATTRS, 0, NULL, error); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
307 if (*error) { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
308 g_warning ("Couldn't enumerate directory %s: %s", name, (*error)->message); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
309 g_clear_error (error); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
310 @@ -227,16 +233,19 @@ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
311 GError **error) |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
312 { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
313 gboolean success; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
314 + GFile *gfile; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
315 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
316 g_return_val_if_fail (GCAB_IS_FOLDER (self), FALSE); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
317 g_return_val_if_fail (GCAB_IS_FILE (file), FALSE); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
318 g_return_val_if_fail (!error || *error == NULL, FALSE); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
319 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
320 - GFile *gfile = gcab_file_get_file (file); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
321 + gfile = gcab_file_get_file (file); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
322 if (gfile) { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
323 + GFileInfo *info; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
324 + |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
325 g_return_val_if_fail (G_IS_FILE (gfile), FALSE); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
326 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
327 - GFileInfo *info = g_file_query_info (gfile, FILE_ATTRS, 0, NULL, error); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
328 + info = g_file_query_info (gfile, FILE_ATTRS, 0, NULL, error); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
329 if (*error) |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
330 return FALSE; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
331 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
332 @@ -351,18 +360,24 @@ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
333 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
334 for (f = files; f != NULL; f = f->next) { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
335 GCabFile *file = f->data; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
336 + gchar *fname; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
337 + int i = 0, len; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
338 + GFile *gfile; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
339 + GFile *parent; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
340 + u4 usize; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
341 + u4 uoffset; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
342 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
343 if (file_callback && !file_callback (file, callback_data)) |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
344 continue; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
345 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
346 - gchar *fname = g_strdup (gcab_file_get_extract_name (file)); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
347 - int i = 0, len = strlen (fname); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
348 + fname = g_strdup (gcab_file_get_extract_name (file)); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
349 + len = strlen (fname); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
350 for (i = 0; i < len; i++) |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
351 if (fname[i] == '\\') |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
352 fname[i] = '/'; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
353 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
354 - GFile *gfile = g_file_resolve_relative_path (path, fname); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
355 - GFile *parent = g_file_get_parent (gfile); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
356 + gfile = g_file_resolve_relative_path (path, fname); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
357 + parent = g_file_get_parent (gfile); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
358 g_free (fname); |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
359 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
360 if (!g_file_make_directory_with_parents (parent, cancellable, &my_error)) { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
361 @@ -383,8 +398,8 @@ |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
362 if (!out) |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
363 goto end; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
364 |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
365 - u4 usize = file->cfile.usize; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
366 - u4 uoffset = file->cfile.uoffset; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
367 + usize = file->cfile.usize; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
368 + uoffset = file->cfile.uoffset; |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
369 do { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
370 if ((nubytes + cdata.nubytes) <= uoffset) { |
5481abb52912
Add gcab (and MSVC-specific patch)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
371 nubytes += cdata.nubytes; |