iPXE
Functions
job.c File Reference

Job control interfaces. More...

#include <string.h>
#include <errno.h>
#include <ipxe/job.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
int job_progress (struct interface *intf, struct job_progress *progress)
 Get job progress.

Detailed Description

Job control interfaces.

Definition in file job.c.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
int job_progress ( struct interface intf,
struct job_progress progress 
)

Get job progress.

Parameters:
intfObject interface
progressProgress data to fill in
Return values:
ongoing_rcOngoing job status code (if known)

Definition at line 43 of file job.c.

References DBGC, dest, INTF_COL, intf_get_dest_op, INTF_INTF_DBG, INTF_INTF_FMT, intf_object(), intf_put(), job_progress_TYPE, memset(), and op.

Referenced by monojob_wait().

                                                                           {
        struct interface *dest;
        job_progress_TYPE ( void * ) *op =
                intf_get_dest_op ( intf, job_progress, &dest );
        void *object = intf_object ( dest );
        int ongoing_rc;

        DBGC ( INTF_COL ( intf ), "INTF " INTF_INTF_FMT " job_progress\n",
               INTF_INTF_DBG ( intf, dest ) );

        /* Initialise progress to zero */
        memset ( progress, 0, sizeof ( *progress ) );

        if ( op ) {
                ongoing_rc = op ( object, progress );
        } else {
                /* Default is to leave progress as zero and have no
                 * known return status code.
                 */
                ongoing_rc = 0;
        }

        intf_put ( dest );
        return ongoing_rc;
}