An "I.F. protocol" is a form of
systematic characterization across different implementation files.
If an I.F. subscribes to a protocol, it identifies such a condition through its
"Protocol" global function. BARfly recognizes several of
these protocols and reports the protocols supported by an I.F as plain
text. Choose Information.Show Protocol Info from the
menu to display supported protocols.
In this example, an I.F. is demonstrated to support the "detailedformat,"
"forcebigendian," and "strongvalidation" protocols. The first states the
file format is supported in a detailed fashion (as opposed to
a more general fashion), the second, that the byte order of the file is
all in big-endian, and the third, that the file contains strong
validation. Protocols are constantly being developed and
revised; you should check the official BARfly website frequently to keep track
of protocol definitions and standards.
You can also create private protocols. If you want
to develop several proprietary formats and standardize features across such
formats, you can have each I.F. developed with a common protocol that is never
officially published.
An I.F. is not actually required to support any protocols. If there is
no "Protocol" function defined in an I.F., the I.F. supports no protocols.
To support a protocol in an I.F., create a "Protocol" global
function somewhere in the text body. To get the result in the above
example, make the function body look like this:
bool Protocol(const char *name) {
if (!strcmp(name, "detailedformat")) return true;
if (!strcmp(name, "forcebigendian")) return true;
if (!strcmp(name, "strongvalidation")) return true;
return false;
};
See also: [Viewing node information]
[Viewing the log] [Viewing
memory blocks]
[Viewing file information] [Construct
hierarchy diagrams] [Load/Save failure
reporting]
|