package yaml

  1. Overview
  2. Docs

Source file g.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
module CI = Cstubs_internals

external yaml_stub_1_yaml_get_version_string : unit -> CI.voidp
  = "yaml_stub_1_yaml_get_version_string" 

external yaml_stub_2_yaml_get_version
  : _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> unit
  = "yaml_stub_2_yaml_get_version" 

external yaml_stub_3_yaml_token_delete : _ CI.fatptr -> unit
  = "yaml_stub_3_yaml_token_delete" 

external yaml_stub_4_yaml_parser_initialize : _ CI.fatptr -> int
  = "yaml_stub_4_yaml_parser_initialize" 

external yaml_stub_5_yaml_parser_delete : _ CI.fatptr -> unit
  = "yaml_stub_5_yaml_parser_delete" 

external yaml_stub_6_yaml_parser_set_input_string
  : _ CI.fatptr -> _ CI.fatptr -> Unsigned.size_t -> unit
  = "yaml_stub_6_yaml_parser_set_input_string" 

external yaml_stub_7_yaml_parser_parse : _ CI.fatptr -> _ CI.fatptr -> int
  = "yaml_stub_7_yaml_parser_parse" 

external yaml_stub_8_yaml_emitter_initialize : _ CI.fatptr -> int
  = "yaml_stub_8_yaml_emitter_initialize" 

external yaml_stub_9_yaml_emitter_delete : _ CI.fatptr -> unit
  = "yaml_stub_9_yaml_emitter_delete" 

external yaml_stub_10_yaml_emitter_set_output_string
  : _ CI.fatptr -> _ CI.fatptr -> Unsigned.size_t -> _ CI.fatptr -> unit
  = "yaml_stub_10_yaml_emitter_set_output_string" 

external yaml_stub_11_yaml_emitter_set_encoding
  : _ CI.fatptr -> Unsigned.uint32 -> unit
  = "yaml_stub_11_yaml_emitter_set_encoding" 

external yaml_stub_12_yaml_emitter_set_canonical
  : _ CI.fatptr -> bool -> unit = "yaml_stub_12_yaml_emitter_set_canonical" 

external yaml_stub_13_yaml_emitter_set_indent : _ CI.fatptr -> int -> unit
  = "yaml_stub_13_yaml_emitter_set_indent" 

external yaml_stub_14_yaml_emitter_set_width : _ CI.fatptr -> int -> unit
  = "yaml_stub_14_yaml_emitter_set_width" 

external yaml_stub_15_yaml_emitter_set_unicode : _ CI.fatptr -> bool -> unit
  = "yaml_stub_15_yaml_emitter_set_unicode" 

external yaml_stub_16_yaml_emitter_flush : _ CI.fatptr -> int
  = "yaml_stub_16_yaml_emitter_flush" 

external yaml_stub_17_yaml_emitter_emit : _ CI.fatptr -> _ CI.fatptr -> int
  = "yaml_stub_17_yaml_emitter_emit" 

external yaml_stub_18_yaml_stream_start_event_initialize
  : _ CI.fatptr -> Unsigned.uint32 -> int
  = "yaml_stub_18_yaml_stream_start_event_initialize" 

external yaml_stub_19_yaml_stream_end_event_initialize : _ CI.fatptr -> int
  = "yaml_stub_19_yaml_stream_end_event_initialize" 

external yaml_stub_20_yaml_document_start_event_initialize
  : _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> bool -> int
  = "yaml_stub_20_yaml_document_start_event_initialize" 

external yaml_stub_21_yaml_document_end_event_initialize
  : _ CI.fatptr -> bool -> int
  = "yaml_stub_21_yaml_document_end_event_initialize" 

external yaml_stub_22_yaml_alias_event_initialize
  : _ CI.fatptr -> _ CI.fatptr -> int
  = "yaml_stub_22_yaml_alias_event_initialize" 

