iPXE
job.h
Go to the documentation of this file.
00001 #ifndef _IPXE_JOB_H
00002 #define _IPXE_JOB_H
00003 
00004 /** @file
00005  *
00006  * Job control interfaces
00007  *
00008  */
00009 
00010 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00011 
00012 #include <ipxe/interface.h>
00013 
00014 /** Job progress */
00015 struct job_progress {
00016         /** Amount of operation completed so far
00017          *
00018          * The units for this quantity are arbitrary.  @c completed
00019          * divded by @total should give something which approximately
00020          * represents the progress through the operation.  For a
00021          * download operation, using byte counts would make sense.
00022          */
00023         unsigned long completed;
00024         /** Total operation size
00025          *
00026          * See @c completed.  A zero value means "total size unknown"
00027          * and is explcitly permitted; users should take this into
00028          * account before calculating @c completed/total.
00029          */
00030         unsigned long total;
00031         /** Message (optional) */
00032         char message[32];
00033 };
00034 
00035 extern int job_progress ( struct interface *intf,
00036                           struct job_progress *progress );
00037 #define job_progress_TYPE( object_type ) \
00038         typeof ( int ( object_type, struct job_progress *progress ) )
00039 
00040 #endif /* _IPXE_JOB_H */