Handle streams separately in tree_add_track()
[cmus.git] / worker.h
blob56124b866117644ce9be5545c657da1102d76405
1 #ifndef _WORKER_H
2 #define _WORKER_H
4 #define JOB_TYPE_NONE 0
5 #define JOB_TYPE_ANY -1
7 void worker_init(void);
8 void worker_exit(void);
11 * @type: JOB_TYPE_* (>0)
12 * @job_cb: does the job
13 * @free_cb: frees @data
14 * @data: data for the callbacks
16 void worker_add_job(int type, void (*job_cb)(void *data),
17 void (*free_cb)(void *data), void *data);
20 * @type: job type. >0, use JOB_TYPE_ANY to remove all
22 void worker_remove_jobs(int type);
24 int worker_has_job(int type);
27 * @type: type of this job
29 * returns: 0 or 1
31 * long jobs should call this to see whether it should cancel
32 * call from job function _only_
34 int worker_cancelling(void);
36 #endif