libmspack 0.0.5 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9c2006f7e3851c3958175cf7db8a47f31b11d013
4
- data.tar.gz: 9f6670e7977d93010b2aefa24d0b6946c77a0ff2
3
+ metadata.gz: 00cc0535e3b700c37af82292b871ca88a1a71a3d
4
+ data.tar.gz: 7569ea79b47d369f1f694001dfd53d4546e56afe
5
5
  SHA512:
6
- metadata.gz: 7b25e651a134cde4efa33846afcd373a0bd3acf77fd43737852860dd390ce2512669d795cfcede7c05953f16865472fb5b2fc3f6d9aff3416c51ba62365e0442
7
- data.tar.gz: 084fdf58252c604bddadec06af9d22e1dd2a7644e6b5bd10bfd324764e7f1b93786cb5b03c905494587c0637b321e1c484bd0858fefc8aeee74fd0b441f7dc68
6
+ metadata.gz: 6cb5fe75e64cd15f829d8912f0a0867c198cc0a8ad0ae61946505c153a3d1f7ed22ab2889601c01eae617c218082ed453c3b7d2a0c5989e34a68c813fb6e4085
7
+ data.tar.gz: 5235ec34f46c8dcd86ccc22e85beb0f26f1d52510c7f158a3181a30255435bdc144ea4aa9a9ccecb8820bf4c31219a9267120453c8806e15abccf42606c4dc96
@@ -1,5 +1,5 @@
1
- language: ruby
2
- rvm:
3
- - 2.0.0
4
- - 1.9.3
5
- - ruby-head
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ - 1.9.3
5
+ - ruby-head
data/.yardopts CHANGED
@@ -1 +1 @@
1
- --markup markdown
1
+ --markup markdown
data/README.md CHANGED
@@ -24,7 +24,7 @@ Or install it yourself as:
24
24
  gems:
25
25
 
26
26
  * `ffi` (required)
27
- * `ffi-compiler` (required for compiling libmspack)
27
+ * `ffi-compiler2` (required for compiling libmspack)
28
28
 
29
29
  ## Usage
30
30
 
data/Rakefile CHANGED
@@ -14,11 +14,25 @@ end
14
14
 
15
15
  desc 'Download libmspack source code'
16
16
  task :libmspack do
17
- require 'svn/downloader'
18
- repo = 'http://svn.code.sf.net/p/libmspack/code/libmspack/trunk/'
19
- path = './ext/libmspack/'
20
- SVN::Downloader.download(repo, path)
21
- File.delete(path + 'mspack/debug.c')
17
+ require 'zip'
18
+ ver = '1.5'
19
+ source = 'https://github.com/kyz/libmspack/archive/v' + ver +'.zip'
20
+ target = './ext/'
21
+ archivedir = 'libmspack-' + ver
22
+ URI.parse(source).open do |tempfile|
23
+ Zip.on_exists_proc = true
24
+ Zip::File.open(tempfile.path) do |file|
25
+ file.each do |entry|
26
+ path = target + entry.name
27
+ FileUtils.mkdir_p(File.dirname(path))
28
+ file.extract(entry, path)
29
+ end
30
+ end
31
+ end
32
+ FileUtils.rm_rf(target + 'libmspack')
33
+ FileUtils.mv(target + archivedir + '/libmspack/trunk/', target + 'libmspack')
34
+ File.delete(target + 'libmspack/mspack/debug.c')
35
+ FileUtils.rm_rf(target + archivedir)
22
36
  end
23
37
 
24
38
  desc 'Compile libmspack source code'
@@ -1,4 +1,5 @@
1
1
  module LibMsPack
2
2
  # Version
3
- VERSION = '0.0.5'
3
+ VERSION = '0.1.0'
4
4
  end
5
+
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ['davispuh@gmail.com']
11
11
  spec.description = 'A library for compressing and decompressing some loosely related Microsoft compression formats, CAB, CHM, HLP, LIT, KWAJ and SZDD.'
