plugins/xz/xz.c
/* Called for each key=value passed on the command line.  This plugin
 * only accepts file=<filename>, which is required.
 */
Called for each key=value passed on the command line.  This plugin
only accepts file=, which is required.
Called for each key = value passed on the command line . This plugin only accepts file = which is required .
static int
xz_config (const char *key, const char *value)
{
  if (strcmp (key, "file") == 0) {
    filename = nbdkit_realpath (value);
    if (!filename)
      return -1;
  }
  else if (strcmp (key, "maxblock") == 0) {
    int64_t r = nbdkit_parse_size (value);
    if (r == -1)
      return -1;
    maxblock = (uint64_t) r;
  }
  else if (strcmp (key, "maxdepth") == 0) {
    size_t r;
    if (sscanf (value, "%zu", &r) != 1) {
      nbdkit_error ("could not parse 'maxdepth' parameter");
      return -1;
    }
    if (r == 0) {
      nbdkit_error ("'maxdepth' parameter must be >= 1");
      return -1;
    }
    maxdepth = r;
  }
  else {
    nbdkit_error ("unknown parameter '%s'", key);
    return -1;
  }
  return 0;
}
static int xz_config ( const char * key , const char * value ) { if ( strcmp ( key , " " ) == 0 ) { filename = nbdkit_realpath ( value ) ; if ( ! filename ) return -1 ; } else if ( strcmp ( key , " " ) == 0 ) { int64_t r = nbdkit_parse_size ( value ) ; if ( r == -1 ) return -1 ; maxblock = ( uint64_t ) r ; } else if ( strcmp ( key , " " ) == 0 ) { size_t r ; if ( sscanf ( value , " " , & r ) != 1 ) { nbdkit_error ( " " ) ; return -1 ; } if ( r == 0 ) { nbdkit_error ( " " ) ; return -1 ; } maxdepth = r ; } else { nbdkit_error ( " " , key ) ; return -1 ; } return 0 ; }
Called for each key=value passed on the command line.
Called for each key = value passed on the command line .
/* See FILENAMES AND PATHS in nbdkit-plugin(3). */