Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

job.c 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Copyright (C) 2007 Michael Brown <mbrown@fensystems.co.uk>.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License as
  6. * published by the Free Software Foundation; either version 2 of the
  7. * License, or any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful, but
  10. * WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. */
  18. FILE_LICENCE ( GPL2_OR_LATER );
  19. #include <string.h>
  20. #include <errno.h>
  21. #include <ipxe/job.h>
  22. /** @file
  23. *
  24. * Job control interfaces
  25. *
  26. */
  27. /**
  28. * Get job progress
  29. *
  30. * @v intf Object interface
  31. * @v progress Progress data to fill in
  32. */
  33. void job_progress ( struct interface *intf, struct job_progress *progress ) {
  34. struct interface *dest;
  35. job_progress_TYPE ( void * ) *op =
  36. intf_get_dest_op ( intf, job_progress, &dest );
  37. void *object = intf_object ( dest );
  38. DBGC ( INTF_COL ( intf ), "INTF " INTF_INTF_FMT " job_progress\n",
  39. INTF_INTF_DBG ( intf, dest ) );
  40. if ( op ) {
  41. op ( object, progress );
  42. } else {
  43. /* Default is to mark progress as zero */
  44. memset ( progress, 0, sizeof ( *progress ) );
  45. }
  46. intf_put ( dest );
  47. }