Add copyright notices and new function String.chomp
[ocaml.git] / ocamldoc / odoc_types.ml
blob68b3c4c9ca300c3f0b3b5b62610c21cab5d736da
1 (***********************************************************************)
2 (* OCamldoc *)
3 (* *)
4 (* Maxence Guesdon, projet Cristal, INRIA Rocquencourt *)
5 (* *)
6 (* Copyright 2001 Institut National de Recherche en Informatique et *)
7 (* en Automatique. All rights reserved. This file is distributed *)
8 (* under the terms of the Q Public License version 1.0. *)
9 (* *)
10 (***********************************************************************)
12 (* $Id$ *)
14 type ref_kind =
15 RK_module
16 | RK_module_type
17 | RK_class
18 | RK_class_type
19 | RK_value
20 | RK_type
21 | RK_exception
22 | RK_attribute
23 | RK_method
24 | RK_section of text
26 and text_element =
27 | Raw of string
28 | Code of string
29 | CodePre of string
30 | Verbatim of string
31 | Bold of text
32 | Italic of text
33 | Emphasize of text
34 | Center of text
35 | Left of text
36 | Right of text
37 | List of text list
38 | Enum of text list
39 | Newline
40 | Block of text
41 | Title of int * string option * text
42 | Latex of string
43 | Link of string * text
44 | Ref of string * ref_kind option
45 | Superscript of text
46 | Subscript of text
47 | Module_list of string list
48 | Index_list
49 | Custom of string * text
51 and text = text_element list
53 type see_ref =
54 See_url of string
55 | See_file of string
56 | See_doc of string
58 type see = see_ref * text
60 type param = (string * text)
62 type raised_exception = (string * text)
64 type info = {
65 i_desc : text option;
66 i_authors : string list;
67 i_version : string option;
68 i_sees : see list;
69 i_since : string option;
70 i_deprecated : text option;
71 i_params : param list;
72 i_raised_exceptions : raised_exception list;
73 i_return_value : text option ;
74 i_custom : (string * text) list ;
77 let dummy_info = {
78 i_desc = None ;
79 i_authors = [] ;
80 i_version = None ;
81 i_sees = [] ;
82 i_since = None ;
83 i_deprecated = None ;
84 i_params = [] ;
85 i_raised_exceptions = [] ;
86 i_return_value = None ;
87 i_custom = [] ;
90 type location = {
91 loc_impl : (string * int) option ;
92 loc_inter : (string * int) option ;
95 let dummy_loc = { loc_impl = None ; loc_inter = None }
97 type merge_option =
98 | Merge_description
99 | Merge_author
100 | Merge_version
101 | Merge_see
102 | Merge_since
103 | Merge_deprecated
104 | Merge_param
105 | Merge_raised_exception
106 | Merge_return_value
107 | Merge_custom
109 let all_merge_options = [
110 Merge_description ;
111 Merge_author ;
112 Merge_version ;
113 Merge_see ;
114 Merge_since ;
115 Merge_deprecated ;
116 Merge_param ;
117 Merge_raised_exception ;
118 Merge_return_value ;
119 Merge_custom ;
122 type magic = string
124 let magic = Odoc_messages.magic
126 type 'a dump = Dump of magic * 'a
128 let make_dump a = Dump (magic, a)
130 let open_dump = function
131 Dump (m, a) ->
132 if m = magic then a
133 else raise (Failure Odoc_messages.bad_magic_number)