src/filed/fd_snapshot.c
int edit_snapshot_codes(POOLMEM **omsg, const char *imsg) {
      const char *p;
      const char *str;
      char add[20];

      **omsg = 0;
      for (p=imsg; *p; p++) {
         if (*p == '%') {
            switch (*++p) {
            case '%':
               str = "%";
               break;
            case 'e':
               str = NPRTB(exepath);
               break;
            case 'n':
               str = Name;
               break;
            case 'v':
               str = Volume;
               break;
            case 'd':
               str = Device;
               break;
            case 'D':
               str = SnapDirectory;
               break;
            case 'a':
               str = NPRT(action);
               break;
            case 't':
               str = Type;
               break;
            case 'f':
               str = FSType;
               break;
            case 'p':
               str = MountPoint;
               break;
            case 's':
               str = SnapMountPoint;
               break;
            default:
               add[0] = '%';
               add[1] = *p;
               add[2] = 0;
               str = add;
            }

         } else {
            add[0] = *p;
            add[1] = 0;
            str = add;
         }
         pm_strcat(omsg, str);
      }

      if (chk_dbglvl(DT_SNAPSHOT|10)) {
         POOL_MEM tmp;
         Mmsg(tmp, " -d %d -o /tmp/bsnapshot.log ", debug_level);
         pm_strcat(omsg, tmp.c_str());
      }

      Dmsg2(DT_SNAPSHOT|30, "edit_snapshot_codes: %s -> %s\n", imsg, *omsg);
      return 1;
   }
/* Edit the command line if needed */
Edit the command line if needed
Edit the command line if needed
int edit_snapshot_codes(POOLMEM **omsg, const char *imsg) {
      const char *p;
      const char *str;
      char add[20];
      **omsg = 0;
      for (p=imsg; *p; p++) {
         if (*p == '%') {
            switch (*++p) {
            case '%':
               str = "%";
               break;
            case 'e':
               str = NPRTB(exepath);
               break;
            case 'n':
               str = Name;
               break;
            case 'v':
               str = Volume;
               break;
            case 'd':
               str = Device;
               break;
            case 'D':
               str = SnapDirectory;
               break;
            case 'a':
               str = NPRT(action);
               break;
            case 't':
               str = Type;
               break;
            case 'f':
               str = FSType;
               break;
            case 'p':
               str = MountPoint;
               break;
            case 's':
               str = SnapMountPoint;
               break;
            default:
               add[0] = '%';
               add[1] = *p;
               add[2] = 0;
               str = add;
            }
         } else {
            add[0] = *p;
            add[1] = 0;
            str = add;
         }
         pm_strcat(omsg, str);
      }
      if (chk_dbglvl(DT_SNAPSHOT|10)) {
         POOL_MEM tmp;
         Mmsg(tmp, " -d %d -o /tmp/bsnapshot.log ", debug_level);
         pm_strcat(omsg, tmp.c_str());
      }
      Dmsg2(DT_SNAPSHOT|30, "edit_snapshot_codes: %s -> %s\n", imsg, *omsg);
      return 1;
   }
int edit_snapshot_codes ( POOLMEM * * omsg , const char * imsg ) { const char * p ; const char * str ; char add [ 20 ] ; * * omsg = 0 ; for ( p = imsg ; * p ; p ++ ) { if ( * p == ' ' ) { switch ( * ++ p ) { case ' ' : str = " " ; break ; case ' ' : str = NPRTB ( exepath ) ; break ; case ' ' : str = Name ; break ; case ' ' : str = Volume ; break ; case ' ' : str = Device ; break ; case ' ' : str = SnapDirectory ; break ; case ' ' : str = NPRT ( action ) ; break ; case ' ' : str = Type ; break ; case ' ' : str = FSType ; break ; case ' ' : str = MountPoint ; break ; case ' ' : str = SnapMountPoint ; break ; default : add [ 0 ] = ' ' ; add [ 1 ] = * p ; add [ 2 ] = 0 ; str = add ; } } else { add [ 0 ] = * p ; add [ 1 ] = 0 ; str = add ; } pm_strcat ( omsg , str ) ; } if ( chk_dbglvl ( DT_SNAPSHOT | 10 ) ) { POOL_MEM tmp ; Mmsg ( tmp , " " , debug_level ) ; pm_strcat ( omsg , tmp . c_str ( ) ) ; } Dmsg2 ( DT_SNAPSHOT | 30 , " \n " , imsg , * omsg ) ; return 1 ; }
Edit the command line if needed
Edit the command line if needed