home
topology files
command‑line options
the core API
FAQ
download and install
|
cnet's Application Programming Interface
- NAME
- CNET_trace_name - request that a descriptive name be reported for
a traced address.
- SYNOPSIS
-
#include <cnet.h>
int CNET_trace_name(void *address, const char *name);
- DESCRIPTION
-
Many of
cnet 's standard functions accept parameters that
are memory addresses, typically to receive results "passed back from"
or "filled in by" the functions.
By default,
when cnet traces a node's execution these addresses are printed
as large, often meaningless, hexadecimal constants.
Each call to
CNET_trace_name() associates a character string, or name ,
with an address .
If cnet needs to report that address when execution is being traced,
the associated string will be reported instead of the hexademical
value.
This is most helpful when the actual name of a C variable or function
is associated with its address.
This enables cnet to report the much more helpful name whenever
the address is being traced.
- RETURN VALUE
-
The value
0 is returned on success.
On failure, the value -1 is returned,
and the global variable cnet_errno is set to the
following value to describe the error:
ER_BADARG
- Either the provided address is
NULL ,
or the associated name is the NULL or empty string.
|