= Back-end utility functions = The following functions (in validate_util.C and sched_util.C) can be used in your validator and assimilator code. {{{ struct FILE_INFO { std::string path; bool optional; }; extern int get_output_file_info(RESULT& result, FILE_INFO&); extern int get_output_file_infos(RESULT& result, std::vector&); extern int get_output_file_path(RESULT& result, std::string&); extern int get_output_file_paths(RESULT& result, std::vector&); }}} Returns the paths of a result's output file(s). The FILE_INFO variants also return each files "optional" attribute. {{{ int try_fopen(char* path, FILE*& f, char* mode); }}} Open a file, distinguishing between recoverable and nonrecoverable errors. Returns zero on success. Returns ERR_FOPEN if the directory is present but not the file (this is considered a nonrecoverable error). Returns ERR_OPENDIR if the directory is not there (this is generally a recoverable error, like NFS mount failure). {{{ double median_mean_credit(vector const& results); }}} Given a vector of N correct results, computes a canonical credit as follows: * if N==1, return that result's claimed credit * if N==2, return min of claimed credits * if N>2, toss out high and low claimed credit, and return the average of the rest.