Skip to content

Commit 7f8f38d

Browse files
committed
Improved readability of external declarations
1 parent b597f8d commit 7f8f38d

File tree

1 file changed

+17
-22
lines changed

1 file changed

+17
-22
lines changed

src/postgresql.ml

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,10 @@ type ftype =
103103
| ANYELEMENT
104104
| JSONB
105105

106-
external ftype_of_oid :
107-
(int (* oid *) [@untagged]) -> ftype
106+
external ftype_of_oid : (oid [@untagged]) -> ftype
108107
= "ftype_of_oid_stub_bc" "ftype_of_oid_stub"
109108

110-
external oid_of_ftype : ftype -> (int (* oid *) [@untagged])
109+
external oid_of_ftype : ftype -> (oid [@untagged])
111110
= "oid_of_ftype_stub_bc" "oid_of_ftype_stub" [@@noalloc]
112111

113112
let string_of_ftype = function
@@ -405,12 +404,10 @@ module Stub = struct
405404
external fformat : result -> (int [@untagged]) -> FFormat.t
406405
= "PQfformat_stub_bc" "PQfformat_stub" [@@noalloc]
407406

408-
external ftype :
409-
result -> (int [@untagged]) -> (int (* oid *) [@untagged])
407+
external ftype : result -> (int [@untagged]) -> (oid [@untagged])
410408
= "PQftype_stub_bc" "PQftype_stub" [@@noalloc]
411409

412-
external paramtype :
413-
result -> (int [@untagged]) -> (int (* oid *) [@untagged])
410+
external paramtype : result -> (int [@untagged]) -> (oid [@untagged])
414411
= "PQparamtype_stub_bc" "PQparamtype_stub"
415412

416413
external fmod : result -> (int [@untagged]) -> (int [@untagged])
@@ -438,7 +435,7 @@ module Stub = struct
438435
external cmd_status : result -> string = "PQcmdStatus_stub"
439436
external cmd_tuples : result -> string = "PQcmdTuples_stub"
440437

441-
external oid_value : result -> (int (* oid *) [@untagged])
438+
external oid_value : result -> (oid [@untagged])
442439
= "PQoidValue_stub_bc" "PQoidValue_stub" [@@noalloc]
443440

444441

@@ -542,57 +539,55 @@ module Stub = struct
542539

543540
(* Large objects *)
544541

545-
external lo_creat : connection -> (int (* oid *) [@untagged])
542+
external lo_creat : connection -> (oid [@untagged])
546543
= "lo_creat_stub_bc" "lo_creat_stub"
547544

548-
external lo_import : connection -> string -> (int (* oid *) [@untagged])
545+
external lo_import : connection -> string -> (oid [@untagged])
549546
= "lo_import_stub_bc" "lo_import_stub"
550547

551548
external lo_export :
552-
connection -> (int (* oid *) [@untagged]) -> string -> (int [@untagged])
549+
connection -> (oid [@untagged]) -> string -> (int [@untagged])
553550
= "lo_export_stub_bc" "lo_export_stub"
554551

555552
external lo_open :
556-
connection -> (int (* oid *) [@untagged]) ->
557-
(int (* large_object *) [@untagged])
553+
connection -> (oid [@untagged]) -> (large_object [@untagged])
558554
= "lo_open_stub_bc" "lo_open_stub"
559555

560556
external lo_close :
561-
connection -> (int (* large_object *) [@untagged]) -> (int [@untagged])
557+
connection -> (large_object [@untagged]) -> (int [@untagged])
562558
= "lo_close_stub_bc" "lo_close_stub"
563559

564560
external lo_tell :
565-
connection -> (int (* large_object *) [@untagged]) -> (int [@untagged])
561+
connection -> (large_object [@untagged]) -> (int [@untagged])
566562
= "lo_tell_stub_bc" "lo_tell_stub"
567563

568-
external lo_unlink :
569-
connection -> (int (* oid *) [@untagged]) -> (int (* oid *) [@untagged])
564+
external lo_unlink : connection -> (oid [@untagged]) -> (oid [@untagged])
570565
= "lo_unlink_stub_bc" "lo_unlink_stub"
571566

572567
external lo_read :
573-
connection -> (int (* large_object *) [@untagged]) ->
568+
connection -> (large_object [@untagged]) ->
574569
Bytes.t -> (int [@untagged]) -> (int [@untagged]) -> (int [@untagged])
575570
= "lo_read_stub_bc" "lo_read_stub"
576571

577572
external lo_read_ba :
578-
connection -> (int (* large_object *) [@untagged]) ->
573+
connection -> (large_object [@untagged]) ->
579574
(char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t ->
580575
(int [@untagged]) -> (int [@untagged]) -> (int [@untagged])
581576
= "lo_read_ba_stub_bc" "lo_read_ba_stub"
582577

583578
external lo_write :
584-
connection -> (int (* large_object *) [@untagged]) ->
579+
connection -> (large_object [@untagged]) ->
585580
string -> (int [@untagged]) -> (int [@untagged]) -> (int [@untagged])
586581
= "lo_write_stub_bc" "lo_write_stub"
587582

588583
external lo_write_ba :
589-
connection -> (int (* large_object *) [@untagged]) ->
584+
connection -> (large_object [@untagged]) ->
590585
(char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t ->
591586
(int [@untagged]) -> (int [@untagged]) -> (int [@untagged])
592587
= "lo_write_ba_stub_bc" "lo_write_ba_stub"
593588

594589
external lo_seek :
595-
connection -> (int (* large_object *) [@untagged]) ->
590+
connection -> (large_object [@untagged]) ->
596591
(int [@untagged]) -> seek_cmd -> (int [@untagged])
597592
= "lo_lseek_stub_bc" "lo_lseek_stub"
598593
end

0 commit comments

Comments
 (0)