7 * Utility function for joining two paths. Adds a / between a and b if
10 * Returns a newly-allocated string.
12 char *join_paths(void *alloc_ctx, const char *a, const char *b);
15 * Returns the base path for mount points
17 const char *mount_base(void);
21 struct load_url_result {
23 LOAD_OK, /* load complete. other members should only be
24 accessed if status == LOAD_OK */
26 LOAD_ERROR, /* only signalled to async loaders
27 * (sync will see a NULL result) */
29 LOAD_ASYNC, /* async load still in progress */
36 struct load_task *task;
39 /* callback type for asynchronous loads. The callback implementation is
40 * responsible for freeing result.
42 typedef void (*load_url_complete)(struct load_url_result *result, void *data);
44 /* Load a (potentially remote) file, and return a guaranteed-local name */
45 struct load_url_result *load_url_async(void *ctx, struct pb_url *url,
46 load_url_complete complete, void *data);
48 /* Cancel a pending load */
49 void load_url_async_cancel(struct load_url_result *res);
51 struct load_url_result *load_url(void *ctx, struct pb_url *url);