-int fileio_open(fileio_t *fileio, char *url, enum fileio_access access, enum fileio_type type)
-{
- int retval = ERROR_OK;
- char *resource_identifier = NULL;
-
- /* try to identify file location. We only hijack the file paths we understand, the rest is
- * passed on to the OS which might implement e.g. tftp via a mounted tftp device.
- */
- if ((resource_identifier = strstr(url, "bootp://")) && (resource_identifier == url))
- {
- ERROR("bootp resource location isn't supported yet");
- return ERROR_FILEIO_RESOURCE_TYPE_UNKNOWN;
- }
- else
- {
- /* default to local files */
- fileio->location = FILEIO_LOCAL;
- }
-
- fileio->type = type;
- fileio->access = access;
- fileio->url = strdup(url);
-
- switch (fileio->location)
- {
- case FILEIO_LOCAL:
- retval = fileio_open_local(fileio);
- break;
- default:
- ERROR("BUG: should never get here");
- exit(-1);
- }
-
- if (retval != ERROR_OK)
- return retval;
-