__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
# 1 "Camomile/public/uTF16.ml"
(** UTF-16 encoded string. *)
(* Copyright (C) 2002, 2003, 2004 Yamagata Yoriyuki. *)
(* This library is free software; you can redistribute it and/or *)
(* modify it under the terms of the GNU Lesser General Public License *)
(* as published by the Free Software Foundation; either version 2 of *)
(* the License, or (at your option) any later version. *)
(* As a special exception to the GNU Library General Public License, you *)
(* may link, statically or dynamically, a "work that uses this library" *)
(* with a publicly distributed version of this library to produce an *)
(* executable file containing portions of this library, and distribute *)
(* that executable file under terms of your choice, without any of the *)
(* additional requirements listed in clause 6 of the GNU Library General *)
(* Public License. By "a publicly distributed version of this library", *)
(* we mean either the unmodified Library as distributed by the authors, *)
(* or a modified version of this library that is distributed under the *)
(* conditions defined in clause 3 of the GNU Library General Public *)
(* License. This exception does not however invalidate any other reasons *)
(* why the executable file might be covered by the GNU Library General *)
(* Public License . *)
(* This library is distributed in the hope that it will be useful, *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *)
(* Lesser General Public License for more details. *)
(* You should have received a copy of the GNU Lesser General Public *)
(* License along with this library; if not, write to the Free Software *)
(* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *)
(* USA *)
(* You can contact the authour by sending email to *)
(* yori@users.sourceforge.net *)
open Bigarray
exception Out_of_range
(* UTF-16 encoded string. the type is bigarray of 16-bits integers. *)
type t = (int, int16_unsigned_elt, c_layout) Array1.t
type index = int
exception Malformed_code
let rec validate_aux (a:t) i =
if i >= Array1.dim a then () else
let n = a.{i} in
if n < 0xd800 || n >= 0xe000 && n < 0xfffe then
validate_aux a (i + 1)
else if n >= 0xd800 && n < 0xdc00 then
if i + 1 >= Array1.dim a then raise Malformed_code else
let n' = a.{i + 1} in
if n' < 0xdc00 || n' >= 0xe000 then raise Malformed_code else
validate_aux a (i + 2)
else raise Malformed_code
let validate (a:t) = validate_aux a 0
let look (a:t) i : UChar.t =
let n0 = a.{i} in
if n0 < 0xd800 || n0 >= 0xe000 then UChar.chr_of_uint n0 else
if n0 < 0xdc00 then
let n1 = a.{i + 1} in
UChar.chr_of_uint
(((n0 - 0xd800) lsl 10) + (n1 - 0xdc00) + 0x10000)
else invalid_arg "UTF16.look"
let rec length_aux (a:t) c i =
if i >= Array1.dim a then c else
let n = a.{i} in
if n < 0xd800 || n >= 0xe000 then length_aux a (c + 1) (i + 1)
else length_aux a (c + 1) (i + 2)
let length (a:t) = length_aux a 0 0
let next (a:t) i =
let n = a.{i} in
if n < 0xd800 || n >= 0xdc00 then i + 1 else
i + 2
let prev (a:t) i =
let i' = i - 1 in
let n = a.{i'} in
if n < 0xdc00 || n >= 0xe000 then i' else i' - 1
let rec move_forward (a:t) i c =
if c > 0 then move_forward a (next a i) (c - 1) else i
let rec move_backward (a:t) i c =
if c < 0 then move_backward a (prev a i) (c + 1) else i
let move (a:t) i c =
if c > 0 then move_forward a i c else
if c < 0 then move_backward a i c else
i
let first _ = 0
let last (a:t) = prev a (Array1.dim a)
let out_of_range (a:t) i = i < 0 || i >= Array1.dim a
let compare_index _ i j = i - j
let nth (a:t) c = move_forward a 0 c
let get (a:t) c = look a (nth a c)
let rec iter_aux proc (a:t) i =
if i >= Array1.dim a then () else begin
proc (look a i);
iter_aux proc a (next a i)
end
let iter proc (a:t) = iter_aux proc a 0
module Buf = struct
let set (a:t) i u =
let n = UChar.uint_code u in
if n < 0 then raise Out_of_range else
if n < 0xd800 || n >= 0xe000 && n <= 0xfffd then begin
a.{i} <- n;
1
end else if n >= 0x10000 && n <= 0x10ffff then begin
a.{i} <- ((n - 0x10000) lsr 10) + 0xd800;
a.{i + 1} <- ((n - 0x10000) land 0x3ff) + 0xdc00;
2
end else
raise Out_of_range
type buf = {init_size : int; mutable pos : index; mutable contents : t}
let create n =
let contents = Array1.create int16_unsigned c_layout n in
{init_size = n; pos = 0; contents = contents}
let clear buf = buf.pos <- 0
let reset buf =
buf.contents <- Array1.create int16_unsigned c_layout buf.init_size;
buf.pos <- 0
let contents buf =
let a = Array1.create int16_unsigned c_layout buf.pos in
let src = Array1.sub buf.contents 0 buf.pos in
Array1.blit src a;
a
let resize buf n =
if Array1.dim buf.contents >= n then () else
let a = Array1.create int16_unsigned c_layout (2 * n) in
let a' = Array1.sub a 0 (Array1.dim buf.contents) in
Array1.blit buf.contents a';
buf.contents <- a
let add_char buf u =
resize buf (buf.pos + 2);
buf.pos <- buf.pos + set buf.contents buf.pos u
let add_string buf (a:t) =
let len = buf.pos + Array1.dim a in
resize buf len;
let b = Array1.sub buf.contents buf.pos (Array1.dim a) in
Array1.blit a b;
buf.pos <- len
let add_buffer buf1 buf2 =
let len = buf1.pos + buf2.pos in
resize buf1 len;
let a = Array1.sub buf2.contents 0 buf2.pos in
let b = Array1.sub buf1.contents buf1.pos buf2.pos in
Array1.blit a b;
buf1.pos <- len
end
let init len f =
let buf = Buf.create (len + 1) in
for i = 0 to len - 1 do Buf.add_char buf (f i) done;
Buf.contents buf
let rec compare_aux (a:t) b i =
if i >= Array1.dim a then 0 else
let n1 = a.{i} in
let n2 = b.{i} in
if n1 = n2 then compare_aux a b (i + 1) else
(if n1 < 0xd800 || n1 >= 0xdc00 then n1 else 0x10000 lor n1) -
(if n2 < 0xd800 || n2 >= 0xdc00 then n2 else 0x10000 lor n2)
let compare (a:t) b =
let sgn = Array1.dim a - Array1.dim b in
if sgn = 0 then compare_aux a b 0 else sgn
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| META | File | 185 B | 0644 |
|
| avlTree.cmi | File | 1.35 KB | 0644 |
|
| avlTree.cmti | File | 10.68 KB | 0644 |
|
| avlTree.cmx | File | 1.04 KB | 0644 |
|
| avlTree.ml | File | 4.59 KB | 0644 |
|
| avlTree.mli | File | 2.39 KB | 0644 |
|
| bitsvect.cmi | File | 985 B | 0644 |
|
| bitsvect.cmti | File | 8.17 KB | 0644 |
|
| bitsvect.cmx | File | 873 B | 0644 |
|
| bitsvect.ml | File | 3.99 KB | 0644 |
|
| bitsvect.mli | File | 2.09 KB | 0644 |
|
| byte_labeled_dag.cmi | File | 616 B | 0644 |
|
| byte_labeled_dag.cmti | File | 6.1 KB | 0644 |
|
| byte_labeled_dag.cmx | File | 677 B | 0644 |
|
| byte_labeled_dag.ml | File | 4.18 KB | 0644 |
|
| byte_labeled_dag.mli | File | 1.98 KB | 0644 |
|
| bytesvect.cmi | File | 987 B | 0644 |
|
| bytesvect.cmti | File | 8.21 KB | 0644 |
|
| bytesvect.cmx | File | 1.06 KB | 0644 |
|
| bytesvect.ml | File | 3.57 KB | 0644 |
|
| bytesvect.mli | File | 2.11 KB | 0644 |
|
| camomile.a | File | 1.47 MB | 0644 |
|
| camomile.cma | File | 1.9 MB | 0644 |
|
| camomile.cmxa | File | 22.44 KB | 0644 |
|
| camomile.cmxs | File | 1.24 MB | 0644 |
|
| camomile.dune | File | 12 B | 0644 |
|
| camomileDefaultConfig.cmi | File | 447 B | 0644 |
|
| camomileDefaultConfig.cmx | File | 335 B | 0644 |
|
| camomileDefaultConfig.ml | File | 271 B | 0644 |
|
| camomileLibrary.cmi | File | 246.42 KB | 0644 |
|
| camomileLibrary.cmti | File | 1.06 MB | 0644 |
|
| camomileLibrary.cmx | File | 35.76 KB | 0644 |
|
| camomileLibrary.ml | File | 70.63 KB | 0644 |
|
| camomileLibrary.mli | File | 171.14 KB | 0644 |
|
| camomileLibraryDefault.cmi | File | 93.54 KB | 0644 |
|
| camomileLibraryDefault.cmti | File | 203.08 KB | 0644 |
|
| camomileLibraryDefault.cmx | File | 34.33 KB | 0644 |
|
| camomileLibraryDefault.ml | File | 1.86 KB | 0644 |
|
| camomileLibraryDefault.mli | File | 2.78 KB | 0644 |
|
| camomileLibraryDyn.cmi | File | 93.53 KB | 0644 |
|
| camomileLibraryDyn.cmti | File | 204.05 KB | 0644 |
|
| camomileLibraryDyn.cmx | File | 34.67 KB | 0644 |
|
| camomileLibraryDyn.ml | File | 3.04 KB | 0644 |
|
| camomileLibraryDyn.mli | File | 3.44 KB | 0644 |
|
| caseMap.cmi | File | 1.58 KB | 0644 |
|
| caseMap.cmti | File | 10.17 KB | 0644 |
|
| caseMap.cmx | File | 990 B | 0644 |
|
| caseMap.ml | File | 9.13 KB | 0644 |
|
| caseMap.mli | File | 2.54 KB | 0644 |
|
| charEncoding.cmi | File | 10.18 KB | 0644 |
|
| charEncoding.cmti | File | 49.47 KB | 0644 |
|
| charEncoding.cmx | File | 3.7 KB | 0644 |
|
| charEncoding.ml | File | 101.14 KB | 0644 |
|
| charEncoding.mli | File | 6.29 KB | 0644 |
|
| charmap.cmi | File | 1.3 KB | 0644 |
|
| charmap.cmti | File | 9.49 KB | 0644 |
|
| charmap.cmx | File | 1.17 KB | 0644 |
|
| charmap.ml | File | 3.54 KB | 0644 |
|
| charmap.mli | File | 2.36 KB | 0644 |
|
| configInt.cmi | File | 379 B | 0644 |
|
| configInt.cmti | File | 3.43 KB | 0644 |
|
| configInt.cmx | File | 176 B | 0644 |
|
| configInt.ml | File | 395 B | 0644 |
|
| configInt.mli | File | 366 B | 0644 |
|
| database.cmi | File | 599 B | 0644 |
|
| database.cmti | File | 7.46 KB | 0644 |
|
| database.cmx | File | 500 B | 0644 |
|
| database.ml | File | 2.61 KB | 0644 |
|
| database.mli | File | 2.64 KB | 0644 |
|
| hangul.cmi | File | 634 B | 0644 |
|
| hangul.cmti | File | 5.85 KB | 0644 |
|
| hangul.cmx | File | 457 B | 0644 |
|
| hangul.ml | File | 3.42 KB | 0644 |
|
| hangul.mli | File | 1.96 KB | 0644 |
|
| iMap.cmi | File | 3.06 KB | 0644 |
|
| iMap.cmti | File | 18.84 KB | 0644 |
|
| iMap.cmx | File | 2.45 KB | 0644 |
|
| iMap.ml | File | 5.21 KB | 0644 |
|
| iMap.mli | File | 2.87 KB | 0644 |
|
| iSet.cmi | File | 3.33 KB | 0644 |
|
| iSet.cmti | File | 19.99 KB | 0644 |
|
| iSet.cmx | File | 3.42 KB | 0644 |
|
| iSet.ml | File | 9.98 KB | 0644 |
|
| iSet.mli | File | 2.92 KB | 0644 |
|
| installConfig.cmi | File | 261 B | 0644 |
|
| installConfig.cmx | File | 225 B | 0644 |
|
| installConfig.ml | File | 37 B | 0644 |
|
| locale.cmi | File | 514 B | 0644 |
|
| locale.cmti | File | 8.02 KB | 0644 |
|
| locale.cmx | File | 615 B | 0644 |
|
| locale.ml | File | 3.13 KB | 0644 |
|
| locale.mli | File | 3 KB | 0644 |
|
| oOChannel.cmi | File | 10.47 KB | 0644 |
|
| oOChannel.cmti | File | 46.42 KB | 0644 |
|
| oOChannel.cmx | File | 508 B | 0644 |
|
| oOChannel.ml | File | 4.63 KB | 0644 |
|
| oOChannel.mli | File | 4.96 KB | 0644 |
|
| opam | File | 566 B | 0644 |
|
| stringPrep.cmi | File | 1.03 KB | 0644 |
|
| stringPrep.cmti | File | 8 KB | 0644 |
|
| stringPrep.cmx | File | 1.02 KB | 0644 |
|
| stringPrep.ml | File | 7.34 KB | 0644 |
|
| stringPrep.mli | File | 2.33 KB | 0644 |
|
| stringPrep_data.cmi | File | 2.15 KB | 0644 |
|
| stringPrep_data.cmti | File | 12.45 KB | 0644 |
|
| stringPrep_data.cmx | File | 4.05 KB | 0644 |
|
| stringPrep_data.ml | File | 3.46 KB | 0644 |
|
| stringPrep_data.mli | File | 2.78 KB | 0644 |
|
| subText.cmi | File | 4.89 KB | 0644 |
|
| subText.cmti | File | 22.76 KB | 0644 |
|
| subText.cmx | File | 1.68 KB | 0644 |
|
| subText.ml | File | 4.9 KB | 0644 |
|
| subText.mli | File | 3.55 KB | 0644 |
|
| tbl31.cmi | File | 2.07 KB | 0644 |
|
| tbl31.cmti | File | 13.38 KB | 0644 |
|
| tbl31.cmx | File | 4.46 KB | 0644 |
|
| tbl31.ml | File | 14.39 KB | 0644 |
|
| tbl31.mli | File | 2.5 KB | 0644 |
|
| uCS4.cmi | File | 2.4 KB | 0644 |
|
| uCS4.cmti | File | 21.35 KB | 0644 |
|
| uCS4.cmx | File | 1.66 KB | 0644 |
|
| uCS4.ml | File | 4.42 KB | 0644 |
|
| uCS4.mli | File | 5.39 KB | 0644 |
|
| uChar.cmi | File | 985 B | 0644 |
|
| uChar.cmti | File | 11.63 KB | 0644 |
|
| uChar.cmx | File | 744 B | 0644 |
|
| uChar.ml | File | 2.64 KB | 0644 |
|
| uChar.mli | File | 3.57 KB | 0644 |
|
| uCharInfo.cmi | File | 5.14 KB | 0644 |
|
| uCharInfo.cmti | File | 31.46 KB | 0644 |
|
| uCharInfo.cmx | File | 2.54 KB | 0644 |
|
| uCharInfo.ml | File | 16.69 KB | 0644 |
|
| uCharInfo.mli | File | 8.5 KB | 0644 |
|
| uCharTbl.cmi | File | 2.22 KB | 0644 |
|
| uCharTbl.cmti | File | 15.08 KB | 0644 |
|
| uCharTbl.cmx | File | 1.92 KB | 0644 |
|
| uCharTbl.ml | File | 2.97 KB | 0644 |
|
| uCharTbl.mli | File | 3.13 KB | 0644 |
|
| uCol.cmi | File | 3.16 KB | 0644 |
|
| uCol.cmti | File | 17.04 KB | 0644 |
|
| uCol.cmx | File | 1.49 KB | 0644 |
|
| uCol.ml | File | 27.44 KB | 0644 |
|
| uCol.mli | File | 3.89 KB | 0644 |
|
| uLine.cmi | File | 7.2 KB | 0644 |
|
| uLine.cmti | File | 29.26 KB | 0644 |
|
| uLine.cmx | File | 598 B | 0644 |
|
| uLine.ml | File | 5.6 KB | 0644 |
|
| uLine.mli | File | 3.71 KB | 0644 |
|
| uMap.cmi | File | 3.43 KB | 0644 |
|
| uMap.cmti | File | 24.03 KB | 0644 |
|
| uMap.cmx | File | 2.37 KB | 0644 |
|
| uMap.ml | File | 3.13 KB | 0644 |
|
| uMap.mli | File | 4.82 KB | 0644 |
|
| uNF.cmi | File | 14.33 KB | 0644 |
|
| uNF.cmti | File | 46.54 KB | 0644 |
|
| uNF.cmx | File | 4.65 KB | 0644 |
|
| uNF.ml | File | 13.73 KB | 0644 |
|
| uNF.mli | File | 3.39 KB | 0644 |
|
| uPervasives.cmi | File | 855 B | 0644 |
|
| uPervasives.cmti | File | 7.21 KB | 0644 |
|
| uPervasives.cmx | File | 1.1 KB | 0644 |
|
| uPervasives.ml | File | 3.38 KB | 0644 |
|
| uPervasives.mli | File | 2.16 KB | 0644 |
|
| uRe.cmi | File | 7.17 KB | 0644 |
|
| uRe.cmti | File | 24.92 KB | 0644 |
|
| uRe.cmx | File | 2.09 KB | 0644 |
|
| uRe.ml | File | 13.63 KB | 0644 |
|
| uRe.mli | File | 3.59 KB | 0644 |
|
| uReStr.cmi | File | 6.99 KB | 0644 |
|
| uReStr.cmti | File | 25.58 KB | 0644 |
|
| uReStr.cmx | File | 2.79 KB | 0644 |
|
| uReStr.ml | File | 5.39 KB | 0644 |
|
| uReStr.mli | File | 4.11 KB | 0644 |
|
| uReStrLexer.cmi | File | 765 B | 0644 |
|
| uReStrLexer.cmx | File | 12.36 KB | 0644 |
|
| uReStrLexer.ml | File | 54.16 KB | 0644 |
|
| uReStrParser.cmi | File | 1.19 KB | 0644 |
|
| uReStrParser.cmti | File | 5.72 KB | 0644 |
|
| uReStrParser.cmx | File | 4.42 KB | 0644 |
|
| uReStrParser.ml | File | 30.53 KB | 0644 |
|
| uReStrParser.mli | File | 458 B | 0644 |
|
| uReStrParserType.cmi | File | 1.11 KB | 0644 |
|
| uReStrParserType.cmti | File | 5.55 KB | 0644 |
|
| uReStrParserType.cmx | File | 287 B | 0644 |
|
| uReStrParserType.ml | File | 608 B | 0644 |
|
| uReStrParserType.mli | File | 564 B | 0644 |
|
| uSet.cmi | File | 3.76 KB | 0644 |
|
| uSet.cmti | File | 24.36 KB | 0644 |
|
| uSet.cmx | File | 3.7 KB | 0644 |
|
| uSet.ml | File | 3.67 KB | 0644 |
|
| uSet.mli | File | 4.56 KB | 0644 |
|
| uTF16.cmi | File | 2.43 KB | 0644 |
|
| uTF16.cmti | File | 21.88 KB | 0644 |
|
| uTF16.cmx | File | 1.82 KB | 0644 |
|
| uTF16.ml | File | 6.02 KB | 0644 |
|
| uTF16.mli | File | 5.67 KB | 0644 |
|
| uTF8.cmi | File | 2.26 KB | 0644 |
|
| uTF8.cmti | File | 22.84 KB | 0644 |
|
| uTF8.cmx | File | 4.17 KB | 0644 |
|
| uTF8.ml | File | 8.51 KB | 0644 |
|
| uTF8.mli | File | 5.91 KB | 0644 |
|
| uText.cmi | File | 3.94 KB | 0644 |
|
| uText.cmti | File | 24.07 KB | 0644 |
|
| uText.cmx | File | 3.5 KB | 0644 |
|
| uText.ml | File | 3.05 KB | 0644 |
|
| uText.mli | File | 3.86 KB | 0644 |
|
| unicodeString.cmi | File | 2.1 KB | 0644 |
|
| unicodeString.cmti | File | 18.29 KB | 0644 |
|
| unicodeString.cmx | File | 206 B | 0644 |
|
| unicodeString.ml | File | 4.59 KB | 0644 |
|
| unicodeString.mli | File | 4.55 KB | 0644 |
|
| unidata.cmi | File | 3.68 KB | 0644 |
|
| unidata.cmti | File | 20.79 KB | 0644 |
|
| unidata.cmx | File | 1.97 KB | 0644 |
|
| unidata.ml | File | 12.91 KB | 0644 |
|
| unidata.mli | File | 5.25 KB | 0644 |
|
| unimap.cmi | File | 1.53 KB | 0644 |
|
| unimap.cmti | File | 11.13 KB | 0644 |
|
| unimap.cmx | File | 1.53 KB | 0644 |
|
| unimap.ml | File | 3.97 KB | 0644 |
|
| unimap.mli | File | 2.48 KB | 0644 |
|
| xArray.cmi | File | 2.8 KB | 0644 |
|
| xArray.cmti | File | 19.54 KB | 0644 |
|
| xArray.cmx | File | 1.64 KB | 0644 |
|
| xArray.ml | File | 4.01 KB | 0644 |
|
| xArray.mli | File | 4.2 KB | 0644 |
|
| xString.cmi | File | 3.42 KB | 0644 |
|
| xString.cmti | File | 20.36 KB | 0644 |
|
| xString.cmx | File | 2.34 KB | 0644 |
|
| xString.ml | File | 4.04 KB | 0644 |
|
| xString.mli | File | 3.38 KB | 0644 |
|