/** * @brief Check [path1] is same to [path2], no matter it is ended by slash or not. * @return If same path, YES will be returned, or NO will be returned. */ bool_t isSamePath(const char *path1, const char *path2) { char pPath1[PATH_LEN(path1)+1]; char pPath2[PATH_LEN(path2)+1]; PATH_COPY(pPath1, path1); PATH_COPY(pPath2, path2); RemoveSlashAtPathEnd(pPath1); RemoveSlashAtPathEnd(pPath2); return IS_SAME_STRING(pPath1, pPath2); }
static bool notify_openr_await(const char *path) { bool needs_await = false; DEFINE_MSG(msg, openr); PATH_COPY(needs_await, msg.args.path, path); return SEND_MSG_AWAIT(needs_await, msg); }
static bool notify_openw(const char *path, bool is_also_read, bool is_create, mode_t mode) { bool needs_await = false; DEFINE_MSG(msg, openw); PATH_COPY(needs_await, msg.args.path, path); if(is_also_read) msg.args.flags |= FLAG_ALSO_READ; if(is_create) msg.args.flags |= FLAG_CREATE; msg.args.mode = mode; return SEND_MSG_AWAIT(needs_await, msg); }