external yaml_stub_23_yaml_scalar_event_initialize
  : _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> int ->
    bool -> bool -> Unsigned.uint32 -> int
  =
  "yaml_stub_23_yaml_scalar_event_initialize_byte8" "yaml_stub_23_yaml_scalar_event_initialize"
  

external yaml_stub_24_yaml_sequence_start_event_initialize
  : _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> bool -> Unsigned.uint32 ->
    int = "yaml_stub_24_yaml_sequence_start_event_initialize" 

external yaml_stub_25_yaml_sequence_end_event_initialize : _ CI.fatptr -> int
  = "yaml_stub_25_yaml_sequence_end_event_initialize" 

external yaml_stub_26_yaml_mapping_start_event_initialize
  : _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> bool -> Unsigned.uint32 ->
    int = "yaml_stub_26_yaml_mapping_start_event_initialize" 

external yaml_stub_27_yaml_mapping_end_event_initialize : _ CI.fatptr -> int
  = "yaml_stub_27_yaml_mapping_end_event_initialize" 

type 'a result = 'a
type 'a return = 'a
type 'a fn =
 | Returns  : 'a CI.typ   -> 'a return fn
 | Function : 'a CI.typ * 'b fn  -> ('a -> 'b) fn
let map_result f x = f x
let returning t = Returns t
let (@->) f p = Function (f, p)
let foreign : type a b. string -> (a -> b) fn -> (a -> b) =
  fun name t -> match t, name with
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int)),
  "yaml_mapping_end_event_initialize" ->
  (fun x1 ->
    let CI.CPointer x2 = x1 in
    yaml_stub_27_yaml_mapping_end_event_initialize x2)
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x6; _},
        Function
          (CI.View {CI.ty = CI.Pointer _; write = x10; _},
           Function
             (CI.Primitive CI.Bool,
              Function
                (CI.View {CI.ty = CI.Primitive CI.Uint32_t; write = x15; _},
                 Returns (CI.Primitive CI.Int)))))),
  "yaml_mapping_start_event_initialize" ->
  (fun x3 x5 x9 x13 x14 ->
    let CI.CPointer x12 = x10 x9 in
    let CI.CPointer x8 = x6 x5 in
    let CI.CPointer x4 = x3 in
    let x7 = x8 in
    let x11 = x12 in
    let x16 = x15 x14 in
    yaml_stub_26_yaml_mapping_start_event_initialize x4 x7 x11 x13 x16)
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int)),
  "yaml_sequence_end_event_initialize" ->
  (fun x17 ->
    let CI.CPointer x18 = x17 in
    yaml_stub_25_yaml_sequence_end_event_initialize x18)
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x22; _},
        Function
          (CI.View {CI.ty = CI.Pointer _; write = x26; _},
           Function
             (CI.Primitive CI.Bool,
              Function
                (CI.View {CI.ty = CI.Primitive CI.Uint32_t; write = x31; _},
                 Returns (CI.Primitive CI.Int)))))),
  "yaml_sequence_start_event_initialize" ->
  (fun x19 x21 x25 x29 x30 ->
    let CI.CPointer x28 = x26 x25 in
    let CI.CPointer x24 = x22 x21 in
    let CI.CPointer x20 = x19 in
    let x23 = x24 in
    let x27 = x28 in
    let x32 = x31 x30 in
    yaml_stub_24_yaml_sequence_start_event_initialize x20 x23 x27 x29 x32)
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x36; _},
        Function
          (CI.View {CI.ty = CI.Pointer _; write = x40; _},
           Function
             (CI.View {CI.ty = CI.Pointer _; write = x44; _},
              Function
                (CI.Primitive CI.Int,
                 Function
                   (CI.Primitive CI.Bool,
                    Function
                      (CI.Primitive CI.Bool,
                       Function
                         (CI.View
                            {CI.ty = CI.Primitive CI.Uint32_t; write = x51;
                             _},
                          Returns (CI.Primitive CI.Int))))))))),
  "yaml_scalar_event_initialize" ->
  (fun x33 x35 x39 x43 x47 x48 x49 x50 ->
    let CI.CPointer x46 = x44 x43 in
    let CI.CPointer x42 = x40 x39 in
    let CI.CPointer x38 = x36 x35 in
    let CI.CPointer x34 = x33 in
    let x37 = x38 in
    let x41 = x42 in
    let x45 = x46 in
    let x52 = x51 x50 in
    yaml_stub_23_yaml_scalar_event_initialize x34 x37 x41 x45 x47 x48 x49 x52)
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x56; _},
        Returns (CI.Primitive CI.Int))),
  "yaml_alias_event_initialize" ->
  (fun x53 x55 ->
    let CI.CPointer x58 = x56 x55 in
    let CI.CPointer x54 = x53 in
    let x57 = x58 in yaml_stub_22_yaml_alias_event_initialize x54 x57)
