1 static MonoBundledAssembly
**bundled
;
8 my_inflate (const Byte
*compr
, uLong compr_len
, Byte
*uncompr
, uLong uncompr_len
)
13 memset (&stream
, 0, sizeof (z_stream
));
14 stream
.next_in
= (Byte
*) compr
;
15 stream
.avail_in
= (uInt
) compr_len
;
16 err
= inflateInit (&stream
);
21 stream
.next_out
= uncompr
;
22 stream
.avail_out
= (uInt
) uncompr_len
;
23 err
= inflate (&stream
, Z_NO_FLUSH
);
24 if (err
== Z_STREAM_END
) break;
31 err
= inflateEnd (&stream
);
35 if (stream
.total_out
!= uncompr_len
)
41 void mono_mkbundle_init ()
43 CompressedAssembly
**ptr
;
44 MonoBundledAssembly
**bundled_ptr
;
48 install_dll_config_files ();
50 ptr
= (CompressedAssembly
**) compressed
;
52 while (*ptr
++ != NULL
)
55 bundled
= (MonoBundledAssembly
**) malloc (sizeof (MonoBundledAssembly
*) * (nbundles
+ 1));
56 bundled_ptr
= bundled
;
57 ptr
= (CompressedAssembly
**) compressed
;
58 while (*ptr
!= NULL
) {
62 MonoBundledAssembly
*current
;
64 real_size
= (*ptr
)->assembly
.size
;
65 zsize
= (*ptr
)->compressed_size
;
66 buffer
= (Bytef
*) malloc (real_size
);
67 result
= my_inflate ((*ptr
)->assembly
.data
, zsize
, buffer
, real_size
);
69 fprintf (stderr
, "Error %d decompresing data for %s\n", result
, (*ptr
)->assembly
.name
);
72 (*ptr
)->assembly
.data
= buffer
;
73 current
= (MonoBundledAssembly
*) malloc (sizeof (MonoBundledAssembly
));
74 memcpy (current
, *ptr
, sizeof (MonoBundledAssembly
));
75 current
->name
= (*ptr
)->assembly
.name
;
76 *bundled_ptr
= current
;
81 mono_register_bundled_assemblies((const MonoBundledAssembly
**) bundled
);