5 #include <waiter/waiter.h>
6 #include <process/process.h>
9 * Utility function for joining two paths. Adds a / between a and b if
12 * Returns a newly-allocated string.
14 char *join_paths(void *alloc_ctx, const char *a, const char *b);
17 * Returns the base path for mount points
19 const char *mount_base(void);
23 struct load_url_result {
25 LOAD_OK, /* load complete. other members should only be
26 accessed if status == LOAD_OK */
28 LOAD_ERROR, /* only signalled to async loaders
29 * (sync will see a NULL result) */
31 LOAD_ASYNC, /* async load still in progress */
38 struct load_task *task;
41 /* callback type for asynchronous loads. The callback implementation is
42 * responsible for freeing result.
44 typedef void (*load_url_complete)(struct load_url_result *result, void *data);
46 /* Start transfers that were waiting for network connectivity */
47 void pending_network_jobs_start(void);
48 void pending_network_jobs_cancel(void);
50 /* Load a (potentially remote) file, and return a guaranteed-local name */
51 struct load_url_result *load_url_async(void *ctx, struct pb_url *url,
52 load_url_complete complete, void *data,
53 waiter_cb stdout_cb, void *stdout_data);
55 /* Cancel a pending load */
56 void load_url_async_cancel(struct load_url_result *res);
58 struct load_url_result *load_url(void *ctx, struct pb_url *url);