Function wyrd_open_file

Function Documentation

wyrd_error_t wyrd_open_file(struct wyrd_api *api, struct wyrd_handle **handle, char const *filename, int flags)

Opening requires an API handle, a wyrd_handle to represent the resources, and flags.

We also need a file name for a local wyrd resource. For shared resources, we need an identifier instead.

Parameters
  • api[in] An initialized API instance.

  • handle[out] Return a handle to the opened file on success.

  • filename[in] The name of the file to open.

  • flags[in] Open flags; see wyrd_open_flags.

Return values
  • WYRD_ERR_SUCCESS – On success.

  • WYRD_ERR_INVALID_VALUE – If any of the inpurt values are invalid, such as NULL pointers where there should not be any, etc.

  • WYRD_ERR_UNEXPECTED – If unspecific system errors occurred.

  • WYRD_ERR_NOT_IMPLEMENTED – If the function is not implemented on the current platform.

  • Other – If the passed handle was already opened, needed to be closed, and closing the handle did not return successfully.