您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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., 51 Franklin Street, Fifth Floor, Boston, MA
  17. * 02110-1301, USA.
  18. */
  19. FILE_LICENCE ( GPL2_OR_LATER );
  20. #include <string.h>
  21. #include <errno.h>
  22. #include <ipxe/job.h>
  23. /** @file
  24. *
  25. * Job control interfaces
  26. *
  27. */
  28. /**
  29. * Get job progress
  30. *
  31. * @v intf Object interface
  32. * @v progress Progress data to fill in
  33. * @ret ongoing_rc Ongoing job status code (if known)
  34. */
  35. int job_progress ( struct interface *intf, struct job_progress *progress ) {
  36. struct interface *dest;
  37. job_progress_TYPE ( void * ) *op =
  38. intf_get_dest_op ( intf, job_progress, &dest );
  39. void *object = intf_object ( dest );
  40. int ongoing_rc;
  41. DBGC ( INTF_COL ( intf ), "INTF " INTF_INTF_FMT " job_progress\n",
  42. INTF_INTF_DBG ( intf, dest ) );
  43. /* Initialise progress to zero */
  44. memset ( progress, 0, sizeof ( *progress ) );
  45. if ( op ) {
  46. ongoing_rc = op ( object, progress );
  47. } else {
  48. /* Default is to leave progress as zero and have no
  49. * known return status code.
  50. */
  51. ongoing_rc = 0;
  52. }
  53. intf_put ( dest );
  54. return ongoing_rc;
  55. }