filters/truncate/truncate.c
/* Called for each key=value passed on the command line. */
Called for each key=value passed on the command line.
Called for each key = value passed on the command line .
static int
truncate_config (nbdkit_next_config *next, void *nxdata,
                 const char *key, const char *value)
{
  if (strcmp (key, "truncate") == 0) {
    truncate_size = nbdkit_parse_size (value);
    if (truncate_size == -1)
      return -1;
    return 0;
  }
  else if (strcmp (key, "round-up") == 0) {
    return parse_round_param (key, value, &round_up);
  }
  else if (strcmp (key, "round-down") == 0) {
    return parse_round_param (key, value, &round_down);
  }
  else
    return next (nxdata, key, value);
}
static int truncate_config ( nbdkit_next_config * next , void * nxdata , const char * key , const char * value ) { if ( strcmp ( key , " " ) == 0 ) { truncate_size = nbdkit_parse_size ( value ) ; if ( truncate_size == -1 ) return -1 ; return 0 ; } else if ( strcmp ( key , " " ) == 0 ) { return parse_round_param ( key , value , & round_up ) ; } else if ( strcmp ( key , " " ) == 0 ) { return parse_round_param ( key , value , & round_down ) ; } else return next ( nxdata , key , value ) ; }
Called for each key=value passed on the command line.
Called for each key = value passed on the command line .