job.c File Reference

Job control interfaces. More...

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

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER)
void job_done (struct job_interface *job, int rc)
void job_kill (struct job_interface *job)
void job_progress (struct job_interface *job, struct job_progress *progress)
void ignore_job_done (struct job_interface *job __unused, int rc __unused)
void ignore_job_kill (struct job_interface *job __unused)
void ignore_job_progress (struct job_interface *job __unused, struct job_progress *progress)

Variables

struct job_interface_operations null_job_ops
 Null job control interface operations.
struct job_interface null_job
 Null job control interface.


Detailed Description

Job control interfaces.

Definition in file job.c.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER   ) 

void job_done ( struct job_interface job,
int  rc 
)

Definition at line 31 of file job.c.

References dest, job_interface_operations::done, job_unplug(), and job_interface::op.

Referenced by dhcp_finished(), downloader_finished(), and monojob_wait().

00031                                                     {
00032         struct job_interface *dest = job_get_dest ( job );
00033 
00034         job_unplug ( job );
00035         dest->op->done ( dest, rc );
00036         job_put ( dest );
00037 }

void job_kill ( struct job_interface job  ) 

Definition at line 39 of file job.c.

References dest, job_unplug(), job_interface_operations::kill, and job_interface::op.

Referenced by monojob_wait().

00039                                             {
00040         struct job_interface *dest = job_get_dest ( job );
00041 
00042         job_unplug ( job );
00043         dest->op->kill ( dest );
00044         job_put ( dest );
00045 }

void job_progress ( struct job_interface job,
struct job_progress progress 
)

Definition at line 47 of file job.c.

References dest, job_interface::op, and job_interface_operations::progress.

00048                                                     {
00049         struct job_interface *dest = job_get_dest ( job );
00050 
00051         dest->op->progress ( dest, progress );
00052         job_put ( dest );
00053 }

void ignore_job_done ( struct job_interface *job  __unused,
int rc  __unused 
)

Definition at line 64 of file job.c.

00064                                                                              {
00065         /* Nothing to do */
00066 }

void ignore_job_kill ( struct job_interface *job  __unused  ) 

Definition at line 68 of file job.c.

00068                                                             {
00069         /* Nothing to do */
00070 }

void ignore_job_progress ( struct job_interface *job  __unused,
struct job_progress progress 
)

Definition at line 72 of file job.c.

References memset().

00073                                                            {
00074         memset ( progress, 0, sizeof ( *progress ) );
00075 }


Variable Documentation

Initial value:

 {
        .done           = ignore_job_done,
        .kill           = ignore_job_kill,
        .progress       = ignore_job_progress,
}
Null job control interface operations.

Definition at line 78 of file job.c.

Referenced by job_nullify().

Initial value:

 {
        .intf = {
                .dest = &null_job.intf,
                .refcnt = NULL,
        },
        .op = &null_job_ops,
}
Null job control interface.

This is the interface to which job control interfaces are connected when unplugged. It will never generate messages, and will silently absorb all received messages.

Definition at line 91 of file job.c.

Referenced by job_init(), and job_unplug().


Generated on Tue Apr 6 20:01:14 2010 for gPXE by  doxygen 1.5.7.1