![]() |
General Information | ||
teem |
Every symbol (function, global variable) in a library starts with a fixed "symbol prefix", or some number of underscores followed by the "symbol prefix". Currently, (for air, biff, nrrd, bane, and limn), the symbol prefix is identical to the library name. For instance, all "public" nrrd function names start with nrrd. There may be a library in the future with a shortened version of the library as the symbol prefix.
Were I to get fancy, the exacty value would be some indicator of what sort of error happened. This practice has not been adopted. For the most part, textual descriptions (in English) of the errors accumulate with biff. For instance, in nrrdSwapAxes(), we find the codeif (teemFunction(arg1, arg2)) { do error handling; return 1; } /* else no problem ... */
The use of biffAdd() insures that the current error string is added to list of previous errors, with the assumption that nrrdPermuteAxes() also left some errors with biff. See the biff page for more specific information on biff usage.if (nrrdPermuteAxes(nout, nin, axes)) { sprintf(err, "%s: trouble swapping axes", me); biffAdd(NRRD, err); return 1; }
Exceptions to the above are functions which have "Valid" in their name, like baneValidHVol. These should be read as predicates in a logical statement, not as function calls. So, baneValidHVol(hvol) returns non-zero when hvol is as valid histogram volume, and it returns zero when hvol is not a valid histogram volume. Code might look like:
if (!baneValidHVol(hvol)) { sprintf(err, "%s: given nrrd isn't a histogram volume", me); biffAdd(BANE, err); return 1; } /* else no problem ... */