[Stgt-devel] vtl patch.

Ming Zhang blackmagic02881
Thu Apr 5 03:30:41 CEST 2007


On Thu, 2007-04-05 at 09:56 +1000, Mark Harvey wrote:
> +static int
> +ssc3_config(struct scsi_lu *lu, char * str) {
> +       int     err = 0;
> +       char    key[80];
> +       char    value[80];
> +       char    * src = str;
> +       char    * dest = key;
> +
> +       while(*src != '\0') {
> +               if(*src == '=') {
> +                       *dest = '\0';   /* Null term key */
> +                       dest = value;   /* flip-flop dest pointer to
> value */
> +                       src++;
> +               } else if (*src == ' ') {
> +                       *dest = '\0';   /* Null term value */
> +                       dest = key;     /* flip-flop dest pointer to
> key */
> +                       err |= process_arg(key, value, lu);
> +                       src++;
> +               } else 
> +                       *dest++ = *src++;
> +       }
> +       return err;
> +}
> + 

looks like tgt should provide a generic parameter parsing helper
functions.




More information about the stgt mailing list