Module Functions.Libc

module Libc: sig .. end

val is_memcpy : Cil_types.exp -> bool

Return true if exp captures a function name that matches memcpy or an equivalent function

val is_memcpy_name : string -> bool

Same as is_memcpy but for strings

val is_memset : Cil_types.exp -> bool

Return true if exp captures a function name that matches memset or an equivalent function

val is_memset_name : string -> bool

Same as is_memset but for strings

val is_dyn_alloc : Cil_types.exp -> bool

Return true if exp captures a function name that matches a function that dynamically allocates memory such as malloc or calloc

val is_dyn_alloc_name : string -> bool

Same as is_dyn_alloc but for strings

val is_dyn_free : Cil_types.exp -> bool

Return true if exp captures a function name that matches a function that dynamically deallocates memory (e.g., free)

val is_dyn_free_name : string -> bool

Same as is_dyn_free but for strings

val is_vla_free : Cil_types.exp -> bool

Return true if exp captures a function name that matches a function that allocates memory for a variable-size array.

val is_vla_free_name : string -> bool

Return true if string captures a function name that matches a function that deallocates memory for a variable-size array.

val is_vla_alloc : Cil_types.exp -> bool

Return true if exp captures a function name that matches a function that deallocates memory for a variable-size array.

val is_vla_alloc_name : string -> bool

Same as is_dyn_alloc but for strings

val is_alloca : Cil_types.exp -> bool

Return true if exp captures a function name that matches a function that allocates memory on stack.

val is_alloca_name : string -> bool

Same as is_alloca but for strings

val is_printf : Cil_types.exp -> bool

Return true if exp captures a function name that matches a printf-like function such as printf, fprintf, dprintf etc.

val is_printf_name : string -> bool

Same as is_printf but for strings

val printf_fmt_position : string -> int

Given the name of a printf-like function (as determined by is_printf_name) return the number of arguments preceding its variadic arguments.

val get_printf_argument_str : loc:Cil_types.location -> string -> Cil_types.exp list -> Cil_types.exp

Given the name of a printf-like function and the list of its variadic arguments return a literal string expression where each character describes the type of an argument from a list. Such characters are also called abbreviated types. Conversion between abbreviated and C types characters is as follows:

val actual_alloca : string

The name of an actual alloca function used at link-time. In GCC/Clang alloca is typically implemented via __builtin_alloca