68090
|
1 |
(* Title: Pure/Thy/export.ML
|
|
2 |
Author: Makarius
|
|
3 |
|
68102
|
4 |
Manage theory exports: compressed blobs.
|
68090
|
5 |
*)
|
|
6 |
|
|
7 |
signature EXPORT =
|
|
8 |
sig
|
68102
|
9 |
val export: theory -> string -> string -> unit
|
|
10 |
val export_raw: theory -> string -> string list -> unit
|
68090
|
11 |
end;
|
|
12 |
|
|
13 |
structure Export: EXPORT =
|
|
14 |
struct
|
|
15 |
|
68102
|
16 |
fun gen_export compress thy name body =
|
68090
|
17 |
(Output.try_protocol_message o Markup.export)
|
|
18 |
{id = Position.get_id (Position.thread_data ()),
|
68101
|
19 |
serial = serial (),
|
68090
|
20 |
theory_name = Context.theory_long_name thy,
|
|
21 |
name = name,
|
68102
|
22 |
compress = compress} body;
|
68090
|
23 |
|
68102
|
24 |
fun export thy name body = gen_export (size body > 60) thy name [body];
|
|
25 |
fun export_raw thy name body = gen_export false thy name body;
|
68090
|
26 |
|
|
27 |
end;
|