wiki:CodingConventions

General

Functions that only return a success/failure, return 0 on success and -1 on failure and update the trace error (using trace_set_err).

Types start with "libtrace_" and end with "_t" and are typedef'd.

Values for enumerated types, such as libtrace_linktype_t or trace_option_t, begin with "TRACE_".

Exported functions start with "trace_" and typically follow the format "trace_<verb>_[<subject>]". Functions that deal with output traces should have an _output suffix. However, we recommend looking up the name of a function you're not certain of rather than trying to guess!

All exported functions and types should be declared in libtrace.h (with the exception of libpacketdump-related functions and types which are declared in libpacketdump.h). This means that libtrace programmers only need to include one header file to gain access to all of the libtrace API and that there is a single point of call to examine the format of any libtrace data structure or function prototype.

libtraceio

This compatibility layer is used to wrap decompression functions and various I/O strategies depending on what is available for your host. See libtraceio.h for more information. Also see format_helper's trace_file_open(). Generally the state of the file after an error has occurred is undefined.

Last modified 12 years ago Last modified on 11/13/08 16:04:56