/** * Open a UFFS object * * \param[in|out] obj the object to be open * \param[in] name the full name of the object * \param[in] oflag open flag * * \return U_SUCC if object is opened successfully, * U_FAIL if failed, error code will be set to obj->err. */ URET uffs_OpenObject(uffs_Object *obj, const char *name, int oflag) { if (obj == NULL) return U_FAIL; if (uffs_ParseObject(obj, name) == U_SUCC) uffs_OpenObjectEx(obj, obj->dev, obj->parent, obj->name, obj->name_len, oflag); return (obj->err == UENOERR ? U_SUCC : U_FAIL); }
/** * Open a UFFS object * * \param[in|out] obj the object to be open * \param[in] name the full name of the object * \param[in] oflag open flag * * \return U_SUCC if object is opened successfully, * U_FAIL if failed, error code will be set to obj->err. */ URET uffs_OpenObject(uffs_Object *obj, const char *name, int oflag) { URET ret; if (obj == NULL) return U_FAIL; if ((ret = uffs_ParseObject(obj, name)) == U_SUCC) { ret = uffs_OpenObjectEx(obj, obj->dev, obj->parent, obj->name, obj->name_len, oflag); } if (ret != U_SUCC) do_ReleaseObjectResource(obj); return ret; }