123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263(****************************************************************************)(* *)(* This file is part of MOPSA, a Modular Open Platform for Static Analysis. *)(* *)(* Copyright (C) 2017-2019 The MOPSA Project. *)(* *)(* This program 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 3 of the License, or *)(* (at your option) any later version. *)(* *)(* This program 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 program. If not, see <http://www.gnu.org/licenses/>. *)(* *)(****************************************************************************)(** Types corresponding to placeholders of format strings *)openC_ASTopenFormat(** C type of a placeholder *)typeplaceholder_type=|Intofinteger_type|Floatoffloat_type|Pointer|String|WideStringletpp_placeholder_typefmt=function|Intct->fprintffmt"Int %s"(C_print.string_of_integer_typect)|Floatft->fprintffmt"Float %s"(C_print.string_of_float_typeft)|Pointer->fprintffmt"Ptr"|String->fprintffmt"String"|WideString->fprintffmt"WideString"(** Placeholder for output streams, e.g. printf *)typeoutput_placeholder={op_width:intoption;op_precision:intoption;op_typ:placeholder_type;}letpp_output_placeholderfmtop=Format.fprintffmt"{%a;_;_}"pp_placeholder_typeop.op_typtypeoutput_format=|Stringofstring|Placeholderofoutput_placeholder(** Placeholder for input streams, e.g. scanf *)typeinput_placeholder={ip_width:intoption;ip_typ:placeholder_type;}letpp_input_placeholderfmtip=Format.fprintffmt"{%a;_;_}"pp_placeholder_typeip.ip_typ