| Function
    (CI.Pointer _,
     Function (CI.Primitive CI.Bool, Returns (CI.Primitive CI.Int))),
  "yaml_document_end_event_initialize" ->
  (fun x59 x61 ->
    let CI.CPointer x60 = x59 in
    yaml_stub_21_yaml_document_end_event_initialize x60 x61)
| Function
    (CI.Pointer _,
     Function
       (CI.Pointer _,
        Function
          (CI.Pointer _,
           Function
             (CI.Pointer _,
              Function (CI.Primitive CI.Bool, Returns (CI.Primitive CI.Int)))))),
  "yaml_document_start_event_initialize" ->
  (fun x62 x64 x66 x68 x70 ->
    let CI.CPointer x69 = x68 in
    let CI.CPointer x67 = x66 in
    let CI.CPointer x65 = x64 in
    let CI.CPointer x63 = x62 in
    yaml_stub_20_yaml_document_start_event_initialize x63 x65 x67 x69 x70)
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int)),
  "yaml_stream_end_event_initialize" ->
  (fun x71 ->
    let CI.CPointer x72 = x71 in
    yaml_stub_19_yaml_stream_end_event_initialize x72)
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Primitive CI.Uint32_t; write = x76; _},
        Returns (CI.Primitive CI.Int))),
  "yaml_stream_start_event_initialize" ->
  (fun x73 x75 ->
    let CI.CPointer x74 = x73 in
    let x77 = x76 x75 in
    yaml_stub_18_yaml_stream_start_event_initialize x74 x77)
| Function
    (CI.Pointer _, Function (CI.Pointer _, Returns (CI.Primitive CI.Int))),
  "yaml_emitter_emit" ->
  (fun x78 x80 ->
    let CI.CPointer x81 = x80 in
    let CI.CPointer x79 = x78 in yaml_stub_17_yaml_emitter_emit x79 x81)
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int)),
  "yaml_emitter_flush" ->
  (fun x82 ->
    let CI.CPointer x83 = x82 in yaml_stub_16_yaml_emitter_flush x83)
| Function (CI.Pointer _, Function (CI.Primitive CI.Bool, Returns CI.Void)),
  "yaml_emitter_set_unicode" ->
  (fun x84 x86 ->
    let CI.CPointer x85 = x84 in
    yaml_stub_15_yaml_emitter_set_unicode x85 x86)
| Function (CI.Pointer _, Function (CI.Primitive CI.Int, Returns CI.Void)),
  "yaml_emitter_set_width" ->
  (fun x87 x89 ->
    let CI.CPointer x88 = x87 in yaml_stub_14_yaml_emitter_set_width x88 x89)
| Function (CI.Pointer _, Function (CI.Primitive CI.Int, Returns CI.Void)),
  "yaml_emitter_set_indent" ->
  (fun x90 x92 ->
    let CI.CPointer x91 = x90 in yaml_stub_13_yaml_emitter_set_indent x91 x92)
