static int parse_filter(const char *spec, struct USBAutoFilter *f)

{

    enum { BUS, DEV, VID, PID, DONE };

    const char *p = spec;

    int i;



    f->bus_num    = -1;

    f->addr       = -1;

    f->vendor_id  = -1;

    f->product_id = -1;



    for (i = BUS; i < DONE; i++) {

    	p = strpbrk(p, ":.");

    	if (!p) break;

        p++;

 

    	if (*p == '*')

            continue;



        switch(i) {

        case BUS: f->bus_num = strtol(p, NULL, 10);    break;

        case DEV: f->addr    = strtol(p, NULL, 10);    break;

        case VID: f->vendor_id  = strtol(p, NULL, 16); break;

        case PID: f->product_id = strtol(p, NULL, 16); break;

        }

    }



    if (i < DEV) {

        fprintf(stderr, "husb: invalid auto filter spec %s\n", spec);

        return -1;

    }



    return 0;

}

static int parse_filter(const char *spec, struct USBAutoFilter *f)

{

    enum { BUS, DEV, VID, PID, DONE };

    const char *p = spec;

    int i;



    f->bus_num    = -1;

    f->addr       = -1;

    f->vendor_id  = -1;

    f->product_id = -1;



    for (i = BUS; i < DONE; i++) {

    	p = strpbrk(p, ":.");

    	if (!p) break;

        p++;

 

    	if (*p == '*')

            continue;



        switch(i) {

        case BUS: f->bus_num = strtol(p, NULL, 10);    break;

        case DEV: f->addr    = strtol(p, NULL, 10);    break;

        case VID: f->vendor_id  = strtol(p, NULL, 16); break;

        case PID: f->product_id = strtol(p, NULL, 16); break;

        }

    }



    if (i < DEV) {

        fprintf(stderr, "husb: invalid auto filter spec %s\n", spec);

        return -1;

    }



    return 0;

}

    f->bus_num    = -1;     f->addr       = -1;     f->vendor_id  = -1;     f->product_id = -1;
static int FUNC_0(const char *VAR_0, struct USBAutoFilter *VAR_1)

{

    enum { BUS, DEV, VID, PID, DONE };

    const char *VAR_2 = VAR_0;

    int VAR_3;



    VAR_1->bus_num    = -1;

    VAR_1->addr       = -1;

    VAR_1->vendor_id  = -1;

    VAR_1->product_id = -1;



    for (VAR_3 = BUS; VAR_3 < DONE; VAR_3++) {

    	VAR_2 = strpbrk(VAR_2, ":.");

    	if (!VAR_2) break;

        VAR_2++;

 

    	if (*VAR_2 == '*')

            continue;



        switch(VAR_3) {

        case BUS: VAR_1->bus_num = strtol(VAR_2, NULL, 10);    break;

        case DEV: VAR_1->addr    = strtol(VAR_2, NULL, 10);    break;

        case VID: VAR_1->vendor_id  = strtol(VAR_2, NULL, 16); break;

        case PID: VAR_1->product_id = strtol(VAR_2, NULL, 16); break;

        }

    }



    if (VAR_3 < DEV) {

        fprintf(stderr, "husb: invalid auto filter VAR_0 %s\n", VAR_0);

        return -1;

    }



    return 0;

}

static int FUNC_0(const char *VAR_0, struct USBAutoFilter *VAR_1)
{ enum { BUS, DEV, VID, PID, DONE }; const char *VAR_2 = VAR_0; int VAR_3; VAR_1->bus_num    = -1; VAR_1->addr       = -1; VAR_1->vendor_id  = -1; VAR_1->product_id = -1; for (VAR_3 = BUS; VAR_3 < DONE; VAR_3++) { VAR_2 = strpbrk(VAR_2, ":."); if (!VAR_2) break; VAR_2++; if (*VAR_2 == '*')
continue; switch(VAR_3) { case BUS: VAR_1->bus_num = strtol(VAR_2, NULL, 10);    break; case DEV: VAR_1->addr    = strtol(VAR_2, NULL, 10);    break; case VID: VAR_1->vendor_id  = strtol(VAR_2, NULL, 16); break; case PID: VAR_1->product_id = strtol(VAR_2, NULL, 16); break; } } if (VAR_3 < DEV) { fprintf(stderr, "husb: invalid auto filter VAR_0 %s\n", VAR_0); return -1; } return 0; }