src/lib/util.c
void jobstatus_to_ascii(int JobStatus, char *msg, int maxlen)
{
   const char *jobstat;
   char buf[100];

   switch (JobStatus) {
   case JS_Created:
      jobstat = _("Created");
      break;
   case JS_Running:
      jobstat = _("Running");
      break;
   case JS_Blocked:
      jobstat = _("Blocked");
      break;
   case JS_Terminated:
      jobstat = _("OK");
      break;
   case JS_Incomplete:
      jobstat = _("Incomplete job");
      break;
   case JS_FatalError:
   case JS_ErrorTerminated:
      jobstat = _("Error");
      break;
   case JS_Error:
      jobstat = _("Non-fatal error");
      break;
   case JS_Warnings:
      jobstat = _("OK -- with warnings");
      break;
   case JS_Canceled:
      jobstat = _("Canceled");
      break;
   case JS_Differences:
      jobstat = _("Verify differences");
      break;
   case JS_WaitFD:
      jobstat = _("Waiting on FD");
      break;
   case JS_WaitSD:
      jobstat = _("Wait on SD");
      break;
   case JS_WaitMedia:
      jobstat = _("Wait for new Volume");
      break;
   case JS_WaitMount:
      jobstat = _("Waiting for mount");
      break;
   case JS_WaitStoreRes:
      jobstat = _("Waiting for Storage resource");
      break;
   case JS_WaitJobRes:
      jobstat = _("Waiting for Job resource");
      break;
   case JS_WaitClientRes:
      jobstat = _("Waiting for Client resource");
      break;
   case JS_WaitMaxJobs:
      jobstat = _("Waiting on Max Jobs");
      break;
   case JS_WaitStartTime:
      jobstat = _("Waiting for Start Time");
      break;
   case JS_WaitPriority:
      jobstat = _("Waiting on Priority");
      break;
   case JS_DataCommitting:
      jobstat = _("SD committing Data");
      break;
   case JS_DataDespooling:
      jobstat = _("SD despooling Data");
      break;
   case JS_AttrDespooling:
      jobstat = _("SD despooling Attributes");
      break;
   case JS_AttrInserting:
      jobstat = _("Dir inserting Attributes");
      break;

   default:
      if (JobStatus == 0) {
         buf[0] = 0;
      } else {
         bsnprintf(buf, sizeof(buf), _("Unknown Job termination status=%d"), JobStatus);
      }
      jobstat = buf;
      break;
   }
   bstrncpy(msg, jobstat, maxlen);
}
/*
 * Convert a JobStatus code into a human readable form
 */
Convert a JobStatus code into a human readable form
Convert a JobStatus code into a human readable form
void jobstatus_to_ascii(int JobStatus, char *msg, int maxlen)
{
   const char *jobstat;
   char buf[100];
   switch (JobStatus) {
   case JS_Created:
      jobstat = _("Created");
      break;
   case JS_Running:
      jobstat = _("Running");
      break;
   case JS_Blocked:
      jobstat = _("Blocked");
      break;
   case JS_Terminated:
      jobstat = _("OK");
      break;
   case JS_Incomplete:
      jobstat = _("Incomplete job");
      break;
   case JS_FatalError:
   case JS_ErrorTerminated:
      jobstat = _("Error");
      break;
   case JS_Error:
      jobstat = _("Non-fatal error");
      break;
   case JS_Warnings:
      jobstat = _("OK -- with warnings");
      break;
   case JS_Canceled:
      jobstat = _("Canceled");
      break;
   case JS_Differences:
      jobstat = _("Verify differences");
      break;
   case JS_WaitFD:
      jobstat = _("Waiting on FD");
      break;
   case JS_WaitSD:
      jobstat = _("Wait on SD");
      break;
   case JS_WaitMedia:
      jobstat = _("Wait for new Volume");
      break;
   case JS_WaitMount:
      jobstat = _("Waiting for mount");
      break;
   case JS_WaitStoreRes:
      jobstat = _("Waiting for Storage resource");
      break;
   case JS_WaitJobRes:
      jobstat = _("Waiting for Job resource");
      break;
   case JS_WaitClientRes:
      jobstat = _("Waiting for Client resource");
      break;
   case JS_WaitMaxJobs:
      jobstat = _("Waiting on Max Jobs");
      break;
   case JS_WaitStartTime:
      jobstat = _("Waiting for Start Time");
      break;
   case JS_WaitPriority:
      jobstat = _("Waiting on Priority");
      break;
   case JS_DataCommitting:
      jobstat = _("SD committing Data");
      break;
   case JS_DataDespooling:
      jobstat = _("SD despooling Data");
      break;
   case JS_AttrDespooling:
      jobstat = _("SD despooling Attributes");
      break;
   case JS_AttrInserting:
      jobstat = _("Dir inserting Attributes");
      break;
   default:
      if (JobStatus == 0) {
         buf[0] = 0;
      } else {
         bsnprintf(buf, sizeof(buf), _("Unknown Job termination status=%d"), JobStatus);
      }
      jobstat = buf;
      break;
   }
   bstrncpy(msg, jobstat, maxlen);
}
void jobstatus_to_ascii ( int JobStatus , char * msg , int maxlen ) { const char * jobstat ; char buf [ 100 ] ; switch ( JobStatus ) { case JS_Created : jobstat = _ ( " " ) ; break ; case JS_Running : jobstat = _ ( " " ) ; break ; case JS_Blocked : jobstat = _ ( " " ) ; break ; case JS_Terminated : jobstat = _ ( " " ) ; break ; case JS_Incomplete : jobstat = _ ( " " ) ; break ; case JS_FatalError : case JS_ErrorTerminated : jobstat = _ ( " " ) ; break ; case JS_Error : jobstat = _ ( " " ) ; break ; case JS_Warnings : jobstat = _ ( " " ) ; break ; case JS_Canceled : jobstat = _ ( " " ) ; break ; case JS_Differences : jobstat = _ ( " " ) ; break ; case JS_WaitFD : jobstat = _ ( " " ) ; break ; case JS_WaitSD : jobstat = _ ( " " ) ; break ; case JS_WaitMedia : jobstat = _ ( " " ) ; break ; case JS_WaitMount : jobstat = _ ( " " ) ; break ; case JS_WaitStoreRes : jobstat = _ ( " " ) ; break ; case JS_WaitJobRes : jobstat = _ ( " " ) ; break ; case JS_WaitClientRes : jobstat = _ ( " " ) ; break ; case JS_WaitMaxJobs : jobstat = _ ( " " ) ; break ; case JS_WaitStartTime : jobstat = _ ( " " ) ; break ; case JS_WaitPriority : jobstat = _ ( " " ) ; break ; case JS_DataCommitting : jobstat = _ ( " " ) ; break ; case JS_DataDespooling : jobstat = _ ( " " ) ; break ; case JS_AttrDespooling : jobstat = _ ( " " ) ; break ; case JS_AttrInserting : jobstat = _ ( " " ) ; break ; default : if ( JobStatus == 0 ) { buf [ 0 ] = 0 ; } else { bsnprintf ( buf , sizeof ( buf ) , _ ( " " ) , JobStatus ) ; } jobstat = buf ; break ; } bstrncpy ( msg , jobstat , maxlen ) ; }
Convert a JobStatus code into a human readable form
Convert a JobStatus code into a human readable form