Just a little utility function to compute a path relative to the project working directory, which I needed in an environment where I was keeping the project files well outside of the source directory.
Used in my Project tool setup as: %(macro _RelativeToWorkingDir %f)
Not exactly rocket science ... maybe more like wheelbarrow science.
#include "slick.sh"
#import "project.e"
_str _RelativeToWorkingDir(_str Filename,_str ProjectName=_project_name)
{
if (ProjectName=='') {
return('');
}
project_handle := _ProjectHandle(ProjectName);
project_dir := _strip_filename(ProjectName, 'N');
working_dir := absolute(_ProjectGet_WorkingDir(project_handle), project_dir);
return relative(Filename, working_dir);
}