-safe-string

This commit is contained in:
John Whitington 2018-07-30 13:58:25 +01:00
parent 1635580c73
commit 18075b84ce
4 changed files with 251 additions and 244 deletions

View File

@ -7,8 +7,8 @@ RESULT = cpdf
ANNOTATE = true
PACKS = camlpdf
OCAMLNCFLAGS = -g -unsafe-string -w -3 -annot
OCAMLBCFLAGS = -g -unsafe-string -w -3 -annot
OCAMLNCFLAGS = -g -safe-string -w -3 -annot
OCAMLBCFLAGS = -g -safe-string -w -3 -annot
OCAMLLDFLAGS = -g
all : native-code native-code-library byte-code-library top htdoc

View File

@ -1,3 +1,4 @@
%FIXME: Finish and document -dump-attachments.
%FIXME: Mention that OpenAction supersedes PageLayout so use -remove-dict-option to get rid of it
%FIXME: Document new -hard-box option
%FIXME: Document that -upright also shifts the page to 0,0

View File

@ -961,7 +961,7 @@ struct
let make_output ?(decl = true) ?(nl = false) ?(indent = None)
?(ns_prefix = fun _ ->None) d =
let outs, outc = match d with
| `Channel c -> (output c), (output_char c)
| `Channel c -> (output_substring c), (output_char c)
| `Buffer b -> (Std_buffer.add_substring b), (Std_buffer.add_char b)
| `Fun f ->
let os s p l =

View File

@ -1,7 +1,7 @@
(*---------------------------------------------------------------------------
Copyright 2007 Daniel C. Bünzli. All rights reserved.
Distributed under a BSD3 license, see license at the end of the file.
%%NAME%% release %%VERSION%%
Copyright (c) 2007 Daniel C. Bünzli. All rights reserved.
Distributed under the ISC license, see terms at the end of the file.
%%NAME%% %%VERSION%%
---------------------------------------------------------------------------*)
(** Streaming XML codec.
@ -17,7 +17,7 @@
Consult the {{!io}features and limitations} and {{!ex}examples}
of use.
{e Release %%VERSION%% %%MAINTAINER%% }
{e %%VERSION%% {{:%%PKG_HOMEPAGE%% }homepage}}
{3 References}
{ul
@ -65,10 +65,14 @@ type signal = [ `Dtd of dtd | `El_start of tag | `El_end | `Data of string ]
to the language of the [doc] grammar :
{[doc ::= `Dtd tree
tree ::= `El_start child `El_end
child ::= `Data | tree | epsilon ]}
child ::= `Data trees | trees
trees ::= tree child | epsilon]}
The [trees] production is used to expresses the fact that there will
never be two consecutive `Data signals in the children of an element.
Input and output deal only with well-formed sequences or
exceptions are raised.
*)
exceptions are raised. However on output consecutive [`Data]
signals are allowed. *)
val ns_xml : string
(** Namespace name {{:http://www.w3.org/XML/1998/namespace}value} bound to the
@ -78,6 +82,25 @@ val ns_xmlns : string
(** Namespace name {{:http://www.w3.org/2000/xmlns/}value} bound to the
reserved ["xmlns"] prefix. *)
val pp_dtd : Format.formatter -> dtd -> unit
(** [pp_dtd ppf dtd] prints an unspecified representation of [dtd] on [ppf]. *)
val pp_name : Format.formatter -> name -> unit
(** [pp_name ppf name] prints an unspecified representation of [name] on
[ppf]. *)
val pp_attribute : Format.formatter -> attribute -> unit
(** [pp_attribute ppf att] prints an unspecified representation of [att] on
[ppf]. *)
val pp_tag : Format.formatter -> tag -> unit
(** [pp_tag ppf tag] prints an unspecified representation of [tag] on
[ppf]. *)
val pp_signal : Format.formatter -> signal -> unit
(** [pp_signal ppf s] prints an unspecified representation of [s] on
[ppf]. *)
(** {1 Input} *)
type pos = int * int
@ -781,34 +804,17 @@ let out_w3c_bureaucrats dst bl =
*)
(*---------------------------------------------------------------------------
Copyright 2007 Daniel C. Bünzli
All rights reserved.
Copyright (c) 2007 Daniel C. Bünzli
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the
distribution.
3. Neither the name of Daniel C. Bünzli nor the names of
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
---------------------------------------------------------------------------*)