Hopefully this is the last error. Fix the if test, offset by -1 due to how the output appears to be handled.
#import <UIKit/UIKit.h>
const char* get_documents_path() {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex: 0];
return [documentsDirectory UTF8String];
}