void (*ND_TraceFunc) (LND_Trace *trace, void *user_data); void nd_trace_registry_init (void); void nd_trace_registry_set_current (LND_Trace *trace); LND_Trace* nd_trace_registry_get_current (void); void nd_trace_registry_add (LND_Trace *trace); void nd_trace_registry_remove (LND_Trace *trace); void nd_trace_registry_foreach (ND_TraceFunc callback, void *user_data); |
void (*ND_TraceFunc) (LND_Trace *trace, void *user_data); |
The trace registry uses functions of this signature as
callbacks for iterating over the registered traces.
See also nd_trace_registry_foreach()
.
the trace iterated.
arbitrary data.
void nd_trace_registry_init (void); |
The trace registry is Netdude's central repository for currently edited traces. This function sets up the necessary data structures and is called when Netdude is launched.
void nd_trace_registry_set_current (LND_Trace *trace); |
There is always one trace in the registry that is the current one, i.e. the one the user has selected right now. This function sets it and updates the GUI accordingly (i.e. adjusts window title etc).
new current trace.
LND_Trace* nd_trace_registry_get_current (void); |
This function returns the current trace. Use this to obtain the
trace when you have no other means, like a
current trace.
void nd_trace_registry_add (LND_Trace *trace); |
In order to register a trace in the registry, use this function. It checks if the trace is already registered and in that case, simply returns. Takes care of adding the trace in the GUI etc.
the added trace.
void nd_trace_registry_remove (LND_Trace *trace); |
Removes a trace from the registry and takes care of updating the gui etc.
trace to remove.
void nd_trace_registry_foreach (ND_TraceFunc callback, void *user_data); |
The function calls callback for every trace currently registered and passes it as first argument. The second argument is the user data, which is simply passed through.
a function of type ND_TraceFunc
arbitrary data passed through to the callback