| Function (CI.Pointer _, Function (CI.Primitive CI.Bool, Returns CI.Void)),
  "yaml_emitter_set_canonical" ->
  (fun x93 x95 ->
    let CI.CPointer x94 = x93 in
    yaml_stub_12_yaml_emitter_set_canonical x94 x95)
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Primitive CI.Uint32_t; write = x99; _},
        Returns CI.Void)),
  "yaml_emitter_set_encoding" ->
  (fun x96 x98 ->
    let CI.CPointer x97 = x96 in
    let x100 = x99 x98 in yaml_stub_11_yaml_emitter_set_encoding x97 x100)
| Function
    (CI.Pointer _,
     Function
       (CI.Pointer _,
        Function
          (CI.Primitive CI.Size_t, Function (CI.Pointer _, Returns CI.Void)))),
  "yaml_emitter_set_output_string" ->
  (fun x101 x103 x105 x106 ->
    let CI.CPointer x107 = x106 in
    let CI.CPointer x104 = x103 in
    let CI.CPointer x102 = x101 in
    yaml_stub_10_yaml_emitter_set_output_string x102 x104 x105 x107)
| Function (CI.Pointer _, Returns CI.Void), "yaml_emitter_delete" ->
  (fun x108 ->
    let CI.CPointer x109 = x108 in yaml_stub_9_yaml_emitter_delete x109)
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int)),
  "yaml_emitter_initialize" ->
  (fun x110 ->
    let CI.CPointer x111 = x110 in yaml_stub_8_yaml_emitter_initialize x111)
| Function
    (CI.Pointer _, Function (CI.Pointer _, Returns (CI.Primitive CI.Int))),
  "yaml_parser_parse" ->
  (fun x112 x114 ->
    let CI.CPointer x115 = x114 in
    let CI.CPointer x113 = x112 in yaml_stub_7_yaml_parser_parse x113 x115)
| Function
    (CI.Pointer _,
     Function
       (CI.Pointer _, Function (CI.Primitive CI.Size_t, Returns CI.Void))),
  "yaml_parser_set_input_string" ->
  (fun x116 x118 x120 ->
    let CI.CPointer x119 = x118 in
    let CI.CPointer x117 = x116 in
    yaml_stub_6_yaml_parser_set_input_string x117 x119 x120)
| Function (CI.Pointer _, Returns CI.Void), "yaml_parser_delete" ->
  (fun x121 ->
    let CI.CPointer x122 = x121 in yaml_stub_5_yaml_parser_delete x122)
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int)),
  "yaml_parser_initialize" ->
  (fun x123 ->
    let CI.CPointer x124 = x123 in yaml_stub_4_yaml_parser_initialize x124)
| Function (CI.Pointer _, Returns CI.Void), "yaml_token_delete" ->
  (fun x125 ->
    let CI.CPointer x126 = x125 in yaml_stub_3_yaml_token_delete x126)
| Function
    (CI.Pointer _,
     Function (CI.Pointer _, Function (CI.Pointer _, Returns CI.Void))),
  "yaml_get_version" ->
  (fun x127 x129 x131 ->
    let CI.CPointer x132 = x131 in
    let CI.CPointer x130 = x129 in
    let CI.CPointer x128 = x127 in
    yaml_stub_2_yaml_get_version x128 x130 x132)
| Function
    (CI.Void, Returns (CI.View {CI.ty = CI.Pointer x134; read = x135; _})),
  "yaml_get_version_string" ->
  (fun x133 ->
    x135 (CI.make_ptr x134 (yaml_stub_1_yaml_get_version_string x133)))
| _, s ->  Printf.ksprintf failwith "No match for %s" s


let foreign_value : type a. string -> a Ctypes.typ -> a Ctypes.ptr =
  fun name t -> match t, name with
| _, s ->  Printf.ksprintf failwith "No match for %s" s

OCaml

Innovation. Community. Security.