12
12
  spec.summary = 'Ruby wrapper for libmspack.'
13
- spec.homepage = 'https://github.com/davispuh/ruby-libmspack'
13
+ spec.homepage = 'https://gitlab.com/davispuh/ruby-libmspack'
14
14
  spec.licenses = ['UNLICENSE', 'LGPL-2']
15
15
 
16
16
  spec.platform = Gem::Platform::RUBY
@@ -22,12 +22,13 @@ Gem::Specification.new do |spec|
22
22
  spec.extensions << 'ext/Rakefile'
23
23
 
24
24
  spec.add_runtime_dependency 'ffi'
25
- spec.add_runtime_dependency 'ffi-compiler', '> 0.1.3'
25
+ spec.add_runtime_dependency 'ffi-compiler2', '>= 2.0.0'
26
26
 
27
27
  spec.add_development_dependency 'bundler'
28
28
  spec.add_development_dependency 'rake'
29
29
  spec.add_development_dependency 'rspec'
30
30
  spec.add_development_dependency 'yard'
31
31
  spec.add_development_dependency 'simplecov'
32
- spec.add_development_dependency 'svn-downloader'
32
+ spec.add_development_dependency 'rubyzip'
33
33
  end
34
+
@@ -5,22 +5,23 @@ describe LibMsPack do
5
5
 
6
6
  describe '.MsPackSelfTest' do
7
7
  it 'should pass' do
8
- LibMsPack.SysSelfTest.should eq(LibMsPack::MSPACK_ERR_OK)
8
+ expect(LibMsPack.SysSelfTest).to eq(LibMsPack::MSPACK_ERR_OK)
9
9
  end
10
10
  end
11
11
 
12
12
  describe '.Version' do
13
13
  it 'should return LIBRARY version' do
14
- LibMsPack.Version(LibMsPack::MSPACK_VER_LIBRARY).should eq(1)
14
+ expect(LibMsPack.Version(LibMsPack::MSPACK_VER_LIBRARY)).to eq(1)
15
15
  end
16
16
 
17
17
  it 'should return SYSTEM version' do
18
- LibMsPack.Version(LibMsPack::MSPACK_VER_SYSTEM).should eq(1)
18
+ expect(LibMsPack.Version(LibMsPack::MSPACK_VER_SYSTEM)).to eq(1)
19
19
  end
20
20
 
21
21
  it 'should return MSCHMD version' do
22
- LibMsPack.Version(LibMsPack::MSPACK_VER_MSCHMD).should eq(2)
22
+ expect(LibMsPack.Version(LibMsPack::MSPACK_VER_MSCHMD)).to eq(2)
23
23
  end
24
24
  end
25
25
 
26
26
  end
27
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libmspack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dāvis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-08 00:00:00.000000000 Z
11
+ date: 2016-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -25,19 +25,19 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: ffi-compiler
28
+ name: ffi-compiler2
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.1.3
33
+ version: 2.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 0.1.3
40
+ version: 2.0.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -109,7 +109,7 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: svn-downloader
112
+ name: rubyzip
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
@@ -140,7 +140,6 @@ files:
140
140
  - UNLICENSE
141
141
  - ext/Rakefile
142
142
  - ext/i386-windows/libmspack.dll
143
- - ext/libmspack.h
144
143
  - ext/libmspack/AUTHORS
145
144
  - ext/libmspack/COPYING.LIB
146
145
  - ext/libmspack/ChangeLog
@@ -263,6 +262,7 @@ files:
263
262
  - ext/libmspack/test/test_files/cabd/search_basic.cab
264
263
  - ext/libmspack/test/test_files/cabd/search_tricky1.cab
265
264
  - ext/libmspack/winbuild.sh
265
+ - ext/x86_64-linux/liblibmspack.so
266
266
  - ext/x86_64-windows/libmspack.dll
267
267
  - lib/libmspack.rb
268
268
  - lib/libmspack/constants.rb
