mirror of
https://github.com/xcat2/xNBA.git
synced 2026-09-21 08:33:11 +00:00
a03dd97e6b
Remove job-control as an interface type, and replace job-control interfaces with generic interfaces supporting the close() method. (Both done() and kill() are absorbed into the function of close(); kill() is merely close(-ECANCELED).) Signed-off-by: Michael Brown <mcb30@ipxe.org>
39 lines
969 B
C
39 lines
969 B
C
#ifndef _IPXE_JOB_H
|
|
#define _IPXE_JOB_H
|
|
|
|
/** @file
|
|
*
|
|
* Job control interfaces
|
|
*
|
|
*/
|
|
|
|
FILE_LICENCE ( GPL2_OR_LATER );
|
|
|
|
#include <ipxe/interface.h>
|
|
|
|
/** Job progress */
|
|
struct job_progress {
|
|
/** Amount of operation completed so far
|
|
*
|
|
* The units for this quantity are arbitrary. @c completed
|
|
* divded by @total should give something which approximately
|
|
* represents the progress through the operation. For a
|
|
* download operation, using byte counts would make sense.
|
|
*/
|
|
unsigned long completed;
|
|
/** Total operation size
|
|
*
|
|
* See @c completed. A zero value means "total size unknown"
|
|
* and is explcitly permitted; users should take this into
|
|
* account before calculating @c completed/total.
|
|
*/
|
|
unsigned long total;
|
|
};
|
|
|
|
extern void job_progress ( struct interface *intf,
|
|
struct job_progress *progress );
|
|
#define job_progress_TYPE( object_type ) \
|
|
typeof ( void ( object_type, struct job_progress *progress ) )
|
|
|
|
#endif /* _IPXE_JOB_H */
|