X-Git-Url: https://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fpaths.h;h=34de79a1649fd34e7ed4b8f22aa1ef582a7a5cba;hp=26d4ce41eb2a946c8bc9f13b5e5ba7b60637f4a6;hb=c62667e5c78ea212e5ac49244e9792954a1d8f71;hpb=32e6a41f33e5576716b351bd473a27939fe94fa1;ds=sidebyside diff --git a/discover/paths.h b/discover/paths.h index 26d4ce4..34de79a 100644 --- a/discover/paths.h +++ b/discover/paths.h @@ -11,7 +11,8 @@ * * Returns a newly-allocated string. */ -char *parse_device_path(const char *dev_str, const char *current_device); +char *parse_device_path(void *alloc_ctx, + const char *dev_str, const char *current_device); /** * Get the mountpoint for a device. @@ -29,13 +30,8 @@ const char *mountpoint_for_device(const char *dev); * * Returns a newly-allocated string containing a full path to the file in path */ -char *resolve_path(const char *path, const char *current_device); - - -/** - * Set the base directory for newly-created mountpoints - */ -void set_mount_base(const char *path); +char *resolve_path(void *alloc_ctx, + const char *path, const char *current_device); /** * Utility function for joining two paths. Adds a / between a and b if @@ -43,11 +39,19 @@ void set_mount_base(const char *path); * * Returns a newly-allocated string. */ -char *join_paths(const char *a, const char *b); +char *join_paths(void *alloc_ctx, const char *a, const char *b); /** * encode a disk label (or uuid) for use in a symlink. */ -char *encode_label(const char *label); +char *encode_label(void *alloc_ctx, const char *label); + +/** + * Returns the base path for mount points + */ +const char *mount_base(void); + +/* Load a (potentially remote) file, and return a guaranteed-local name */ +char *load_file(void *ctx, const char *remote, unsigned int *tempfile); #endif /* PATHS_H */