aibika 1.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +11 -0
- data/History.txt +214 -0
- data/LICENSE.md +30 -0
- data/Manifest.txt +11 -0
- data/README.adoc +564 -0
- data/Rakefile +30 -0
- data/aibika.gemspec +50 -0
- data/bin/aibika +25 -0
- data/lib/aibika/aibika_builder.rb +191 -0
- data/lib/aibika/cli.rb +181 -0
- data/lib/aibika/host.rb +40 -0
- data/lib/aibika/library_detector.rb +88 -0
- data/lib/aibika/pathname.rb +158 -0
- data/lib/aibika/version.rb +5 -0
- data/lib/aibika.rb +675 -0
- data/samples/activerecord_sample.rb +6 -0
- data/samples/bundler_git/Gemfile +3 -0
- data/samples/bundler_git/bundler_git.rb +5 -0
- data/samples/mech.rb +8 -0
- data/samples/mime-types_sample.rb +4 -0
- data/samples/pg_sample.rb +4 -0
- data/samples/prawn_sample.rb +9 -0
- data/samples/readchar.rb +4 -0
- data/samples/sysproctable.rb +12 -0
- data/samples/tk.rb +13 -0
- data/samples/tkextlib.rb +4 -0
- data/samples/watir_sample.rb +31 -0
- data/samples/win32_api_sample.rb +5 -0
- data/samples/win32ole.rb +4 -0
- data/samples/wxruby_sample.rbw +29 -0
- data/share/aibika/lzma.exe +0 -0
- data/src/Makefile +37 -0
- data/src/edicon.c +146 -0
- data/src/lzma/LzmaDec.c +1007 -0
- data/src/lzma/LzmaDec.h +223 -0
- data/src/lzma/Types.h +208 -0
- data/src/seb.exe +0 -0
- data/src/stub.c +703 -0
- data/src/stub.rc +1 -0
- data/src/vit-ruby.ico +0 -0
- metadata +109 -0
data/src/lzma/LzmaDec.h
ADDED
@@ -0,0 +1,223 @@
|
|
1
|
+
/* LzmaDec.h -- LZMA Decoder
|
2
|
+
2008-10-04 : Igor Pavlov : Public domain */
|
3
|
+
|
4
|
+
#ifndef __LZMADEC_H
|
5
|
+
#define __LZMADEC_H
|
6
|
+
|
7
|
+
#include "Types.h"
|
8
|
+
|
9
|
+
/* #define _LZMA_PROB32 */
|
10
|
+
/* _LZMA_PROB32 can increase the speed on some CPUs,
|
11
|
+
but memory usage for CLzmaDec::probs will be doubled in that case */
|
12
|
+
|
13
|
+
#ifdef _LZMA_PROB32
|
14
|
+
#define CLzmaProb UInt32
|
15
|
+
#else
|
16
|
+
#define CLzmaProb UInt16
|
17
|
+
#endif
|
18
|
+
|
19
|
+
|
20
|
+
/* ---------- LZMA Properties ---------- */
|
21
|
+
|
22
|
+
#define LZMA_PROPS_SIZE 5
|
23
|
+
|
24
|
+
typedef struct _CLzmaProps
|
25
|
+
{
|
26
|
+
unsigned lc, lp, pb;
|
27
|
+
UInt32 dicSize;
|
28
|
+
} CLzmaProps;
|
29
|
+
|
30
|
+
/* LzmaProps_Decode - decodes properties
|
31
|
+
Returns:
|
32
|
+
SZ_OK
|
33
|
+
SZ_ERROR_UNSUPPORTED - Unsupported properties
|
34
|
+
*/
|
35
|
+
|
36
|
+
SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size);
|
37
|
+
|
38
|
+
|
39
|
+
/* ---------- LZMA Decoder state ---------- */
|
40
|
+
|
41
|
+
/* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case.
|
42
|
+
Num bits = log2((2^11 / 31) ^ 22) + 26 < 134 + 26 = 160; */
|
43
|
+
|
44
|
+
#define LZMA_REQUIRED_INPUT_MAX 20
|
45
|
+
|
46
|
+
typedef struct
|
47
|
+
{
|
48
|
+
CLzmaProps prop;
|
49
|
+
CLzmaProb *probs;
|
50
|
+
Byte *dic;
|
51
|
+
const Byte *buf;
|
52
|
+
UInt32 range, code;
|
53
|
+
SizeT dicPos;
|
54
|
+
SizeT dicBufSize;
|
55
|
+
UInt32 processedPos;
|
56
|
+
UInt32 checkDicSize;
|
57
|
+
unsigned state;
|
58
|
+
UInt32 reps[4];
|
59
|
+
unsigned remainLen;
|
60
|
+
int needFlush;
|
61
|
+
int needInitState;
|
62
|
+
UInt32 numProbs;
|
63
|
+
unsigned tempBufSize;
|
64
|
+
Byte tempBuf[LZMA_REQUIRED_INPUT_MAX];
|
65
|
+
} CLzmaDec;
|
66
|
+
|
67
|
+
#define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; }
|
68
|
+
|
69
|
+
void LzmaDec_Init(CLzmaDec *p);
|
70
|
+
|
71
|
+
/* There are two types of LZMA streams:
|
72
|
+
0) Stream with end mark. That end mark adds about 6 bytes to compressed size.
|
73
|
+
1) Stream without end mark. You must know exact uncompressed size to decompress such stream. */
|
74
|
+
|
75
|
+
typedef enum
|
76
|
+
{
|
77
|
+
LZMA_FINISH_ANY, /* finish at any point */
|
78
|
+
LZMA_FINISH_END /* block must be finished at the end */
|
79
|
+
} ELzmaFinishMode;
|
80
|
+
|
81
|
+
/* ELzmaFinishMode has meaning only if the decoding reaches output limit !!!
|
82
|
+
|
83
|
+
You must use LZMA_FINISH_END, when you know that current output buffer
|
84
|
+
covers last bytes of block. In other cases you must use LZMA_FINISH_ANY.
|
85
|
+
|
86
|
+
If LZMA decoder sees end marker before reaching output limit, it returns SZ_OK,
|
87
|
+
and output value of destLen will be less than output buffer size limit.
|
88
|
+
You can check status result also.
|
89
|
+
|
90
|
+
You can use multiple checks to test data integrity after full decompression:
|
91
|
+
1) Check Result and "status" variable.
|
92
|
+
2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize.
|
93
|
+
3) Check that output(srcLen) = compressedSize, if you know real compressedSize.
|
94
|
+
You must use correct finish mode in that case. */
|
95
|
+
|
96
|
+
typedef enum
|
97
|
+
{
|
98
|
+
LZMA_STATUS_NOT_SPECIFIED, /* use main error code instead */
|
99
|
+
LZMA_STATUS_FINISHED_WITH_MARK, /* stream was finished with end mark. */
|
100
|
+
LZMA_STATUS_NOT_FINISHED, /* stream was not finished */
|
101
|
+
LZMA_STATUS_NEEDS_MORE_INPUT, /* you must provide more input bytes */
|
102
|
+
LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK /* there is probability that stream was finished without end mark */
|
103
|
+
} ELzmaStatus;
|
104
|
+
|
105
|
+
/* ELzmaStatus is used only as output value for function call */
|
106
|
+
|
107
|
+
|
108
|
+
/* ---------- Interfaces ---------- */
|
109
|
+
|
110
|
+
/* There are 3 levels of interfaces:
|
111
|
+
1) Dictionary Interface
|
112
|
+
2) Buffer Interface
|
113
|
+
3) One Call Interface
|
114
|
+
You can select any of these interfaces, but don't mix functions from different
|
115
|
+
groups for same object. */
|
116
|
+
|
117
|
+
|
118
|
+
/* There are two variants to allocate state for Dictionary Interface:
|
119
|
+
1) LzmaDec_Allocate / LzmaDec_Free
|
120
|
+
2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs
|
121
|
+
You can use variant 2, if you set dictionary buffer manually.
|
122
|
+
For Buffer Interface you must always use variant 1.
|
123
|
+
|
124
|
+
LzmaDec_Allocate* can return:
|
125
|
+
SZ_OK
|
126
|
+
SZ_ERROR_MEM - Memory allocation error
|
127
|
+
SZ_ERROR_UNSUPPORTED - Unsupported properties
|
128
|
+
*/
|
129
|
+
|
130
|
+
SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc);
|
131
|
+
void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc);
|
132
|
+
|
133
|
+
SRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc);
|
134
|
+
void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc);
|
135
|
+
|
136
|
+
/* ---------- Dictionary Interface ---------- */
|
137
|
+
|
138
|
+
/* You can use it, if you want to eliminate the overhead for data copying from
|
139
|
+
dictionary to some other external buffer.
|
140
|
+
You must work with CLzmaDec variables directly in this interface.
|
141
|
+
|
142
|
+
STEPS:
|
143
|
+
LzmaDec_Constr()
|
144
|
+
LzmaDec_Allocate()
|
145
|
+
for (each new stream)
|
146
|
+
{
|
147
|
+
LzmaDec_Init()
|
148
|
+
while (it needs more decompression)
|
149
|
+
{
|
150
|
+
LzmaDec_DecodeToDic()
|
151
|
+
use data from CLzmaDec::dic and update CLzmaDec::dicPos
|
152
|
+
}
|
153
|
+
}
|
154
|
+
LzmaDec_Free()
|
155
|
+
*/
|
156
|
+
|
157
|
+
/* LzmaDec_DecodeToDic
|
158
|
+
|
159
|
+
The decoding to internal dictionary buffer (CLzmaDec::dic).
|
160
|
+
You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!!
|
161
|
+
|
162
|
+
finishMode:
|
163
|
+
It has meaning only if the decoding reaches output limit (dicLimit).
|
164
|
+
LZMA_FINISH_ANY - Decode just dicLimit bytes.
|
165
|
+
LZMA_FINISH_END - Stream must be finished after dicLimit.
|
166
|
+
|
167
|
+
Returns:
|
168
|
+
SZ_OK
|
169
|
+
status:
|
170
|
+
LZMA_STATUS_FINISHED_WITH_MARK
|
171
|
+
LZMA_STATUS_NOT_FINISHED
|
172
|
+
LZMA_STATUS_NEEDS_MORE_INPUT
|
173
|
+
LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
|
174
|
+
SZ_ERROR_DATA - Data error
|
175
|
+
*/
|
176
|
+
|
177
|
+
SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit,
|
178
|
+
const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
|
179
|
+
|
180
|
+
|
181
|
+
/* ---------- Buffer Interface ---------- */
|
182
|
+
|
183
|
+
/* It's zlib-like interface.
|
184
|
+
See LzmaDec_DecodeToDic description for information about STEPS and return results,
|
185
|
+
but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need
|
186
|
+
to work with CLzmaDec variables manually.
|
187
|
+
|
188
|
+
finishMode:
|
189
|
+
It has meaning only if the decoding reaches output limit (*destLen).
|
190
|
+
LZMA_FINISH_ANY - Decode just destLen bytes.
|
191
|
+
LZMA_FINISH_END - Stream must be finished after (*destLen).
|
192
|
+
*/
|
193
|
+
|
194
|
+
SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen,
|
195
|
+
const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
|
196
|
+
|
197
|
+
|
198
|
+
/* ---------- One Call Interface ---------- */
|
199
|
+
|
200
|
+
/* LzmaDecode
|
201
|
+
|
202
|
+
finishMode:
|
203
|
+
It has meaning only if the decoding reaches output limit (*destLen).
|
204
|
+
LZMA_FINISH_ANY - Decode just destLen bytes.
|
205
|
+
LZMA_FINISH_END - Stream must be finished after (*destLen).
|
206
|
+
|
207
|
+
Returns:
|
208
|
+
SZ_OK
|
209
|
+
status:
|
210
|
+
LZMA_STATUS_FINISHED_WITH_MARK
|
211
|
+
LZMA_STATUS_NOT_FINISHED
|
212
|
+
LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
|
213
|
+
SZ_ERROR_DATA - Data error
|
214
|
+
SZ_ERROR_MEM - Memory allocation error
|
215
|
+
SZ_ERROR_UNSUPPORTED - Unsupported properties
|
216
|
+
SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).
|
217
|
+
*/
|
218
|
+
|
219
|
+
SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
|
220
|
+
const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
|
221
|
+
ELzmaStatus *status, ISzAlloc *alloc);
|
222
|
+
|
223
|
+
#endif
|
data/src/lzma/Types.h
ADDED
@@ -0,0 +1,208 @@
|
|
1
|
+
/* Types.h -- Basic types
|
2
|
+
2008-11-23 : Igor Pavlov : Public domain */
|
3
|
+
|
4
|
+
#ifndef __7Z_TYPES_H
|
5
|
+
#define __7Z_TYPES_H
|
6
|
+
|
7
|
+
#include <stddef.h>
|
8
|
+
|
9
|
+
#ifdef _WIN32
|
10
|
+
#include <windows.h>
|
11
|
+
#endif
|
12
|
+
|
13
|
+
#define SZ_OK 0
|
14
|
+
|
15
|
+
#define SZ_ERROR_DATA 1
|
16
|
+
#define SZ_ERROR_MEM 2
|
17
|
+
#define SZ_ERROR_CRC 3
|
18
|
+
#define SZ_ERROR_UNSUPPORTED 4
|
19
|
+
#define SZ_ERROR_PARAM 5
|
20
|
+
#define SZ_ERROR_INPUT_EOF 6
|
21
|
+
#define SZ_ERROR_OUTPUT_EOF 7
|
22
|
+
#define SZ_ERROR_READ 8
|
23
|
+
#define SZ_ERROR_WRITE 9
|
24
|
+
#define SZ_ERROR_PROGRESS 10
|
25
|
+
#define SZ_ERROR_FAIL 11
|
26
|
+
#define SZ_ERROR_THREAD 12
|
27
|
+
|
28
|
+
#define SZ_ERROR_ARCHIVE 16
|
29
|
+
#define SZ_ERROR_NO_ARCHIVE 17
|
30
|
+
|
31
|
+
typedef int SRes;
|
32
|
+
|
33
|
+
#ifdef _WIN32
|
34
|
+
typedef DWORD WRes;
|
35
|
+
#else
|
36
|
+
typedef int WRes;
|
37
|
+
#endif
|
38
|
+
|
39
|
+
#ifndef RINOK
|
40
|
+
#define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; }
|
41
|
+
#endif
|
42
|
+
|
43
|
+
typedef unsigned char Byte;
|
44
|
+
typedef short Int16;
|
45
|
+
typedef unsigned short UInt16;
|
46
|
+
|
47
|
+
#ifdef _LZMA_UINT32_IS_ULONG
|
48
|
+
typedef long Int32;
|
49
|
+
typedef unsigned long UInt32;
|
50
|
+
#else
|
51
|
+
typedef int Int32;
|
52
|
+
typedef unsigned int UInt32;
|
53
|
+
#endif
|
54
|
+
|
55
|
+
#ifdef _SZ_NO_INT_64
|
56
|
+
|
57
|
+
/* define _SZ_NO_INT_64, if your compiler doesn't support 64-bit integers.
|
58
|
+
NOTES: Some code will work incorrectly in that case! */
|
59
|
+
|
60
|
+
typedef long Int64;
|
61
|
+
typedef unsigned long UInt64;
|
62
|
+
|
63
|
+
#else
|
64
|
+
|
65
|
+
#if defined(_MSC_VER) || defined(__BORLANDC__)
|
66
|
+
typedef __int64 Int64;
|
67
|
+
typedef unsigned __int64 UInt64;
|
68
|
+
#else
|
69
|
+
typedef long long int Int64;
|
70
|
+
typedef unsigned long long int UInt64;
|
71
|
+
#endif
|
72
|
+
|
73
|
+
#endif
|
74
|
+
|
75
|
+
#ifdef _LZMA_NO_SYSTEM_SIZE_T
|
76
|
+
typedef UInt32 SizeT;
|
77
|
+
#else
|
78
|
+
typedef size_t SizeT;
|
79
|
+
#endif
|
80
|
+
|
81
|
+
typedef int Bool;
|
82
|
+
#define True 1
|
83
|
+
#define False 0
|
84
|
+
|
85
|
+
|
86
|
+
#ifdef _MSC_VER
|
87
|
+
|
88
|
+
#if _MSC_VER >= 1300
|
89
|
+
#define MY_NO_INLINE __declspec(noinline)
|
90
|
+
#else
|
91
|
+
#define MY_NO_INLINE
|
92
|
+
#endif
|
93
|
+
|
94
|
+
#define MY_CDECL __cdecl
|
95
|
+
#define MY_STD_CALL __stdcall
|
96
|
+
#define MY_FAST_CALL MY_NO_INLINE __fastcall
|
97
|
+
|
98
|
+
#else
|
99
|
+
|
100
|
+
#define MY_CDECL
|
101
|
+
#define MY_STD_CALL
|
102
|
+
#define MY_FAST_CALL
|
103
|
+
|
104
|
+
#endif
|
105
|
+
|
106
|
+
|
107
|
+
/* The following interfaces use first parameter as pointer to structure */
|
108
|
+
|
109
|
+
typedef struct
|
110
|
+
{
|
111
|
+
SRes (*Read)(void *p, void *buf, size_t *size);
|
112
|
+
/* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
|
113
|
+
(output(*size) < input(*size)) is allowed */
|
114
|
+
} ISeqInStream;
|
115
|
+
|
116
|
+
/* it can return SZ_ERROR_INPUT_EOF */
|
117
|
+
SRes SeqInStream_Read(ISeqInStream *stream, void *buf, size_t size);
|
118
|
+
SRes SeqInStream_Read2(ISeqInStream *stream, void *buf, size_t size, SRes errorType);
|
119
|
+
SRes SeqInStream_ReadByte(ISeqInStream *stream, Byte *buf);
|
120
|
+
|
121
|
+
typedef struct
|
122
|
+
{
|
123
|
+
size_t (*Write)(void *p, const void *buf, size_t size);
|
124
|
+
/* Returns: result - the number of actually written bytes.
|
125
|
+
(result < size) means error */
|
126
|
+
} ISeqOutStream;
|
127
|
+
|
128
|
+
typedef enum
|
129
|
+
{
|
130
|
+
SZ_SEEK_SET = 0,
|
131
|
+
SZ_SEEK_CUR = 1,
|
132
|
+
SZ_SEEK_END = 2
|
133
|
+
} ESzSeek;
|
134
|
+
|
135
|
+
typedef struct
|
136
|
+
{
|
137
|
+
SRes (*Read)(void *p, void *buf, size_t *size); /* same as ISeqInStream::Read */
|
138
|
+
SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin);
|
139
|
+
} ISeekInStream;
|
140
|
+
|
141
|
+
typedef struct
|
142
|
+
{
|
143
|
+
SRes (*Look)(void *p, void **buf, size_t *size);
|
144
|
+
/* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
|
145
|
+
(output(*size) > input(*size)) is not allowed
|
146
|
+
(output(*size) < input(*size)) is allowed */
|
147
|
+
SRes (*Skip)(void *p, size_t offset);
|
148
|
+
/* offset must be <= output(*size) of Look */
|
149
|
+
|
150
|
+
SRes (*Read)(void *p, void *buf, size_t *size);
|
151
|
+
/* reads directly (without buffer). It's same as ISeqInStream::Read */
|
152
|
+
SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin);
|
153
|
+
} ILookInStream;
|
154
|
+
|
155
|
+
SRes LookInStream_LookRead(ILookInStream *stream, void *buf, size_t *size);
|
156
|
+
SRes LookInStream_SeekTo(ILookInStream *stream, UInt64 offset);
|
157
|
+
|
158
|
+
/* reads via ILookInStream::Read */
|
159
|
+
SRes LookInStream_Read2(ILookInStream *stream, void *buf, size_t size, SRes errorType);
|
160
|
+
SRes LookInStream_Read(ILookInStream *stream, void *buf, size_t size);
|
161
|
+
|
162
|
+
#define LookToRead_BUF_SIZE (1 << 14)
|
163
|
+
|
164
|
+
typedef struct
|
165
|
+
{
|
166
|
+
ILookInStream s;
|
167
|
+
ISeekInStream *realStream;
|
168
|
+
size_t pos;
|
169
|
+
size_t size;
|
170
|
+
Byte buf[LookToRead_BUF_SIZE];
|
171
|
+
} CLookToRead;
|
172
|
+
|
173
|
+
void LookToRead_CreateVTable(CLookToRead *p, int lookahead);
|
174
|
+
void LookToRead_Init(CLookToRead *p);
|
175
|
+
|
176
|
+
typedef struct
|
177
|
+
{
|
178
|
+
ISeqInStream s;
|
179
|
+
ILookInStream *realStream;
|
180
|
+
} CSecToLook;
|
181
|
+
|
182
|
+
void SecToLook_CreateVTable(CSecToLook *p);
|
183
|
+
|
184
|
+
typedef struct
|
185
|
+
{
|
186
|
+
ISeqInStream s;
|
187
|
+
ILookInStream *realStream;
|
188
|
+
} CSecToRead;
|
189
|
+
|
190
|
+
void SecToRead_CreateVTable(CSecToRead *p);
|
191
|
+
|
192
|
+
typedef struct
|
193
|
+
{
|
194
|
+
SRes (*Progress)(void *p, UInt64 inSize, UInt64 outSize);
|
195
|
+
/* Returns: result. (result != SZ_OK) means break.
|
196
|
+
Value (UInt64)(Int64)-1 for size means unknown value. */
|
197
|
+
} ICompressProgress;
|
198
|
+
|
199
|
+
typedef struct
|
200
|
+
{
|
201
|
+
void *(*Alloc)(void *p, size_t size);
|
202
|
+
void (*Free)(void *p, void *address); /* address can be 0 */
|
203
|
+
} ISzAlloc;
|
204
|
+
|
205
|
+
#define IAlloc_Alloc(p, size) (p)->Alloc((p), size)
|
206
|
+
#define IAlloc_Free(p, a) (p)->Free((p), a)
|
207
|
+
|
208
|
+
#endif
|
data/src/seb.exe
ADDED
Binary file
|