C and C++ Binaries

Program Points: cs_pdg_vertex.h

Defines a set of operations on points (cs_pdg_vertex) for CodeSonar.

Internal representation for points is available for C/C++ and binary analyses only. For C# and Java analyses, plug-ins that rely on point properties and relationships will generally not produce useful information.


Links


Defines

#define CS_PDG_VERTEX_H
#define CS_PDG_VERTEX_NULL (cs_pdg_vertex_get_null()) The null cs_pdg_vertex.
#define CS_PDG_VERTEX_INL_H

Types

enum cs_vertex_kind
Definition typedef enum {
cs_vertex_kind_reserved_000 , [CodeSurfer only] VERTEX_KIND_NULL
cs_vertex_kind_global_actual_in , [CodeSurfer only] Kind global-actual-in.
cs_vertex_kind_global_actual_out , [CodeSurfer only] Kind global-actual-out.
cs_vertex_kind_global_formal_in , [CodeSurfer only] Kind global-formal-in.
cs_vertex_kind_global_formal_out , [CodeSurfer only] Kind global-formal-out.
cs_vertex_kind_actual_in , Kind actual-in.
cs_vertex_kind_actual_out , Kind actual-out.
cs_vertex_kind_formal_in , Kind formal-in.
cs_vertex_kind_formal_out , Kind formal-out.
cs_vertex_kind_call_site , Kind call-site.
cs_vertex_kind_indirect_call , Kind indirect-call.
cs_vertex_kind_reserved_002 , [CodeSurfer only] CALLPOST_VERTEX
cs_vertex_kind_entry , Kind entry.
cs_vertex_kind_body , Kind body.
cs_vertex_kind_preexit , Kind preexit.
cs_vertex_kind_exit , Kind exit.
cs_vertex_kind_declaration , [CodeSurfer only] Kind declaration.
cs_vertex_kind_variable_initialization , Kind variable-initialization.
cs_vertex_kind_control_point , Kind control-point.
cs_vertex_kind_jump , Kind jump.
cs_vertex_kind_label , Kind label.
cs_vertex_kind_switch_case , Kind switch-case.
cs_vertex_kind_return , Kind return.
cs_vertex_kind_expression , Kind expression.
cs_vertex_kind_unavailable , Kind unavailable.
cs_vertex_kind_reserved_004 , [CodeSurfer only] USER_DEFINED_VERTEX
cs_vertex_kind_auxiliary , [CodeSurfer only] Kind auxiliary.
cs_vertex_kind_phi , [CodeSurfer only] Kind phi.
cs_vertex_kind_pi , [CodeSurfer only] Kind pi.
cs_vertex_kind_normal_exit , [CodeSurfer only] Kind normal-exit.
cs_vertex_kind_excpt_exit , [CodeSurfer only] Kind exceptional-exit.
cs_vertex_kind_normal_return , [CodeSurfer only] Kind normal-return.
cs_vertex_kind_excpt_return , [CodeSurfer only] Kind exceptional-return.
cs_vertex_kind_hammock_header , [CodeSurfer only] Kind hammock-header.
cs_vertex_kind_hammock_exit , [CodeSurfer only] Kind hammock-exit.
cs_vertex_kind_count the number of kinds in cs_vertex_kind
} cs_vertex_kind
Notes Enumeration of kinds associated with cs_pdg_vertex.

Functions

