C and C++ Binaries

Edge Labels: cs_edge_label.h

Defines a set of cs_edge_label operations.



Links


Defines

#define CS_EDGE_LABEL_H
#define CS_EDGE_LABEL_INL_H

Functions

cs_result cs_edge_label_get_string ( cs_edge_label label, cs_string out_string, cs_size_t capacity_bytes, cs_size_t * bytes_needed )
Get the string representation of a cs_edge_label.
const char * cs_edge_label_string ( cs_edge_label edge_label )
Get the string representation of a cs_edge_label.
cs_edge_label cs_edge_label_true ( )
Get the "T" edge label.
cs_edge_label cs_edge_label_false ( )
Get the "F" edge label.
cs_boolean cs_edge_label_equal ( cs_edge_label el1, cs_edge_label el2 )
Equality test for cs_edge_label objects.
int cs_edge_label_compare ( cs_edge_label el1, cs_edge_label el2 )
Compare two cs_edge_label objects.
cs_hash_t cs_edge_label_hash ( cs_edge_label edge_label )
Hash function for cs_edge_label objects.
cs_edge_label cs_edge_label_create ( cs_const_string s )
Create a new cs_edge_label with specified contents.
cs_boolean cs_edge_label_is_null ( cs_edge_label edge_label )
Check: is the specified cs_edge_label null?
cs_edge_label cs_edge_label_get_null ( )
Get a null cs_edge_label.

Function Descriptions

Function cs_edge_label_get_string
cs_result cs_edge_label_get_string (
Get the string representation of a cs_edge_label.
Parameters
label [in] The cs_edge_label for which to find the string representation.
out_string [out] A user-allocated buffer to be populated with the string representation of label.
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 label.
Returns
  • CS_TRUNCATED if out_string is not large enough to hold the entire string representation of label (and so the string was truncated),
  • CS_SUCCESS otherwise.
Notes Call this function with out_string NULL and capacity_bytes 0 (zero) to determine the memory needed to hold the entire representation.
Function cs_edge_label_string
const char * cs_edge_label_string (
Get the string representation of a cs_edge_label.
Parameters
edge_label [in] The cs_edge_label for which to return the string representation.
Returns A pointer to a buffer containing the string representation of edge_label (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_edge_label_get_string(), 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_edge_label_true
cs_edge_label cs_edge_label_true ( )
Get the "T" edge label.
Returns An edge label. Does not need to be garbage collected.
Function cs_edge_label_false
cs_edge_label cs_edge_label_false ( )
Get the "F" edge label.
Returns An edge label. Does not need to be garbage collected.
Function cs_edge_label_equal
cs_boolean cs_edge_label_equal (
Equality test for cs_edge_label objects.
Parameters
el1 [in] First argument to equality test.
el2 [in] Second argument to equality test.
Returns A cs_boolean:
  • cs_true if el1 is equal to el2,
  • cs_false otherwise.
Function cs_edge_label_compare
int cs_edge_label_compare (
Compare two cs_edge_label objects.
Parameters
el1 [in] First cs_edge_label to compare.
el2 [in] Second cs_edge_label to compare.
Returns An integer N, such that:
  • N<0 if el1 considered less than el2
  • N==0 if el1 considered equal to el2
  • N>0 if el1 considered greater than el2
Notes Equivalent to invoking strcmp on the result of cs_edge_label_get_string.
Function cs_edge_label_hash
cs_hash_t cs_edge_label_hash (
Hash function for cs_edge_label objects.
Parameters
edge_label [in] The cs_edge_label to hash.
Returns A hash of edge_label
Function cs_edge_label_create
cs_edge_label cs_edge_label_create (
Create a new cs_edge_label with specified contents.
Parameters
s [in] The contents of the new cs_edge_label.
Returns A new cs_edge_label containing s.
Function cs_edge_label_is_null
cs_boolean cs_edge_label_is_null (
Check: is the specified cs_edge_label null?
Parameters
edge_label [in] The cs_edge_label to check for nullity.
Returns A cs_boolean:
  • cs_true if all bits of edge_label are zeroed;
  • cs_false otherwise.
Notes No CodeSonar API function should ever return a null cs_edge_label, with the exception of cs_edge_label_get_null().
Function cs_edge_label_get_null
cs_edge_label cs_edge_label_get_null ( )
Get a null cs_edge_label.
Returns A null cs_edge_label.