@@ -280,7 +280,7 @@ files:
280
280
  - libmspack.gemspec
281
281
  - spec/libmspack_spec.rb
282
282
  - spec/spec_helper.rb
283
- homepage: https://github.com/davispuh/ruby-libmspack
283
+ homepage: https://gitlab.com/davispuh/ruby-libmspack
284
284
  licenses:
285
285
  - UNLICENSE
286
286
  - LGPL-2
@@ -301,7 +301,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
301
301
  version: '0'
302
302
  requirements: []
303
303
  rubyforge_project:
304
- rubygems_version: 2.2.2
304
+ rubygems_version: 2.6.4
305
305
  signing_key:
306
306
  specification_version: 4
307
307
  summary: Ruby wrapper for libmspack.
@@ -1,259 +0,0 @@
1
- #ifndef LIBMSPACK_H
2
- #define LIBMSPACK_H 1
3
-
4
- #ifndef RBFFI_EXPORT
5
- # ifdef __cplusplus
6
- # define RBFFI_EXPORT extern "C"
7
- # else
8
- # define RBFFI_EXPORT
9
- # endif
10
- #endif
11
-
12
- struct LibMsPack_MsPack_MsPackFile {
13
- int file;
14
- const char * name;
15
- };
16
-
17
- struct LibMsPack_MsPack_MsPackSystem {
18
- struct LibMsPack_MsPack_MsPackFile * (*open)(struct LibMsPack_MsPack_MsPackSystem *, const char *, int);
19
- void (*close)(struct LibMsPack_MsPack_MsPackFile *);
20
- int (*read)(struct LibMsPack_MsPack_MsPackFile *, inout void *, int);
21
- int (*write)(struct LibMsPack_MsPack_MsPackFile *, inout void *, int);
22
- int (*seek)(struct LibMsPack_MsPack_MsPackFile *, off_t, int);
23
- off_t (*tell)(struct LibMsPack_MsPack_MsPackFile *);
24
- void (*message)(struct LibMsPack_MsPack_MsPackFile *, const char *, ...);
25
- void * (*alloc)(struct LibMsPack_MsPack_MsPackFile *, size_t);
26
- void (*free)(void *);
27
- void (*copy)(const in void *, out void *, size_t);
28
- void * null_ptr;
29
- };
30
-
31
- struct LibMsPack_MsCab_MsCabdFolder {
32
- struct LibMsPack_MsCab_MsCabdFolder * next;
33
- int comp_type;
34
- unsigned int num_blocks;
35
- };
36
-
37
- struct LibMsPack_MsCab_MsCabdFile {
38
- struct LibMsPack_MsCab_MsCabdFile * next;
39
- const char * filename;
40
- unsigned int length;
41
- int attribs;
42
- char time_h;
43
- char time_m;
44
- char time_s;
45
- char date_d;
46
- char date_m;
47
- int date_y;
48
- struct LibMsPack_MsCab_MsCabdFolder * folder;
49
- unsigned int offset;
50
- };
51
-
52
- struct LibMsPack_MsCab_MsCabdCabinet {
53
- struct LibMsPack_MsCab_MsCabdCabinet * next;
54
- const char * filename;
55
- off_t base_offset;
56
- unsigned int length;
57
- struct LibMsPack_MsCab_MsCabdCabinet * prevcab;
58
- struct LibMsPack_MsCab_MsCabdCabinet * nextcab;
59
- const char * prevname;
60
- const char * nextname;
61
- const char * previnfo;
62
- const char * nextinfo;
63
- struct LibMsPack_MsCab_MsCabdFile * files;
64
- struct LibMsPack_MsCab_MsCabdFolder * folders;
65
- unsigned short set_id;
66
- unsigned short set_index;
67
- unsigned short header_resv;
68
- int flags;
69
- };
70
-
71
- struct LibMsPack_MsCab_MsCabCompressor {
72
- int dummy;
73
- };
74
-
75
- struct LibMsPack_MsCab_MsCabDecompressor {
76
- struct LibMsPack_MsCab_MsCabdCabinet * (*open)(struct LibMsPack_MsCab_MsCabDecompressor *, const char *);
77
- void (*close)(struct LibMsPack_MsCab_MsCabDecompressor *, struct LibMsPack_MsCab_MsCabdCabinet *);
78
- struct LibMsPack_MsCab_MsCabdCabinet * (*search)(struct LibMsPack_MsCab_MsCabDecompressor *, const char *);
79
- int (*append)(struct LibMsPack_MsCab_MsCabDecompressor *, struct LibMsPack_MsCab_MsCabdCabinet *, struct LibMsPack_MsCab_MsCabdCabinet *);
80
- int (*prepend)(struct LibMsPack_MsCab_MsCabDecompressor *, struct LibMsPack_MsCab_MsCabdCabinet *, struct LibMsPack_MsCab_MsCabdCabinet *);
81
- int (*extract)(struct LibMsPack_MsCab_MsCabDecompressor *, struct LibMsPack_MsCab_MsCabdFile *, const char *);
82
- int (*set_param)(struct LibMsPack_MsCab_MsCabDecompressor *, int, int);
83
- int (*last_error)(struct LibMsPack_MsCab_MsCabDecompressor *);
84
- };
85
-
86
- struct LibMsPack_MsChm_MsChmcFile {
87
- int section;
88
- const char * filename;
89
- const char * chm_filename;
90
- off_t length;
91
- };
92
-
93
- struct LibMsPack_MsChm_MsChmdSection {
94
- struct LibMsPack_MsChm_MsChmdHeader * chm;
95
- unsigned int id;
96
- };
97
-
98
- struct LibMsPack_MsChm_MsChmdFile {
99
- struct LibMsPack_MsChm_MsChmdFile * next;
100
- struct LibMsPack_MsChm_MsChmdSection * section;
101
- off_t offset;
102
- off_t length;
103
- const char * filename;
104
- };
105
-
106
- struct LibMsPack_MsChm_MsChmdSecUncompressed {
107
- struct LibMsPack_MsChm_MsChmdSection base;
108
- off_t offset;
109
- };
110
-
111
- struct LibMsPack_MsChm_MsChmdSecMscompressed {
112
- struct LibMsPack_MsChm_MsChmdSection base;
113
- struct LibMsPack_MsChm_MsChmdFile * content;
114
- struct LibMsPack_MsChm_MsChmdFile * control;
115
- struct LibMsPack_MsChm_MsChmdFile * rtable;
116
- struct LibMsPack_MsChm_MsChmdFile * spaninfo;
117
- };
118
-
119
- struct LibMsPack_MsChm_MsChmdHeader {
120
- unsigned int version;
121
- unsigned int timestamp;
122
- unsigned int language;
123
- const char * filename;
124
- off_t length;
125
- struct LibMsPack_MsChm_MsChmdFile * files;
126
- struct LibMsPack_MsChm_MsChmdFile * sysfiles;
127
- struct LibMsPack_MsChm_MsChmdSecUncompressed sec0;
128
- struct LibMsPack_MsChm_MsChmdSecMscompressed sec1;
129
- off_t dir_offset;
130
- unsigned int num_chunks;
131
- unsigned int chunk_size;
132
- unsigned int density;
133
- unsigned int depth;
134
- unsigned int index_root;
135
- unsigned int first_pmgl;
136
- unsigned int last_pmgl;
137
- void * chunk_cache;
138
- };
139
-
140
- struct LibMsPack_MsChm_MsChmCompressor {
141
- int (*generate)(struct LibMsPack_MsChm_MsChmCompressor *, struct LibMsPack_MsChm_MsChmcFile *, const char *);
142
- int (*use_temporary_file)(struct LibMsPack_MsChm_MsChmCompressor *, int, const char *);
143
- int (*set_param)(struct LibMsPack_MsChm_MsChmCompressor *, int, unsigned int);
144
- int (*last_error)(struct LibMsPack_MsChm_MsChmCompressor *);
145
- };
146
-
147
- struct LibMsPack_MsChm_MsChmDecompressor {
148
- struct LibMsPack_MsChm_MsChmdHeader * (*open)(struct LibMsPack_MsChm_MsChmDecompressor *, const char *);
149
- void (*close)(struct LibMsPack_MsChm_MsChmDecompressor *, struct LibMsPack_MsChm_MsChmdHeader *);
150
- int (*extract)(struct LibMsPack_MsChm_MsChmDecompressor *, struct LibMsPack_MsChm_MsChmdFile *, const char *);
151
- int (*last_error)(struct LibMsPack_MsChm_MsChmDecompressor *);
152
- struct LibMsPack_MsChm_MsChmdHeader * (*fast_open)(struct LibMsPack_MsChm_MsChmDecompressor *, const char *);
153
- int (*fast_find)(struct LibMsPack_MsChm_MsChmDecompressor *, struct LibMsPack_MsChm_MsChmdHeader *, const char *, struct LibMsPack_MsChm_MsChmdFile *, int);
154
- };
155
-
156
- struct LibMsPack_MsHlp_MsHlpCompressor {
157
- int dummy;
158
- };
159
-
160
- struct LibMsPack_MsHlp_MsHlpDecompressor {
161
- int dummy;
162
- };
163
-
164
- struct LibMsPack_MsKwaj_MsKwajdHeader {
165
- unsigned short comp_type;
166
- off_t data_offset;
167
- int headers;
168
- off_t length;
169
- const char * filename;
170
- void * extra;
171
- unsigned short extra_length;
172
- };
173
-
174
- struct LibMsPack_MsKwaj_MsKwajCompressor {
175
- int (*compress)(void *, const char *, const char *, off_t);
176
- int (*set_param)(void *, int, unsigned int);
177
- int (*set_filename)(void *, const char *);
178
- int (*set_extra_data)(void *, void *, unsigned int);
179
- int (*last_error)(void *);
180
- };
181
-
182
- struct LibMsPack_MsKwaj_MsKwajDecompressor {
183
- void * (*open)(void *, const char *);
184
- void (*close)(void *, void *);
185
- int (*extract)(void *, void *, const char *);
186
- int (*decompress)(void *, const char *, const char *);
187
- int (*last_error)(void *);
188
- };
189
-
190
- struct LibMsPack_MsLit_MsLitCompressor {
191
- int dummy;
192
- };
193
-
194
- struct LibMsPack_MsLit_MsLitDecompressor {
195
- int dummy;
196
- };
197
-
198
- struct LibMsPack_MsOab_MsoabCompressor {
199
- int (*compress)(void *, const char *, const char *);
200
- int (*compress_incremental)(void *, const char *, const char *, const char *);
201
- };
202
-
203
- struct LibMsPack_MsOab_MsoabDecompressor {
204
- int (*decompress)(void *, const char *, const char *);
205
- int (*decompress_incremental)(void *, const char *, const char *, const char *);
206
- };
207
-
208
- struct LibMsPack_MsSzdd_MsSzdddHeader {
209
- int format;
210
- off_t length;
211
- char missing_char;
212
- };
213
-
214
- struct LibMsPack_MsSzdd_MsSzddCompressor {
215
- int (*compress)(void *, const char *, const char *, off_t);
216
- int (*set_param)(void *, int, unsigned int);
217
- int (*last_error)(void *);
218
- };
219
-
220
- struct LibMsPack_MsSzdd_MsSzddDecompressor {
221
- void * (*open)(void *, const char *);
222
- void (*close)(void *, void *);
223
- int (*extract)(void *, void *, const char *);
224
- int (*decompress)(void *, const char *, const char *);
225
- int (*last_error)(void *);
226
- };
227
-
228
- RBFFI_EXPORT int mspack_sys_selftest_internal(int);
229
- RBFFI_EXPORT int mspack_version(int);
230
- RBFFI_EXPORT struct LibMsPack_MsCab_MsCabCompressor * mspack_create_cab_compressor(struct LibMsPack_MsPack_MsPackSystem *);
231
- RBFFI_EXPORT void mspack_destroy_cab_compressor(struct LibMsPack_MsCab_MsCabCompressor *);
232
- RBFFI_EXPORT struct LibMsPack_MsCab_MsCabDecompressor * mspack_create_cab_decompressor(struct LibMsPack_MsPack_MsPackSystem *);
233
- RBFFI_EXPORT void mspack_destroy_cab_decompressor(struct LibMsPack_MsCab_MsCabDecompressor *);
234
- RBFFI_EXPORT void * mspack_create_chm_compressor(struct LibMsPack_MsPack_MsPackSystem *);
235
- RBFFI_EXPORT void mspack_destroy_chm_compressor(void *);
236
- RBFFI_EXPORT void * mspack_create_chm_decompressor(struct LibMsPack_MsPack_MsPackSystem *);
237
- RBFFI_EXPORT void mspack_destroy_chm_decompressor(void *);
238
- RBFFI_EXPORT struct LibMsPack_MsLit_MsLitCompressor * mspack_create_lit_compressor(struct LibMsPack_MsPack_MsPackSystem *);
239
- RBFFI_EXPORT void mspack_destroy_lit_compressor(struct LibMsPack_MsLit_MsLitCompressor *);
240
- RBFFI_EXPORT struct LibMsPack_MsLit_MsLitDecompressor * mspack_create_lit_decompressor(struct LibMsPack_MsPack_MsPackSystem *);
241
- RBFFI_EXPORT void mspack_destroy_lit_decompressor(struct LibMsPack_MsLit_MsLitDecompressor *);
242
- RBFFI_EXPORT struct LibMsPack_MsHlp_MsHlpCompressor * mspack_create_hlp_compressor(struct LibMsPack_MsPack_MsPackSystem *);
243
- RBFFI_EXPORT void mspack_destroy_hlp_compressor(struct LibMsPack_MsHlp_MsHlpCompressor *);
244
- RBFFI_EXPORT struct LibMsPack_MsHlp_MsHlpDecompressor * mspack_create_hlp_decompressor(struct LibMsPack_MsPack_MsPackSystem *);
245
- RBFFI_EXPORT void mspack_destroy_hlp_decompressor(struct LibMsPack_MsHlp_MsHlpDecompressor *);
246
- RBFFI_EXPORT void * mspack_create_szdd_compressor(struct LibMsPack_MsPack_MsPackSystem *);
247
- RBFFI_EXPORT void mspack_destroy_szdd_compressor(void *);
248
- RBFFI_EXPORT void * mspack_create_szdd_decompressor(struct LibMsPack_MsPack_MsPackSystem *);
249
- RBFFI_EXPORT void mspack_destroy_szdd_decompressor(void *);
250
- RBFFI_EXPORT void * mspack_create_kwaj_compressor(struct LibMsPack_MsPack_MsPackSystem *);
251
- RBFFI_EXPORT void mspack_destroy_kwaj_compressor(void *);
252
- RBFFI_EXPORT void * mspack_create_kwaj_decompressor(struct LibMsPack_MsPack_MsPackSystem *);
253
- RBFFI_EXPORT void mspack_destroy_kwaj_decompressor(void *);
254
- RBFFI_EXPORT void * mspack_create_oab_compressor(struct LibMsPack_MsPack_MsPackSystem *);
255
- RBFFI_EXPORT void mspack_destroy_oab_compressor(void *);
256
- RBFFI_EXPORT void * mspack_create_oab_decompressor(struct LibMsPack_MsPack_MsPackSystem *);
257
- RBFFI_EXPORT void mspack_destroy_oab_decompressor(void *);
258
-
259
- #endif /* LIBMSPACK_H */