cs_result cs_pdg_vertex_kind_name ( cs_vertex_kind kind, cs_const_string * out_string )
Retrieve the name of a cs_vertex_kind.
csint64 cs_pdg_vertex_id ( cs_pdg_vertex pv )
Find the unique identifier of a given cs_pdg_vertex.
cs_vertex_kind cs_pdg_vertex_kind ( cs_pdg_vertex pv )
Determine the kind of a cs_pdg_vertex.
cs_vertex_syntax_kind cs_pdg_vertex_syntax_kind ( cs_pdg_vertex pv )
Determine the syntax kind of a cs_pdg_vertex.
cs_vertex_syntax_element cs_pdg_vertex_syntax_element ( cs_pdg_vertex pv )
Determine the syntax element of a cs_pdg_vertex.
cs_boolean cs_vertex_kind_participates_in_cfg ( cs_vertex_kind k )
Determine whether vertices of a given cs_vertex_kind appear in a CFG.
cs_result cs_pdg_vertex_pdg ( cs_pdg_vertex pv, cs_pdg * out_pdg )
Retrieve the cs_pdg containing a given cs_pdg_vertex.
cs_result cs_pdg_vertex_ast ( cs_pdg_vertex pv, cs_ast_family ast_family, cs_ast * out_ast )
Retrieve the cs_ast associated with a given cs_pdg_vertex.
cs_result cs_pdg_vertex_charpos ( cs_pdg_vertex pv, cs_sfid * out_sfid, cs_const_int_pair_set * out_set )
Find the character positions (in the source code) for a given cs_pdg_vertex.
cs_result cs_pdg_vertex_file_line ( cs_pdg_vertex pv, cs_sfid * out_sfid, cs_line * out_line )
Find the file instance and line of the smallest offset for a given cs_pdg_vertex.
cs_result cs_pdg_vertex_characters ( cs_pdg_vertex pv, cs_string out_string, cs_size_t capacity_bytes, cs_size_t * bytes_needed )
Construct a cs_string representation of a given cs_pdg_vertex.
cs_result cs_pdg_vertex_rank ( cs_pdg_vertex pv, cs_size_t * out )
Retrieve the rank of a cs_pdg_vertex.
cs_result cs_pdg_vertex_cfg_inter_targets ( cs_pdg_vertex pv, cs_cfg_edge_set * out_set )
Retrieve the inter-procedural successors of a cs_pdg_vertex.
cs_result cs_pdg_vertex_cfg_targets ( cs_pdg_vertex pv, cs_const_cfg_edge_set * out_set )
Retrieve the intra-procedural successors of a cs_pdg_vertex.
cs_result cs_pdg_vertex_solitary_cfg_target ( cs_pdg_vertex pv, cs_pdg_vertex * out_vertex )
Retrieve the CFG successor of a cs_pdg_vertex that has exactly one successor CFG edge.
cs_result cs_pdg_vertex_actual_to_formals ( cs_pdg_vertex pv, cs_pdg_vertex_set * out_set )
Retrieve the formal-in points (cs_pdg_vertex) associated with a given actual-in point.
cs_result cs_pdg_vertex_actuals_in ( cs_pdg_vertex pv, cs_pdg_vertex_set * out_set )
Retrieve the actual-in and global-actual-in points (cs_pdg_vertex) associated with a given call site cs_pdg_vertex.
cs_result cs_pdg_vertex_actuals_out ( cs_pdg_vertex pv, cs_pdg_vertex_set * out_set )
Retrieve the actual-out and global-actual-out points (cs_pdg_vertex) associated with a given call site cs_pdg_vertex.
cs_result cs_pdg_vertex_actuals_in_as_list ( cs_pdg_vertex pv, cs_pdg_vertex actual_ins[], cs_size_t capacity_bytes, cs_size_t * bytes_needed )
Retrieve a list of the actual-in and global-actual-in points (cs_pdg_vertex) associated with a given call site cs_pdg_vertex.
cs_result cs_pdg_vertex_actuals_out_as_list ( cs_pdg_vertex pv, cs_pdg_vertex actual_outs[], cs_size_t capacity_bytes, cs_size_t * bytes_needed )
Retrieve a list of the actual-out points (cs_pdg_vertex) associated with a given call site cs_pdg_vertex.
cs_result cs_pdg_vertex_actual_in ( cs_pdg_vertex pv, cs_size_t rank, cs_pdg_vertex * ai_vertex )
Retrieve the actual-in points (cs_pdg_vertex), having the specified rank, associated with a given call site cs_pdg_vertex.
cs_result cs_pdg_vertex_actual_out ( cs_pdg_vertex pv, cs_size_t rank, cs_pdg_vertex * ao_vertex )
Retrieve the actual-out points (cs_pdg_vertex), having the specified rank, associated with a given call site cs_pdg_vertex.
cs_result cs_pdg_vertex_call_site ( cs_pdg_vertex pv, cs_pdg_vertex * out_vertex )
Retrieve the call site of a subordinate vertex.
cs_result cs_pdg_vertex_callee ( cs_pdg_vertex call_site, cs_pdg * out_pdg )
Retrieve the callee cs_pdg for a call site.
cs_boolean cs_pdg_vertex_is_inside_macro ( cs_pdg_vertex v )
Determine whether a cs_pdg_vertex is entirely contained inside a macro.
cs_boolean cs_pdg_vertex_is_implicit_actual_in ( cs_pdg_vertex v )
Determine whether a cs_pdg_vertex is an actual-in that is implicitly generated.
cs_result cs_pdg_vertex_source_pp ( cs_pdg_vertex pv, cs_string buf, cs_size_t capacity_bytes, cs_size_t * bytes_needed )
[CodeSonar only] Given a cs_pdg_vertex, get a cs_string containing a pretty printed version of the vertex.
csuint64 cs_pdg_vertex_condition_number ( cs_pdg_vertex pv )
[CodeSonar only] Given a cs_pdg_vertex, get its condition number.
const char * cs_pdg_vertex_source_pp_string ( cs_pdg_vertex pv )
[CodeSonar only] Given a cs_pdg_vertex, get a string containing a pretty printed version of the vertex.
const char * cs_pdg_vertex_string ( cs_pdg_vertex pv )
Get a string representation of a cs_pdg_vertex containing information useful for debugging.
cs_hash_t cs_pdg_vertex_stable_hash ( cs_pdg_vertex pv )
Get a hash value for a cs_pdg_vertex, with stable results across sufficiently-similar analyses.
int cs_pdg_vertex_stable_compare ( cs_pdg_vertex pv_a, cs_pdg_vertex pv_b )
Compare two cs_pdg_vertex objects, with stable results across sufficiently-similar analyses.
cs_result cs_pdg_vertex_get_handle ( cs_pdg_vertex pdg_vertex, cs_string pdg_vertex_handle, cs_size_t capacity_bytes, cs_size_t * bytes_needed )
Get a storable handle for a point (cs_pdg_vertex).
cs_result cs_pdg_vertex_lookup_handle ( cs_const_string pdg_vertex_handle, cs_pdg_vertex * pdg_vertex )
Retrieve a point (cs_pdg_vertex) from a handle.
cs_boolean cs_pdg_vertex_equal ( cs_pdg_vertex pv1, cs_pdg_vertex pv2 )
Check: are two cs_pdg_vertex objects equal?
int cs_pdg_vertex_compare ( cs_pdg_vertex pv_a, cs_pdg_vertex pv_b )
Compare two cs_pdg_vertex objects.
cs_hash_t cs_pdg_vertex_hash ( cs_pdg_vertex pv )
Hash function for cs_pdg_vertex.
cs_hash_t cs_pdg_vertex_hash_seed ( cs_pdg_vertex pv, cs_hash_t hashseed )
Seeded hash function for cs_pdg_vertex.
cs_boolean cs_pdg_vertex_is_null ( cs_pdg_vertex pv )
Determine whether a cs_pdg_vertex is null.
cs_pdg_vertex cs_pdg_vertex_get_null ( )
Return a null cs_pdg_vertex.

