1(**************************************************************************)
2(*                                                                        *)
3(*                                 OCaml                                  *)
4(*                                                                        *)
5(*             Maxence Guesdon, projet Cristal, INRIA Rocquencourt        *)
6(*                                                                        *)
7(*   Copyright 2001 Institut National de Recherche en Informatique et     *)
8(*     en Automatique.                                                    *)
9(*                                                                        *)
10(*   All rights reserved.  This file is distributed under the terms of    *)
11(*   the GNU Lesser General Public License version 2.1, with the          *)
12(*   special exception on linking described in the file LICENSE.          *)
13(*                                                                        *)
14(**************************************************************************)
15
16type ref_kind =
17    RK_module
18  | RK_module_type
19  | RK_class
20  | RK_class_type
21  | RK_value
22  | RK_type
23  | RK_extension
24  | RK_exception
25  | RK_attribute
26  | RK_method
27  | RK_section of text
28  | RK_recfield
29  | RK_const
30
31and text_element =
32  | Raw of string
33  | Code of string
34  | CodePre of string
35  | Verbatim of string
36  | Bold of text
37  | Italic of text
38  | Emphasize of text
39  | Center of text
40  | Left of text
41  | Right of text
42  | List of text list
43  | Enum of text list
44  | Newline
45  | Block of text
46  | Title of int * string option * text
47  | Latex of string
48  | Link of string * text
49  | Ref of string * ref_kind option * text option
50  | Superscript of text
51  | Subscript of text
52  | Module_list of string list
53  | Index_list
54  | Custom of string * text
55  | Target of string * string
56
57and text = text_element list
58
59type see_ref =
60    See_url of string
61  | See_file of string
62  | See_doc of string
63
64type see = see_ref * text
65
66type param = (string * text)
67
68type raised_exception = (string * text)
69
70type info = {
71    i_desc : text option;
72    i_authors : string list;
73    i_version : string option;
74    i_sees : see list;
75    i_since : string option;
76    i_before : (string * text) list;
77    i_deprecated : text option;
78    i_params : param list;
79    i_raised_exceptions : raised_exception list;
80    i_return_value : text option ;
81    i_custom : (string * text) list ;
82  }
83
84let dummy_info = {
85  i_desc = None ;
86  i_authors = [] ;
87  i_version = None ;
88  i_sees = [] ;
89  i_since = None ;
90  i_before = [] ;
91  i_deprecated = None ;
92  i_params = [] ;
93  i_raised_exceptions = [] ;
94  i_return_value = None ;
95  i_custom = [] ;
96}
97
98type location = {
99    loc_impl : Location.t option ;
100    loc_inter : Location.t option ;
101  }
102
103let dummy_loc = { loc_impl = None ; loc_inter = None }
104
105type merge_option =
106  | Merge_description
107  | Merge_author
108  | Merge_version
109  | Merge_see
110  | Merge_since
111  | Merge_before
112  | Merge_deprecated
113  | Merge_param
114  | Merge_raised_exception
115  | Merge_return_value
116  | Merge_custom
117
118let all_merge_options = [
119  Merge_description ;
120  Merge_author ;
121  Merge_version ;
122  Merge_see ;
123  Merge_since ;
124  Merge_before ;
125  Merge_deprecated ;
126  Merge_param ;
127  Merge_raised_exception ;
128  Merge_return_value ;
129  Merge_custom ;
130]
131
132type magic = string
133
134let magic = Odoc_messages.magic
135
136type 'a dump = Dump of magic * 'a
137
138let make_dump a = Dump (magic, a)
139
140let open_dump = function
141    Dump (m, a) ->
142      if m = magic then a
143      else raise (Failure Odoc_messages.bad_magic_number)
144