JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.
If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.
If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.
| CodeSonar® 9.0p0 Hot Tips | CONFIDENTIAL | CodeSecure Inc |
Defines operations for cross-referencing.
| #define CS_XREF_H |
| Definition | typedef csuint32 cs_xref_occ_iter_flags |
|---|---|
| Notes | Flags for setting up a cs_xref_occ_iter iterator.
Used by cs_xref_occ_iter_first(). Values for cs_xref_occ_iter_flags are defined in an anonymous enum, which this documentation will refer to as anonymous_cs_xref_occ_iter_flags_enum. |
| Definition | typedef csuint32 cs_xref_def_iter_flags |
|---|---|
| Notes | Flags for setting up a cs_xref_def_iter iterator.
Used by cs_xref_def_iter_first() Values for cs_xref_def_iter_flags are defined in an anonymous enum, which this documentation will refer to as anonymous_cs_xref_def_iter_flags_enum. |
| Definition | typedef struct __cs_xref_def_iter cs_xref_def_iter |
|---|---|
| Notes | An iterator over the definitions of a token.
Used by: API clients should never directly access the fields of this type. This is only exported so that clients may stack allocate these things. Future versions of the API reserve the right to change the definition of this iterator type. |
| Definition | typedef struct __cs_xref_occ_iter cs_xref_occ_iter |
|---|---|
| Notes | An iterator over the occurrences of a token.
Used by: API clients should never directly access the fields of this type. This is only exported so that clients may stack allocate these things. Future versions of the API reserve the right to change the definition of this iterator type. |
| Definition | typedef struct __cs_xref_intra_def_iter cs_xref_intra_def_iter |
|---|---|
| Notes | An iterator over the definitions of a token in a single compilation unit.
Used by: API clients should never directly access the fields of this type. This is only exported so that clients may stack allocate these things. Future versions of the API reserve the right to change the definition of this iterator type. |
| Definition | typedef struct __cs_xref_file_query cs_xref_file_query |
|---|---|
| Notes | Included in a cs_xref_query to specify which files to consider.
When constructing a cs_xref_file_query, memset it to 0 initially before setting the individual fields. |
| Definition | typedef cs_result(* cs_xref_query_iterator_fn_t)(const cs_xref_tuple *t, void *ctx) |
|---|---|
| Notes | Will be invoked on every tuple that matches the query.
Parameters:
Returns a cs_result
|
| Definition | typedef int(* cs_xref_query_cmp_fn_t)(const cs_xref_tuple *a, const cs_xref_tuple *b, void *ctx) |
|---|---|
| Notes | Comparison function to be used for sorting the results from executing a cs_xref_query.
Parameters:
Returns an integer x, such that:
|
| Definition | typedef csuint32 cs_xref_query_flags |
|---|---|
| Notes | Flags for specifying properties of a cs_xref_query.
Values for cs_xref_query_flags are defined in an anonymous enum, which this documentation will refer to as anonymous_cs_xref_query_flags_enum. |
| Definition | typedef struct __cs_xref_query cs_xref_query |
|---|---|
| Notes | Fully specifies a query over the tokens in an analyzed project. |
| Definition | typedef struct __cs_xref_query_iter cs_xref_query_iter |
|---|---|
| Notes | A iterator over the results of a cs_xref_query.
Used by: API clients should never directly access the fields of this type. This is only exported so that clients may stack allocate these things. Future versions of the API reserve the right to change the definition of this iterator type. |
| Definition | typedef enum {
|
||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Notes | This is an anonymous enumeration containing values for cs_xref_occ_iter_flags - the anonymous_cs_xref_occ_iter_flags_enum label is provided only for ease of reference within this documentation. |
| Definition | typedef enum {
|
||||||
|---|---|---|---|---|---|---|---|
| Notes | This is an anonymous enumeration containing values for cs_xref_def_iter_flags - the anonymous_cs_xref_def_iter_flags_enum label is provided only for ease of reference within this documentation. |
| Definition | typedef enum {
|
||||||||
|---|---|---|---|---|---|---|---|---|---|
| Notes | This is an anonymous enumeration containing values for cs_xref_query_flags - the anonymous_cs_xref_query_flags_enum label is provided only for ease of reference within this documentation. |
| struct __cs_xref_def_iter |
| struct __cs_xref_occ_iter |
| struct __cs_xref_intra_def_iter |
| struct __cs_xref_file_query |
| struct __cs_xref_query |
| struct __cs_xref_query_iter |
| cs_xr_kind | cs_xr_kind_lookup ( cs_const_string kname )
Get the cs_xr_kind object with the specified name.
|
| cs_xr_role | cs_xr_role_lookup ( cs_const_string rname )
Get the cs_xr_role object with the specified name.
|
| cs_xr_kind_role | cs_xr_kind_role_lookup ( cs_const_string krname )
Get the cs_xr_role object with the specified name.
|
| cs_result | cs_xref_def_iter_first ( cs_sf sf, cs_line fline, csuint64 namehash, cs_xref_def_iter_flags flags, cs_xref_tuple * t, cs_xref_def_iter * iter )
Given an occurrence of a token, set up an iterator over definitions of that entity and retrieve the first item from the iterator.
|
| cs_result | cs_xref_def_iter_next ( cs_xref_tuple * t, cs_xref_def_iter * iter )
Retrieve the next definition from a cs_xref_def_iter iterator.
|
| cs_result | cs_xref_def_iter_close ( cs_xref_def_iter * iter )
Close a cs_xref_def_iter object.
|
| cs_result | cs_xref_occ_iter_first ( cs_sf occ_sf, cs_line occ_line, csuint64 namehash, cs_xr_kind_role kr_filter, cs_size_t limit_per_kind_role, cs_xref_occ_iter_flags iter_flags, cs_xref_tuple * t, cs_xref_occ_iter * iter, cs_xref_result_counters * iter_counters, cs_xref_occ_iter * homonym_iter, cs_xref_result_counters * homonym_iter_counters )
Given a token occurrence: set up an iterator over all occurrences of the corresponding source entity, or over all occurrences of the entity in a specific kind/role, and retrieve the first item from the iterator.
|
| cs_result | cs_xref_occ_iter_next ( cs_xref_tuple * t, cs_xref_occ_iter * iter )
Retrieve the next occurrence from a cs_xref_occ_iter iterator.
|
| cs_result | cs_xref_occ_iter_close ( cs_xref_occ_iter * iter )
Close a cs_xref_occ_iter object.
|
| cs_result | cs_xref_intra_def_iter_first ( cs_sf sf, cs_line line_lb, cs_line line_ub, cs_xref_tuple * t, cs_xref_intra_def_iter * iter )
Given a code region, set up an iterator over the definitions - in the same compilation unit - of all source entities with occurrences in that region, and retrieve the first definition from the iterator.
|
| cs_result | cs_xref_intra_def_iter_next ( cs_xref_tuple * t, cs_xref_intra_def_iter * iter )
Retrieve the next definition from a cs_xref_intra_def_iter iterator.
|
| cs_result | cs_xref_intra_def_iter_close ( cs_xref_intra_def_iter * iter )
Close a cs_xref_intra_def_iter object.
|
| cs_result | cs_xref_query_execute ( const cs_xref_query * csq, cs_xref_result_counters * counters )
Execute a cs_xref_query.
|
| cs_result | cs_xref_query_iter_first ( const cs_xref_query * csq, cs_xref_tuple * t, cs_xref_query_iter * iter )
Set up an iterator over the results of a cs_xref_query, and retrieve the first cs_xref_tuple in the result set.
|
| cs_result | cs_xref_query_iter_next ( cs_xref_tuple * t, cs_xref_query_iter * iter )
Retrieve the next cs_xref_tuple from a cs_xref_query_iter.
|
| cs_result | cs_xref_query_iter_close ( cs_xref_query_iter * iter )
Close a cs_xref_query_iter iterator.
|
| cs_result | cs_xref_tuple_token ( const cs_xref_tuple * t, cs_string out_string, cs_size_t capacity_bytes, cs_size_t * bytes_needed )
Get the source token corresponding to the specified cs_xref_tuple.
|
| Parameters |
|
|||
|---|---|---|---|---|
| Returns | The cs_xr_kind whose name is kname. Returns csxrk_count if kname does not correspond to a valid cs_xr_kind. |
| Parameters |
|
|||
|---|---|---|---|---|
| Returns | The cs_xr_role whose name is rname. Returns csxrr_count if rname does not correspond to a valid cs_xr_role. |
| Parameters |
|
|||
|---|---|---|---|---|
| Returns | The cs_xr_kind_role whose name is krname. Returns csxrkr_count if krname does not correspond to a valid cs_xr_kind_role. |
| Parameters |
|
||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
| Parameters |
|
|||
|---|---|---|---|---|
| Returns | CS_SUCCESS on success. |
| Parameters |
|
|||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
| Parameters |
|
|||
|---|---|---|---|---|
| Returns | CS_SUCCESS on success. |
| Parameters |
|
|||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
| Parameters |
|
|||
|---|---|---|---|---|
| Returns | CS_SUCCESS on success. |
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||
| Notes | The query specified by csq is executed, and counters is populated accordingly.
Once the set of query results has been obtained, callback function csq.iterate is applied to each tuple in the result set, in the order specified by csq.cmp. If it returns a non-CS_SUCCESS result R on any tuple, the iteration halts and this function returns R. |
| Parameters |
|
|||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
|||||||||
| Notes | Note that csq.iterate is is not used when iterating over the csq result set with these cs_xref_query_iter iteration functions. |
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
| Parameters |
|
|||
|---|---|---|---|---|
| Returns | CS_SUCCESS on success. |
| Parameters |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||||||||
| Notes | A procedure name token is the procedure basename as returned by cs_pdg_basename().
Call this function with out_string NULL and capacity_bytes 0 (zero) to determine the memory needed to hold the retrieved token. |