Function Descriptions

Function cs_pdg_vertex_kind_name
cs_result cs_pdg_vertex_kind_name (
Retrieve the name of a cs_vertex_kind.
Parameters
kind [in] The cs_vertex_kind for which the name is to be retrieved.
out_string [out] The string representation of the name of kind.
Returns A cs_result:
Time-Complexity O(1)
Function cs_pdg_vertex_id
csint64 cs_pdg_vertex_id (
Find the unique identifier of a given cs_pdg_vertex.
Parameters
pv [in] The cs_pdg_vertex for which the id is to be obtained.
Returns The unique identifier of pv.
Time-Complexity O(1)
Notes Return the unique identifier of pv.
  • Identifiers are unique within each cs_pdg.
  • In an incremental analysis where the containing compilation unit is not recompiled, a cs_pdg_vertex will have the same identifier that it did in the incremental parent.
  • In all other cases identifiers do not persist between different analyses of the same project (or the same code in a different project).

To get a cs_pdg_vertex given its ID, use cs_pdg_retrieve_vertex().

Function cs_pdg_vertex_kind
cs_vertex_kind cs_pdg_vertex_kind (
Determine the kind of a cs_pdg_vertex.
Parameters
pv [in] The cs_pdg_vertex for which to find the cs_vertex_kind.
Returns The kind of pv.
Time-Complexity O(1)
Function cs_pdg_vertex_syntax_kind
cs_vertex_syntax_kind cs_pdg_vertex_syntax_kind (
Determine the syntax kind of a cs_pdg_vertex.
Parameters
pv [in] The cs_pdg_vertex for which to find the cs_vertex_syntax_kind.
Returns The syntax kind of pv.
Time-Complexity O(1)
Function cs_pdg_vertex_syntax_element
cs_vertex_syntax_element cs_pdg_vertex_syntax_element (
Determine the syntax element of a cs_pdg_vertex.
Parameters
pv [in] The cs_pdg_vertex for which to find the cs_vertex_syntax_element.
Returns The syntax element of pv.
Time-Complexity O(1)
Function cs_vertex_kind_participates_in_cfg
cs_boolean cs_vertex_kind_participates_in_cfg (
Determine whether vertices of a given cs_vertex_kind appear in a CFG.
Parameters
k [in] The vertex kind in question
Returns cs_true iff a vertex of kind k can ever appear in a CFG, cs_false otherwise.
Function cs_pdg_vertex_pdg
cs_result cs_pdg_vertex_pdg (
Retrieve the cs_pdg containing a given cs_pdg_vertex.
Parameters
pv [in] The cs_pdg_vertex for which to identify the cs_pdg of which it is a part.
out_pdg [out] The cs_pdg containing pv.
Returns A cs_result:
Time-Complexity O(1)
Function cs_pdg_vertex_ast
cs_result cs_pdg_vertex_ast (
Retrieve the cs_ast associated with a given cs_pdg_vertex.
Parameters
pv [in] The cs_pdg_vertex for which to get the AST.
ast_family [in] Vertices may be associated with multiple ASTs. This specifies which one to get. Each language dependent AST header file will define its AST families.
out_ast [out] The cs_ast (of family ast_family) associated with pv.
Returns A cs_result:
Time-Complexity O(1)
Function cs_pdg_vertex_charpos
cs_result cs_pdg_vertex_charpos (
Find the character positions (in the source code) for a given cs_pdg_vertex.
Parameters
pv [in] The cs_pdg_vertex for which the character positions are to be obtained.
out_sfid [in] The cs_sfid in which pv occurs.
out_set [out] The cs_int_pair_set representing the character positions of pv in out_sfid. This set is immutable and must not be modified or freed.
Returns A cs_result:
Time-Complexity O(1)
Function cs_pdg_vertex_file_line
cs_result cs_pdg_vertex_file_line (
Find the file instance and line of the smallest offset for a given cs_pdg_vertex.
Parameters
pv [in] The cs_pdg_vertex for which the file instance and line are to be obtained.
out_sfid [out] The cs_sfid of the file instance containing pv.
out_line [out] The (smallest offset) line on which pv occurs in the file instance denoted by out_sfid.
Returns A cs_result:
Time-Complexity O(n), where n is the number of pairs in cs_pdg_vertex_charpos( pv,... )
Function cs_pdg_vertex_characters
cs_result cs_pdg_vertex_characters (
Construct a cs_string representation of a given cs_pdg_vertex.
Parameters
pv [in] The cs_pdg_vertex for which to construct a string representation.
out_string [out] A user-allocated cs_string to be populated with the string representation of pv.
capacity_bytes [in] The capacity of out_string, measured in bytes.
bytes_needed [out] The number of bytes required to store the entire string representation of pv.
Returns A cs_result:
Time-Complexity O(*bytes_needed) time on a 'hit'. If the compilation unit and/or source file involved have not been accessed recently, then the running time will be worse.
Notes Construct a cs_string representation of a given cs_pdg_vertex. The string is formed by concatenating all characters in the source file that are associated with pv.

Call this function with out_string NULL and capacity_bytes 0 (zero) to determine the memory needed to hold the entire representation.

Function cs_pdg_vertex_rank
cs_result cs_pdg_vertex_rank (
Retrieve the rank of a cs_pdg_vertex.
Parameters
pv [in] The cs_pdg_vertex for which to obtain the rank.
out [out] A cs_integer representing the rank of pv.
Returns A cs_result:
Time-Complexity O(1)
Notes Retrieve the rank of a cs_pdg_vertex. Rank starts at 1, with globals coming first, followed by non-globals. For non-globals, rank shows the order they appear in the source.
Function cs_pdg_vertex_cfg_inter_targets
cs_result cs_pdg_vertex_cfg_inter_targets (
Retrieve the inter-procedural successors of a cs_pdg_vertex.
Parameters
pv [in] The cs_pdg_vertex for which to obtain inter-procedural successors.
out_set [out] The cs_cfg_edge_set containing inter-procedural successors (cs_pdg_vertex) to pv and their corresponding kinds (cs_pdg_edge_kind). This set is immutable and must not be modified or freed.
Returns A cs_result:
Notes See CFG Edges for more information.
Function cs_pdg_vertex_cfg_targets
cs_result cs_pdg_vertex_cfg_targets (
Retrieve the intra-procedural successors of a cs_pdg_vertex.
Parameters
pv [in] The cs_pdg_vertex for which to obtain intra-procedural successors.
out_set [out] The cs_cfg_edge_set containing the intra-procedural successors (cs_pdg_vertex) to pv and their corresponding kinds (cs_pdg_edge_kind). This set is immutable and must not be modified or freed.
Returns A cs_result:
Time-Complexity O(1)
Notes See CFG Edges for more information.
Function cs_pdg_vertex_solitary_cfg_target
cs_result cs_pdg_vertex_solitary_cfg_target (
Retrieve the CFG successor of a cs_pdg_vertex that has exactly one successor CFG edge.
Parameters
pv [in] The cs_pdg_vertex for which to retrieve the successor.
out_vertex [out] The CFG successor of pv.
Returns A cs_result:
Time-Complexity O(1)
Notes Note that if pv has one CFG successor vertex but there are multiple CFG edges from pv to that successor, this function will return CS_PDG_VERTEX_HAS_ZERO_OR_MULTIPLE_SUCCESSORS.

See CFG Edges for more information.

Function cs_pdg_vertex_actual_to_formals
cs_result cs_pdg_vertex_actual_to_formals (
Retrieve the formal-in points (cs_pdg_vertex) associated with a given actual-in point.
Parameters
pv [in] The actual-in cs_pdg_vertex for which to find the associated formal-in points.
out_set [out] A cs_pdg_vertex_set containing the formal-in points associated with pv. The user is responsible for closing this set: use cs_pdg_vertex_set_close().
Returns A cs_result:
Notes Retrieve the formal-in points (cs_pdg_vertex) associated with a given actual-in point. If pv has kind cs_vertex_kind_actual_in and is a call to a defined function, then return a cs_pdg_vertex_set containing the formal-in vertex associated with pv.

The modeling of the GNU extension __builtin_apply leads to the possibility that more than one formal can be associated with a given actual. In this case, the cs_pdg_vertex_set returned will contain several formals.

Function cs_pdg_vertex_actuals_in
cs_result cs_pdg_vertex_actuals_in (
Retrieve the actual-in and global-actual-in points (cs_pdg_vertex) associated with a given call site cs_pdg_vertex.
Parameters
pv [in] The call site cs_pdg_vertex for which to find the associated actual-in points.
out_set [out] A cs_pdg_vertex_set containing the actual-in and global-actual-in vertices associated with pv. The user is responsible for closing this set: use cs_pdg_vertex_set_close().
Returns A cs_result:
Function cs_pdg_vertex_actuals_out
cs_result cs_pdg_vertex_actuals_out (
Retrieve the actual-out and global-actual-out points (cs_pdg_vertex) associated with a given call site cs_pdg_vertex.
Parameters
pv [in] The call site cs_pdg_vertex for which to find the associated actual-out points.
out_set [out] A cs_pdg_vertex_set containing the actual-out and global-actual-out vertices associated with pv. The user is responsible for closing this set: use cs_pdg_vertex_set_close().
Returns A cs_result:
Function cs_pdg_vertex_actuals_in_as_list
cs_result cs_pdg_vertex_actuals_in_as_list (
Retrieve a list of the actual-in and global-actual-in points (cs_pdg_vertex) associated with a given call site cs_pdg_vertex.
Parameters
pv [in] The call site cs_pdg_vertex for which to find the associated actual-in points.
actual_ins [out] A user-allocated array to be populated with the actual-in points associated with pv.
capacity_bytes [in] The capacity of actual_ins, measured in bytes.
bytes_needed [out] The number of bytes required to store the entire list of the actual-in vertices associated with pv.
Returns A cs_result:
Notes Call this function with actual_ins NULL and capacity_bytes 0 (zero) to determine the memory needed to hold the entire list.
Function cs_pdg_vertex_actuals_out_as_list
cs_result cs_pdg_vertex_actuals_out_as_list (
Retrieve a list of the actual-out points (cs_pdg_vertex) associated with a given call site cs_pdg_vertex.
Parameters
pv [in] The call site cs_pdg_vertex for which to find the associated actual-out points.
actual_outs [out] A user-allocated array to be populated with the actual-out points associated with pv.
capacity_bytes [in] The capacity of actual_outs, measured in bytes.
bytes_needed [out] The number of bytes required to store the entire list of the actual-out vertices associated with pv.
Returns A cs_result:
Notes Call this function with actual_outs NULL and capacity_bytes 0 (zero) to determine the memory needed to hold the entire list.
Function cs_pdg_vertex_actual_in
cs_result cs_pdg_vertex_actual_in (
Retrieve the actual-in points (cs_pdg_vertex), having the specified rank, associated with a given call site cs_pdg_vertex.
Parameters
pv [in] The call site cs_pdg_vertex for which to find the associated actual-in points.
rank [in] The (1-based) index of the actual-in to retrieve.
ai_vertex [out] The retrieved actual-in vertex.
Returns A cs_result:
Function cs_pdg_vertex_actual_out
cs_result cs_pdg_vertex_actual_out (
Retrieve the actual-out points (cs_pdg_vertex), having the specified rank, associated with a given call site cs_pdg_vertex.
Parameters
pv [in] The call site cs_pdg_vertex for which to find the associated actual-out points.
rank [in] The (1-based) index of the actual-out to retrieve.
ao_vertex [out] The retrieved actual-out vertex.
Returns A cs_result:
Notes

In most languages (including C and C++), only an actual-out of rank 1 can exist. It corresponds to the return value of a function.

Function cs_pdg_vertex_call_site
cs_result cs_pdg_vertex_call_site (
Retrieve the call site of a subordinate vertex.
Parameters
pv [in] A vertex of one of the following kinds (cs_vertex_kind):
  • cs_vertex_kind_global_actual_in
  • cs_vertex_kind_global_actual_out
  • cs_vertex_kind_actual_in
  • cs_vertex_kind_actual_out
  • cs_vertex_kind_indirect_call
  • cs_vertex_kind_normal_return
  • cs_vertex_kind_excpt_return
out_vertex [out] A cs_pdg_vertex of kind cs_vertex_kind_call_site.
Returns
Notes Some cs_vertex_kind_indirect_call vertices will not have a corresponding call-site; CS_ELEMENT_NOT_PRESENT will be returned both in this case and when a vertex of the wrong kind is supplied.
Function cs_pdg_vertex_callee
cs_result cs_pdg_vertex_callee (
Retrieve the callee cs_pdg for a call site.
Parameters
call_site [in] The call site cs_pdg_vertex for which to find the callee cs_pdg.
out_pdg [out] The cs_pdg for the callee of call_site.
Returns A cs_result:
Time-Complexity O(1)
Function cs_pdg_vertex_is_inside_macro
cs_boolean cs_pdg_vertex_is_inside_macro (
Determine whether a cs_pdg_vertex is entirely contained inside a macro.
Parameters
v [in] The cs_pdg_vertex of interest.
Returns A cs_boolean:
  • cs_true if v lies entirely inside a C or C++ macro expansion.
  • cs_false otherwise, including the case where only part of v is inside a macro expansion.
Notes This function will return cs_false if only part of the cs_pdg_vertex is inside a macro expansion. For example, if pv is the vertex corresponding to the assignment "p = NULL", cs_pdg_vertex_is_inside_macro(pv) will return cs_false.
Function cs_pdg_vertex_is_implicit_actual_in
cs_boolean cs_pdg_vertex_is_implicit_actual_in (
Determine whether a cs_pdg_vertex is an actual-in that is implicitly generated.
Parameters
v [in] The cs_pdg_vertex of interest.
Returns A cs_boolean:
  • cs_true if v is an actual-in and if that actual-in is implicit.
  • cs_false otherwise
Notes An implicit actual-in can occur in C++ code where the callee returns a non-trivial C++ object. For example:
std::string s = std::to_string(1)

will have two actual-ins, where the first is implicit:
[actual-in] $param_1 = &s
[actual-in] $param_2 = 1

Note that default arguments are not considered implicit, despite also not being written at the call site.
Function cs_pdg_vertex_source_pp
cs_result cs_pdg_vertex_source_pp (
[CodeSonar only] Given a cs_pdg_vertex, get a cs_string containing a pretty printed version of the vertex.
Parameters
pv [in] The cs_pdg_vertex for which to obtain the string.
buf [out] A user-allocated cs_string to be populated with the pretty printed version of the vertex.
capacity_bytes [in] The capacity of buf, measured in bytes.
bytes_needed [out] The number of bytes required to store the entire string.
Returns A cs_result:
Notes Call this function with buf NULL and capacity_bytes 0 (zero) to determine the memory needed to hold the entire string.
Function cs_pdg_vertex_condition_number
csuint64 cs_pdg_vertex_condition_number (
[CodeSonar only] Given a cs_pdg_vertex, get its condition number.
Parameters
pv [in] The cs_pdg_vertex for which to obtain the condition number.
Returns The condition number or 0 on failure.
Notes Each group of vertices in the same conditional will share the same condition number. The value has no meaning, beyond grouping vertices by conditional. A conditional is defined as the predicate of one if statement or loop. Multiple vertices can arise from one conditional because normalizations decompose a single if statement into many vertices in the presence of language features such as short-circuiting connectives.
Function cs_pdg_vertex_source_pp_string
const char * cs_pdg_vertex_source_pp_string (
[CodeSonar only] Given a cs_pdg_vertex, get a string containing a pretty printed version of the vertex.
Parameters
pv [in] The cs_pdg_vertex for which to obtain the string.
Returns The empty string if this vertex does not have this information, otherwise a string with the pretty printed version of the vertex.
Notes Aborts if the cs_vertex_kind of pv is not one of cs_vertex_kind_actual_in, cs_vertex_kind_expression, cs_vertex_kind_call_site, or cs_vertex_kind_control_point.

Do not modify or free the returned buffer.

This function entails less user overhead than cs_pdg_vertex_source_pp(), and so can be more convenient to use; the tradeoff is that the returned value is not under user control and has a constrained lifetime.

Function cs_pdg_vertex_string
const char * cs_pdg_vertex_string (
Get a string representation of a cs_pdg_vertex containing information useful for debugging.
Parameters
pv [in] The cs_pdg_vertex whose representation is to be obtained.
Returns A pointer to a buffer containing the representation of v (as a char*). The buffer is only valid until another API function is invoked.
Notes Do not modify or free the returned buffer.
Function cs_pdg_vertex_stable_hash
cs_hash_t cs_pdg_vertex_stable_hash (
Get a hash value for a cs_pdg_vertex, with stable results across sufficiently-similar analyses.
Parameters
pv [in] The cs_pdg_vertex value to hash.
Returns A hash derived from pv.
Notes This hash value is stable in the following sense. Suppose there are two analyses A1 and A2 generated with exactly the same inputs (including identical analyzed code, underlying build commands and ordering, command line and configuration settings, increment order and contents). Let v1 be a cs_pdg_vertex in A1, and v2 be the cs_pdg_vertex in A2 that corresponds to v1. Then cs_pdg_vertex_stable_hash(v1)==cs_pdg_vertex_stable_hash(v2).

If you do not need hash values to be stable across analyses, use cs_pdg_vertex_hash(): it has better performance.

Function cs_pdg_vertex_stable_compare
int cs_pdg_vertex_stable_compare (
Compare two cs_pdg_vertex objects, with stable results across sufficiently-similar analyses.
Parameters
pv_a [in] First argument to comparison.
pv_b [in] Second argument to comparison.
Returns An integer N, such that:
  • N<0 if pv_a considered less than pv_b
  • N==0 if pv_a and pv_b are the same cs_pdg_vertex
  • N>0 if pv_a considered greater than pv_b
Notes This function is provided so cs_pdg_vertex objects can be stored in ordered containers that provide stable iteration order.

The comparison is stable in the following sense. Suppose there are two analyses A1 and A2 generated with exactly the same inputs (including identical analyzed code, underlying build commands and ordering, command line and configuration settings, increment order and contents). Let a1 and b1 be two cs_pdg_vertex values in A1, and a2 and b2 be the cs_pdg_vertex values in A2 that correspond to a1 and b1 respectively. Then cs_pdg_vertex_stable_compare(a1,b1)==cs_pdg_vertex_stable_compare(a2,b2).

If you do not need comparison results to be stable across different analyses, use cs_pdg_vertex_compare(): it has better performance.

Function cs_pdg_vertex_get_handle
cs_result cs_pdg_vertex_get_handle (
Get a storable handle for a point (cs_pdg_vertex).
Parameters
pdg_vertex [in] The cs_pdg_vertex to return a handle for.
pdg_vertex_handle [out] The handle of the point.
capacity_bytes [in] The size of the provided buffer.
bytes_needed [out] Buffer size needed for the handle.
Returns A cs_result:
Notes This function returns a handle to the point which is suitable for storing externally, allowing the point to be retrieved whenever needed.
Function cs_pdg_vertex_lookup_handle
cs_result cs_pdg_vertex_lookup_handle (
Retrieve a point (cs_pdg_vertex) from a handle.
Parameters
pdg_vertex_handle [in] The handle of the point.
pdg_vertex [out] A cs_pdg_vertex matching the handle.
Returns A cs_result:
Notes This function uses the provided handle to retrieve a point.
Function cs_pdg_vertex_equal
cs_boolean cs_pdg_vertex_equal (
Check: are two cs_pdg_vertex objects equal?
Parameters
pv1 [in] First argument to equality test.
pv2 [in] Second argument to equality test.
Returns cs_true if pv1 and pv2 are the same cs_pdg_vertex; cs_false if not.
Function cs_pdg_vertex_compare
int cs_pdg_vertex_compare (
Compare two cs_pdg_vertex objects.
Parameters
pv_a [in] First argument to comparison.
pv_b [in] Second argument to comparison.
Returns An integer N, such that:
  • N<0 if pv_a is considered less than pv_b
  • N==0 if pv_a and pv_b are the same cs_pdg_vertex
  • N>0 if pv_a is considered greater than pv_b
Notes This function is provided so cs_pdg_vertex objects can be stored in ordered containers. It is not based on any user-perceivable order of cs_pdg_vertex objects.

For fixed cs_pdg_vertex values a and b in a single analysis, cs_pdg_vertex_compare(a,b) will always return the same value. However, cs_pdg_vertex_compare() will not necessarily return this same value when called on the corresponding cs_pdg_vertex values a' and b' in a different analysis. Function cs_pdg_vertex_stable_compare() provides some degree of stability across analyses, although restrictions still apply. If you do not need comparison results to be stable across different analyses, use cs_pdg_vertex_compare(): it has better performance.

Function cs_pdg_vertex_hash
cs_hash_t cs_pdg_vertex_hash (
Hash function for cs_pdg_vertex.
Parameters
pv [in] A cs_pdg_vertex to hash.
Returns A hash of pv.
Notes For a fixed cs_pdg_vertex v in a single analysis, cs_pdg_vertex_hash(v) will always return the same value. However, cs_pdg_vertex_hash() will not necessarily return this same value when called on the corresponding cs_pdg_vertex v' in a different analysis. Function cs_pdg_vertex_stable_hash() provides some degree of stability across analyses, although restrictions still apply. If you do not need hash values to be stable across different analyses, use cs_pdg_vertex_hash(): it has better performance.
Function cs_pdg_vertex_hash_seed
cs_hash_t cs_pdg_vertex_hash_seed (
Seeded hash function for cs_pdg_vertex.
Parameters
pv [in] A cs_pdg_vertex to hash.
hashseed [in] The hash seed to use.
Returns A hash of pv, seeded by hashseed.
Function cs_pdg_vertex_is_null
cs_boolean cs_pdg_vertex_is_null (
Determine whether a cs_pdg_vertex is null.
Parameters
pv [in] The cs_pdg_vertex to check for nullity.
Returns cs_true if all bits of pv are zeroed; cs_false otherwise.
Notes No CodeSonar API function should ever return a null cs_pdg_vertex, with the exception of cs_pdg_vertex_get_null().
Function cs_pdg_vertex_get_null
cs_pdg_vertex cs_pdg_vertex_get_null ( )
Return a null cs_pdg_vertex.
Returns A null cs_pdg_vertex.