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.2p0 | CONFIDENTIAL | CodeSecure Inc |
Defines a set of source file operations for CodeSonar.
| #define CS_SOURCE_FILES_H |
| Definition | typedef struct __cs_sf_instance_iter cs_sf_instance_iter |
|---|---|
| Notes | For a specific source file (cs_sf), an iterator over all the instances (cs_sfid) of that file in the analyzed project.
Used by |
| Definition | typedef struct cs_sfid_children_iter cs_sfid_children_iter |
|---|---|
| Notes | An iterator over the file instances (cs_sfid) #included in a specified file instance.
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. |
| struct __cs_sf_instance_iter |
| struct cs_sfid_children_iter |
| cs_boolean | cs_language_is_machine_code ( cs_language lang )
Check: is the specified language is a machine code language (as opposed to a source language or special cs_language value)?
|
| cs_result | cs_file_get_normalized_name ( cs_uid uid, cs_file_path file_path, cs_size_t capacity_bytes, cs_size_t * bytes_needed )
Get the normalized cs_file_path corresponding to a compilation unit.
|
| cs_result | cs_file_get_name ( cs_uid uid, cs_file_path file_path, cs_size_t capacity_bytes, cs_size_t * bytes_needed )
Get the unnormalized cs_file_path corresponding to a compilation unit.
|
| cs_result | cs_file_get_include_pos_name ( cs_sfid sfid, cs_sfid rpath[], cs_size_t capacity_bytes, cs_size_t * bytes_needed )
Get the include path for a source file instance.
|
| cs_result | cs_file_get_normalized_include_name ( cs_sfid sfid, cs_file_path pname, cs_size_t capacity_bytes, cs_size_t * bytes_needed )
Get the normalized absolute path name for a source file instance.
|
| cs_result | cs_file_get_include_name ( cs_sfid sfid, cs_file_path pname, cs_size_t capacity_bytes, cs_size_t * bytes_needed )
Get the unnormalized absolute path name for a source file instance.
|
| cs_result | cs_file_get_normalized_include_name64 ( cs_sfid sfid, cs_const_string64 * pname )
Get the normalized absolute path name for a source file instance.
|
| cs_result | cs_file_get_include_name64 ( cs_sfid sfid, cs_const_string64 * pname )
Get the unnormalized absolute path name for a source file instance.
|
| cs_result | cs_file_get_characters ( cs_sfid sfid, cs_line line_start, cs_column col_start, cs_line line_end, cs_column col_end, cs_string substr, cs_size_t capacity_bytes, cs_size_t * bytes_needed )
Get a substring from a file using (line, column) pairs to specify the beginning and end of the substring.
|
| cs_result | cs_file_ast ( cs_uid uid, cs_ast_family ast_family, cs_ast * out_ast )
Get the cs_ast for a specified compilation unit.
|
| cs_result | cs_file_asts_at ( cs_sfid sfid, cs_line sfline, const cs_ast_class * interest_classes, cs_ast * out_asts, cs_size_t capacity_bytes, cs_size_t * bytes_needed )
Get the ASTs (cs_ast) at a specified location in a compilation unit.
|
| cs_result | cs_file_get_linecount ( cs_sfid sfid, cs_line * out_l )
Get the number of lines in a source file instance.
|
| cs_result | cs_file_get_line_offset ( cs_sfid sfid, cs_line fline, cs_file_offset * out_offset )
Get the character offset for a line within a source file instance.
|
| cs_result | cs_file_get_line_range ( cs_sfid sfid, cs_line fline, cs_file_offset * out_start, cs_file_offset * out_end )
Get the character offsets for the beginning and the end of a line within a source file instance.
|
| cs_result | cs_file_get_line_num ( cs_sfid sfid, cs_file_offset point_offset, cs_line * out_line )
Get the cs_line associated with a point identified by an offset and a source file instance.
|
| cs_result | cs_file_get_linecol ( cs_sfid sfid, cs_file_offset point_offset, cs_line * out_line, cs_column * out_column ) |
| cs_result | cs_file_language ( cs_uid uid, cs_language * lang )
Get the source language of a compilation unit.
|
| cs_result | cs_file_group_uid ( cs_uid uid, csuint32 * group_uid )
Get the group to which a compilation unit belongs.
|
| cs_result | cs_file_webid ( cs_uid uid, cs_string webid, cs_size_t capacity_bytes, cs_size_t * bytes_needed )
[CodeSonar only] Get the value used to identify a compilation unit to the hub: this will allow you to construct a hub URL.
|
| cs_result | cs_file_compiler_model ( cs_uid uid, cs_string compiler_model, cs_size_t capacity_bytes, cs_size_t * bytes_needed )
Get the name of the compiler model used to build uid.
|
| cs_result | cs_file_native_command_line ( cs_uid uid, cs_const_string64 outbuf[], cs_size_t capacity_bytes, cs_size_t * bytes_needed )
Get the native command line used to build uid.
|
| cs_result | cs_file_effective_native_flags ( cs_uid uid, cs_const_string64 outbuf[], cs_size_t capacity_bytes, cs_size_t * bytes_needed )
Get the effective flags for the native build of uid.
|
| cs_result | cs_file_frontend_command_line ( cs_uid uid, cs_const_string64 outbuf[], cs_size_t capacity_bytes, cs_size_t * bytes_needed )
Get the front end command line used to build uid.
|
| cs_result | cs_file_compiler_wall_enable_flags ( cs_uid uid, cs_const_string64 outbuf[], cs_size_t capacity_bytes, cs_size_t * bytes_needed )
Get the list of flags the compiler uses to enable all warnings.
|
| cs_result | cs_file_seen_wall_disable_flags ( cs_uid uid, cs_const_string64 outbuf[], cs_size_t capacity_bytes, cs_size_t * bytes_needed )
Get the list of seen command line options that disable some warnings.
|
| cs_result | cs_file_compiler_werror_enable_flags ( cs_uid uid, cs_const_string64 outbuf[], cs_size_t capacity_bytes, cs_size_t * bytes_needed )
Get the list of flags the compiler uses to treat warnings as errors.
|
| cs_result | cs_file_seen_werror_disable_flags ( cs_uid uid, cs_const_string64 outbuf[], cs_size_t capacity_bytes, cs_size_t * bytes_needed )
Get the list of seen command line options that disable or downgrade errors.
|
| cs_result | cs_file_error_count ( cs_uid uid, cs_size_t * num_errors )
Get the number of errors encountered in compiling a compilation unit.
|
| cs_result | cs_file_warning_count ( cs_uid uid, cs_size_t * num_warnings )
Get the number of warnings encountered compiling the given unit.
|
| cs_result | cs_file_uid_get_sfid ( cs_uid uid, cs_sfid * sfid )
Get the root source file instance of a compilation unit.
|
| cs_result | cs_file_sfid_get_uid ( cs_sfid sfid, cs_uid * uid )
Get the compilation unit to which a specified file instance belongs.
|
| cs_boolean | cs_sfid_is_system_include ( cs_sfid sfid )
Check: is the specified cs_sfid considered a system include according to SYSTEM_INCLUDE_PATHS?
|
| cs_result | cs_file_sfid_get_children ( cs_sfid sfid, cs_sfid child_list[], cs_size_t capacity_bytes, cs_size_t * bytes_needed )
Get the include-tree children of a source file instance.
|
| cs_result | cs_file_sfid_children_iter_first ( cs_sfid sfid, cs_sfid * child, cs_sfid_children_iter * iter )
Get the first cs_sfid from the list of #included file instances for a specified file instance and set up an iterator over the remaining children.
|
| cs_result | cs_file_sfid_children_iter_next ( cs_sfid * child, cs_sfid_children_iter * iter )
Advance the provided include tree child iterator and retrieve the next element.
|
| cs_result | cs_file_sfid_children_iter_close ( cs_sfid_children_iter * iter )
Close a cs_sfid_children_iter iterator.
|
| cs_result | cs_file_sfid_get_parent ( cs_sfid sfid, cs_sfid * arg_parent )
Get the include-tree parent of a source file instance.
|
| cs_result | cs_file_sfid_get_parent_line ( cs_sfid arg_sfid, cs_sfid * arg_parent, cs_line * line )
Get the include location of a source file instance.
|
| cs_result | cs_file_sfid_get_child_at ( cs_sfid sfid, cs_line include_line, cs_sfid * child )
Get the source file instance included at the given location.
|
| cs_result | cs_file_color_map_iter_first ( cs_sfid sfid, cs_syntax_kind syn_kind, cs_line * start_line, cs_column * start_column, cs_line * end_line, cs_column * end_column, cs_color_map_iter * iter )
Get the location of the first span of the specified cs_syntax_kind from the specified source file instance.
|
| cs_result | cs_file_color_map_iter_scan_first ( cs_sfid sfid, cs_syntax_kind syn_kind, cs_line lowerbound, cs_line * start_line, cs_column * start_column, cs_line * end_line, cs_column * end_column, cs_color_map_iter * iter )
Get the location of the first span of the specified cs_syntax_kind at or after the specified line in the specified source file instance; set up an iterator over the remaining spans of that type.
|
| cs_result | cs_file_color_map_iter_next ( cs_line * start_line, cs_column * start_column, cs_line * end_line, cs_column * end_column, cs_color_map_iter * iter )
Get the next span from a cs_color_map_iter iterator.
|
| cs_result | cs_file_color_map_iter_close ( cs_color_map_iter * iter )
Close a cs_color_map_iter iterator.
|
| cs_result | cs_uid_pdgs_iter_first ( cs_uid uid, cs_pdg * pdg, cs_uid_pdgs_iter * itr ) |
| cs_result | cs_uid_pdgs_iter_next ( cs_pdg * pdg, cs_uid_pdgs_iter * itr )
Retrieve the next cs_pdg in a compilation unit, using an iterator.
|
| cs_result | cs_uid_pdgs_iter_close ( cs_uid_pdgs_iter * itr )
Close a cs_uid_pdgs_iter iterator.
|
| cs_result | cs_uid_nonlocals_iter_first ( cs_uid uid, cs_abs_loc * abs_loc, cs_uid_nonlocals_iter * itr )
Get the first nonlocal symbol (cs_abs_loc) from the compilation unit whose cs_uid is uid, and set up an iterator to traverse the remaining nonlocal symbols.
|
| cs_result | cs_uid_nonlocals_iter_next ( cs_abs_loc * abs_loc, cs_uid_nonlocals_iter * itr )
Retrieve the next nonlocal cs_abs_loc in a compilation unit, using an iterator.
|
| cs_result | cs_uid_nonlocals_iter_close ( cs_uid_nonlocals_iter * itr )
Close a cs_uid_nonlocals_iter iterator.
|
| cs_result | cs_file_count_lines ( cs_sfid sfid, cs_line start, cs_line end, cs_size_t * blank_count, cs_size_t * comment_count, cs_size_t * code_count, cs_size_t * mixed_count )
For a set of adjacent lines in a file, retrieve statistics about the classifications of the lines in the set.
|
| cs_result | cs_uid_create ( cs_const_string file_name, cs_language lang, cs_uid * out_uid )
Create a new compilation unit.
|
| cs_boolean | cs_uid_is_user_unit ( cs_uid uid )
Check: does the specified cs_uid correspond to a user-generated compilation unit?
|
| cs_boolean | cs_uid_is_library_model_unit ( cs_uid uid )
Check: does the specified cs_uid correspond to a compilation unit for a library model shipped with CodeSonar or CodeSurfer?
|
| cs_boolean | cs_uid_is_rewriting_unit ( cs_uid uid )
Check: does the specified cs_uid correspond to a rewriting compilation unit (created via cs_uid_create())?
|
| cs_boolean | cs_uid_is_backend_unit ( cs_uid uid )
Check: does the specified cs_uid correspond to a compilation unit generated by the back end to hold #System_Initialization and undefined functions?
|
| cs_result | cs_uid_is_shared_unit ( cs_uid uid, cs_boolean * out )
Check: can a compilation unit be shared by multiple projects and analyses?
|
| cs_result | cs_uid_is_summary ( cs_uid uid, cs_boolean * is_summary )
Get the is_summary flag for this compilation unit.
|
| cs_result | cs_uid_is_hidden_binary ( cs_uid cuid, cs_boolean * is_hidden )
[CodeSonar for Binaries only] Checks if a compilation unit is an 'offstage binary' (that is, one that is analyzed but not included in results).
|
| cs_result | cs_uid_limit_reached ( cs_uid cuid, cs_boolean * limit_reached )
Check: did the front end reach any limits while parsing the specified compilation unit (which may have resulted in missing IR)?
|
| cs_result | cs_sfid_sf ( cs_sfid sfid, cs_sf * sf )
Get the source file corresponding to a specified file instance.
|
| cs_result | cs_sf_arbitrary_sfid ( cs_sf sf, cs_sfid * sfid )
Get an (arbitrary) instance of a specified source file.
|
| cs_result | cs_sf_instance_iter_first ( cs_sf sf, cs_sfid * sfid, cs_sf_instance_iter * iter )
Get the first cs_sfid from the list of instances (in the analyzed project) of the specified source file; set up an iterator over the remaining instances.
|
| cs_result | cs_sf_instance_iter_next ( cs_sfid * sfid, cs_sf_instance_iter * iter )
Get the next instance of a (previously specified) source file, using an iterator.
|
| cs_result | cs_sf_instance_iter_close ( cs_sf_instance_iter * iter )
Close a cs_sf_instance_iter iterator.
|
| cs_result | cs_sf_line_pdgs ( cs_sf sf, cs_line line, cs_boolean exact, cs_pdg pdg_list[], cs_size_t capacity_bytes, cs_size_t * bytes_needed )
Get a list of the PDGs (cs_pdg) whose definition is at the specified source file and line number.
|
| const char * | cs_sfid_normalized_string ( cs_sfid sfid )
Get the normalized absolute path name for a source file instance.
|
| const char * | cs_sfid_string ( cs_sfid sfid )
Get the unnormalized absolute path name for a source file instance.
|
| cs_result | cs_sf_get_parent ( cs_sf sf, cs_directory * dir )
Get the parent cs_directory for a source file.
|
| const char * | cs_sf_normalized_string ( cs_sf sf )
Get the normalized absolute path name for a source file.
|
| const char * | cs_sf_string ( cs_sf sf )
Get the unnormalized absolute path name for a source file.
|
| cs_hash_t | cs_sf_stable_hash ( cs_sf sf )
Get a hash value for a cs_sf, with stable results across sufficiently-similar analyses.
|
| int | cs_sf_stable_compare ( cs_sf sf_a, cs_sf sf_b )
Compare two cs_sf objects, with stable results across sufficiently-similar analyses.
|
| cs_hash_t | cs_sfid_stable_hash ( cs_sfid sf )
Get a hash value for a cs_sfid, with stable results across sufficiently-similar analyses.
|
| int | cs_sfid_stable_compare ( cs_sfid sfid_a, cs_sfid sfid_b )
Compare two cs_sfid objects, with stable results across sufficiently-similar analyses.
|
| const char * | cs_uid_normalized_filename_string ( cs_uid uid )
Get the normalized absolute path name for a compilation unit.
|
| const char * | cs_uid_filename_string ( cs_uid uid )
Get the unnormalized absolute path name for a compilation unit.
|
| const char * | cs_uid_language_string ( cs_uid uid )
Get the name of a compilation unit's language.
|
| cs_result | cs_uid_get_handle ( cs_uid uid, cs_string uid_handle, cs_size_t capacity_bytes, cs_size_t * bytes_needed )
Get a storable handle for a compilation unit (cs_uid).
|
| cs_result | cs_uid_lookup_handle ( cs_const_string uid_handle, cs_uid * uid )
Retrieve a compilation unit (cs_uid) from a handle.
|
| cs_result | cs_sf_get_handle ( cs_sf sf, cs_string sf_handle, cs_size_t capacity_bytes, cs_size_t * bytes_needed )
Get a storable handle for a source file (cs_sf).
|
| cs_result | cs_sf_lookup_handle ( cs_const_string sf_handle, cs_sf * sf )
Retrieve a source file (cs_sf) from a handle.
|
| cs_result | cs_sfid_get_handle ( cs_sfid sfid, cs_string sfid_handle, cs_size_t capacity_bytes, cs_size_t * bytes_needed )
Get a storable handle for a source file instance (cs_sfid).
|
| cs_result | cs_sfid_lookup_handle ( cs_const_string sfid_handle, cs_sfid * sfid )
Retrieve a source file instance (cs_sfid) from a handle.
|
| Parameters |
|
|||
|---|---|---|---|---|
| Returns |
A cs_boolean:
|
| Parameters |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||||||||
| Notes | Use cs_file_get_name() to get the unnormalized cs_file_path.
Call this function with file_path NULL and capacity_bytes 0 (zero) to determine the memory needed to hold the entire path. |
| Parameters |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||||||||
| Notes | Use cs_file_get_normalized_name() to get the normalized cs_file_path.
Call this function with file_path NULL and capacity_bytes 0 (zero) to determine the memory needed to hold the entire path. |
| Parameters |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||||||||
| Notes | Retrieve the include-path for sfid. The include-path is a list of cs_sfid elements.
Call this function with rpath NULL and capacity_bytes 0 (zero) to determine the memory needed to hold the entire path. |
| Parameters |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||||||||
| Notes | Use cs_file_get_include_name() to get the unnormalized cs_file_path.
Call this function with pname NULL and capacity_bytes 0 (zero) to determine the memory needed to hold the entire path. |
| Parameters |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||||||||
| Notes | Use cs_file_get_normalized_include_name() to get the normalized cs_file_path.
Call this function with pname NULL and capacity_bytes 0 (zero) to determine the memory needed to hold the entire path. |
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||
| Notes | Use cs_file_get_include_name64() to get the unnormalized version of the path. |
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||
| Notes | Use cs_file_get_normalized_include_name64() to get the normalized version of the path. |
| Parameters |
|
||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||||||||||||||||||||
| Notes | Call this function with substr NULL and capacity_bytes 0 (zero) to determine the memory needed to hold the entire substring. |
| Parameters |
|
|||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
|||||||||
| Time-Complexity | O(1) |
| Parameters |
|
||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||||||||||||||
| Notes | Call this function with out_asts NULL and capacity_bytes 0 (zero) to determine the memory needed to hold the entire list. |
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns | CS_SUCCESS on success. |
| Parameters |
|
|||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
| Parameters |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||||||||
| Notes | Get the character offsets, from the start of the compilation unit to which sfid belongs, of the first character and the last character of fline. If fline is out of range, out_start and out_end will be the offsets of the beginning and end of the last line in the compilation unit. |
| Parameters |
|
|||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
|||||||||
| Notes | Find the cs_line associated with a point identified by an offset and a source file instance. |
| Parameters |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns |
A cs_result
|
||||||
| Notes | The retrieved cs_language identifies the front end used to build the compilation unit specified by uid and the source language the compilation unit is in. |
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns |
A cs_result
|
||||||
| Notes | For C and C++ compilation units, group_uid will always match uid.
For Java compilation units, group_uid is the first cs_uid encountered during the cs-java-scan invocation that produced the compilation unit with uid. This may be an existing compilation unit UID for a .java file that is being reanalyzed, or a new UID produced for a .java file that does not already have a corresponding compilation unit in the project. For C# compilation units, the situation is analogous to that for Java: group_uid is the first cs_uid encountered during the cs-dotnet-scan invocation that produced the compilation unit with uid. For example, suppose cs-java-scan is invoked on a file J.jar containing two class files: A.class and B.class. Then:
Additional notes:
|
| Parameters |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||||||||
| Notes | The hub URL for the Parse Details Log for uid can be constructed from the value written to webid as follows. Let W be the value written to webid by a successful call to this function; let host:port be the hub location. Then the URL is http://host:port/frontendrun/W.html.
Call this function with webid NULL and capacity_bytes 0 (zero) to determine the memory needed to hold the entire web ID. |
| Parameters |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||||||||
| Notes | Call this function with compiler_model NULL and capacity_bytes 0 (zero) to determine the memory needed to hold the entire compiler model ID. |
| Parameters |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||||||||
| Notes | All compilations built from a single native compiler invocation will share the same native command line.
Call this function with outbuf NULL and capacity_bytes 0 (zero) to determine the memory needed to hold the entire command line. |
| Parameters |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||||||||
| Notes | Retrieves the effective flags after the content of the command file (the file specified as the value of '@') is inserted; input and output file names are removed; and flags like -c, -o are dropped.
Call this function with outbuf NULL and capacity_bytes 0 (zero) to determine the memory needed to hold the entire list. |
| Parameters |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||||||||
| Notes | For the C/C++ front end, this includes options specified with configuration file parameters EDG_FRONTEND_OPTIONS_PREPEND and EDG_FRONTEND_OPTIONS_APPEND, and excludes CodeSurfer options.
Call this function with outbuf NULL and capacity_bytes 0 (zero) to determine the memory needed to hold the entire command line. |
| Parameters |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||||||||
| Notes | For the C/C++ front end, this includes options specified with configuration file parameters EDG_FRONTEND_OPTIONS_PREPEND and EDG_FRONTEND_OPTIONS_APPEND, and excludes CodeSurfer options.
Call this function with outbuf NULL and capacity_bytes 0 (zero) to determine the memory needed to hold the entire command line. |
| Parameters |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||||||||
| Notes | For the C/C++ front end, this includes options specified with configuration file parameters EDG_FRONTEND_OPTIONS_PREPEND and EDG_FRONTEND_OPTIONS_APPEND, and excludes CodeSurfer options.
Call this function with outbuf NULL and capacity_bytes 0 (zero) to determine the memory needed to hold the entire command line. |
| Parameters |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||||||||
| Notes | For the C/C++ front end, this includes options specified with configuration file parameters EDG_FRONTEND_OPTIONS_PREPEND and EDG_FRONTEND_OPTIONS_APPEND, and excludes CodeSurfer options.
Call this function with outbuf NULL and capacity_bytes 0 (zero) to determine the memory needed to hold the entire command line. |
| Parameters |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||||||||
| Notes | For the C/C++ front end, this includes options specified with configuration file parameters EDG_FRONTEND_OPTIONS_PREPEND and EDG_FRONTEND_OPTIONS_APPEND, and excludes CodeSurfer options.
Call this function with outbuf NULL and capacity_bytes 0 (zero) to determine the memory needed to hold the entire command line. |
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||
| Notes | Get the root source file instance of a compilation unit. This can be thought of as the root of the include tree for that compilation unit (for example, the .c file containing main). |
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns | CS_SUCCESS on success. |
| Parameters |
|
|||
|---|---|---|---|---|
| Returns |
A cs_boolean:
|
| Parameters |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns | CS_SUCCESS on success. | ||||||||||||
| Notes | The children of a source file instance are the source file instances that it #includes.
Call this function with child_list NULL and capacity_bytes 0 (zero) to determine the memory needed to hold the entire list. |
| Parameters |
|
|||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
|||||||||
| Notes | The ordering of #included children used by the iterator is not necessarily based on the ordering of #include statements in the file instance. |
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||
| Notes | The ordering of #included children used by the iterator is not necessarily based on the ordering of #include statements in the file instance. |
| Parameters |
|
|||
|---|---|---|---|---|
| Returns | CS_SUCCESS on successful close. |
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns | CS_SUCCESS on success. |
| Parameters |
|
|||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
| Parameters |
|
|||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
| Parameters |
|
|||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
| 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 nonlocals for a compilation unit U are:
To iterate over local variables for PDGs in the compilation unit, use a cs_uid_pdgs_iter iterator (cs_uid_pdgs_iter_first(), cs_uid_pdgs_iter_next(), cs_uid_pdgs_iter_close()) and a cs_pdg_locals_iter iterator (cs_pdg_locals_iter_first(), cs_pdg_locals_iter_next(), cs_pdg_locals_iter_close()). Note that neither a UID nonlocals iterator nor a PDG locals iterator will access symbols (cs_abs_loc) of kind cs_abs_loc_kind_param. To iterate over these, call cs_abs_loc_get_param() with increasing num argument until it returns CS_ELEMENT_NOT_PRESENT. |
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
| Parameters |
|
|||
|---|---|---|---|---|
| Returns | CS_SUCCESS on success. |
| Parameters |
|
|||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns | CS_SUCCESS on success. |
| Parameters |
|
|||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
| Parameters |
|
|||
|---|---|---|---|---|
| Returns |
A cs_boolean:
|
|||
| Notes | This function will return cs_false for the following kinds of compilation units.
|
| Parameters |
|
|||
|---|---|---|---|---|
| Returns |
A cs_boolean:
|
| Parameters |
|
|||
|---|---|---|---|---|
| Returns |
A cs_boolean:
|
| Parameters |
|
|||
|---|---|---|---|---|
| Returns |
A cs_boolean:
|
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||
| Notes | Only compilation units for library models can be shared by multiple projects and analyses. This function checks whether a specific compilation unit fits into this category (it does not check whether any such sharing is currently occurring). |
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns |
A cs_result
|
||||||
| Notes | If the retrieved is_summary value is cs_true, uid will not be license-charged. |
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
| Parameters |
|
|||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
| Parameters |
|
|||
|---|---|---|---|---|
| Returns | CS_SUCCESS on success. |
| Parameters |
|
||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||||||||||||||
| Time-Complexity | O(nm), where n is the number of cs_sfid elements associated with the cs_sf, and m is the average number of cs_pdg elements per compilation unit associated with the cs_sfid elements. | ||||||||||||||||||
| Notes | Call this function with pdg_list NULL and capacity_bytes 0 (zero) to determine the memory needed to hold the entire list. |
| Parameters |
|
|||
|---|---|---|---|---|
| Returns |
A pointer to a buffer containing the normalized absolute path name for sfid (as a char*). The buffer is only valid until another API function is invoked.
|
|||
| Notes | Do not modify or free the returned buffer.
This function entails less user overhead than cs_file_get_normalized_include_name(), 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. Use cs_sfid_string() to get the unnormalized version of the path. |
| Parameters |
|
|||
|---|---|---|---|---|
| Returns | A pointer to a buffer containing the unnormalized absolute path name for sfid (as a char*). The buffer is only valid until another API function is invoked. | |||
| Notes | Do not modify or free the returned buffer.
This function entails less user overhead than cs_file_get_include_name(), 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. Use cs_sfid_normalized_string() to get the normalized version of the path. |
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns | CS_SUCCESS on success. |
| Parameters |
|
|||
|---|---|---|---|---|
| Returns |
A pointer to a buffer containing the normalized absolute path name for sf (as a char*). The buffer is only valid until another API function is invoked.
|
|||
| Notes | Do not modify or free the returned buffer.
This function entails less user overhead than calling cs_sf_arbitrary_sfid() followed by cs_file_get_normalized_include_name(), 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. Use cs_sf_string() to get the unnormalized version of the path. |
| Parameters |
|
|||
|---|---|---|---|---|
| Returns | A pointer to a buffer containing the unnormalized absolute path name for sf (as a char*). The buffer is only valid until another API function is invoked. | |||
| Notes | Do not modify or free the returned buffer.
This function entails less user overhead than calling cs_sf_arbitrary_sfid() followed by cs_file_get_include_name(), 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. Use cs_sf_normalized_string() to get the normalized version of the path. |
| Parameters |
|
|||
|---|---|---|---|---|
| Returns | A hash derived from sf. | |||
| 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 s1 be a cs_sf in A1, and s2 be the cs_sf in A2 that corresponds to s1. Then cs_sf_stable_hash(s1)==cs_sf_stable_hash(s2).
If you do not need hash values to be stable across analyses, use cs_sf_hash(): it has better performance. |
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns |
An integer N, such that:
|
||||||
| Notes | This function is provided so cs_sf 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_sf values in A1, and a2 and b2 be the cs_sf values in A2 that correspond to a1 and b1 respectively. Then cs_sf_stable_compare(a1,b1)==cs_sf_stable_compare(a2,b2). If you do not need comparison results to be stable across different analyses, use cs_sf_compare(): it has better performance. |
| Parameters |
|
|||
|---|---|---|---|---|
| Returns | A hash derived from sf. | |||
| 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 s1 be a cs_sfid in A1, and s2 be the cs_sfid in A2 that corresponds to s1. Then cs_sfid_stable_hash(s1)==cs_sfid_stable_hash(s2).
If you do not need hash values to be stable across analyses, use cs_sfid_hash(): it has better performance. |
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns |
An integer N, such that:
|
||||||
| Notes | This function is provided so cs_sfid 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_sfid values in A1, and a2 and b2 be the cs_sfid values in A2 that correspond to a1 and b1 respectively. Then cs_sfid_stable_compare(a1,b1)==cs_sfid_stable_compare(a2,b2). If you do not need comparison results to be stable across different analyses, use cs_sfid_compare(): it has better performance. |
| Parameters |
|
|||
|---|---|---|---|---|
| Returns |
A pointer to a buffer containing the absolute path name for uid (as a char*). The buffer is only valid until another API function is invoked.
|
|||
| Notes | Do not modify or free the returned buffer.
This function entails less user overhead than calling cs_file_get_normalized_name(), 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. Use cs_uid_filename_string() to get the unnormalized version of the path. |
| Parameters |
|
|||
|---|---|---|---|---|
| Returns | A pointer to a buffer containing the unnormalized absolute path name for uid (as a char*). The buffer is only valid until another API function is invoked. | |||
| Notes | Do not modify or free the returned buffer.
This function entails less user overhead than calling cs_file_get_name(), 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. Use cs_uid_normalized_filename_string() to get the normalized version of the path. |
| Parameters |
|
|||
|---|---|---|---|---|
| Returns | A pointer to a buffer containing the name of the language for uid (as a char*). The buffer is only valid until another API function is invoked. | |||
| Notes | Do not modify or free the returned buffer.
This function entails less user overhead than calling cs_file_language() followed by cs_language_name(), 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. |
| Parameters |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||||||||
| Notes | This function returns a handle to the compilation unit which is suitable for storing externally, allowing the compilation unit to be retrieved whenever needed. |
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||
| Notes | This function uses the provided handle to retrieve a compilation unit. |
| Parameters |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||||||||
| Notes | This function returns a handle to the source file which is suitable for storing externally, allowing the source file to be retrieved whenever needed. |
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||
| Notes | This function uses the provided handle to retrieve a source file. |
| Parameters |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||||||||
| Notes | This function returns a handle to the source file instance which is suitable for storing externally, allowing the source file instance to be retrieved whenever needed. |
| Parameters |
|
||||||
|---|---|---|---|---|---|---|---|
| Returns |
A cs_result:
|
||||||
| Notes | This function uses the provided handle to retrieve a source file instance. |
To report problems with this documentation, please visit https://support.codesecure.com/.