~ubuntu-branches/ubuntu/utopic/libfprint/utopic

« back to all changes in this revision

Viewing changes to libfprint/fprint-list-udev-rules.c

  • Committer: Package Import Robot
  • Author(s): Didier Raboud
  • Date: 2013-05-18 16:35:39 UTC
  • mfrom: (4.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20130518163539-qvwsan4edkdtry6f
Tags: 1:0.5.0-5
* Upload to unstable with two more backports from upstream:
  - imgdev: fix cancelling of enrollment from stage_completed callback
  - upeke2: Add support for 147e:2020 ID

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 
36
36
struct fp_driver whitelist = {
37
37
    .id_table = whitelist_id_table,
 
38
    .full_name = "Hardcoded whitelist"
38
39
};
39
40
 
40
41
GHashTable *printed = NULL;
41
42
 
42
43
static void print_driver (struct fp_driver *driver)
43
44
{
44
 
    int i, j, blacklist;
 
45
    int i, j, blacklist, num_printed;
 
46
 
 
47
    num_printed = 0;
45
48
 
46
49
    for (i = 0; driver->id_table[i].vendor != 0; i++) {
47
50
        char *key;
63
66
 
64
67
        g_hash_table_insert (printed, key, GINT_TO_POINTER (1));
65
68
 
 
69
        if (num_printed == 0)
 
70
            printf ("# %s\n", driver->full_name);
 
71
 
66
72
        printf ("SUBSYSTEM==\"usb\", ATTRS{idVendor}==\"%04x\", ATTRS{idProduct}==\"%04x\", ATTRS{dev}==\"*\", ", driver->id_table[i].vendor, driver->id_table[i].product);
67
73
        if (!blacklist)
68
74
                printf ("ATTR{power/control}=\"auto\", ");
69
75
        printf ("MODE=\"0664\", GROUP=\"plugdev\"\n");
 
76
        num_printed++;
70
77
    }
 
78
 
 
79
    if (num_printed > 0)
 
80
        printf ("\n");
71
81
}
72
82
 
73
83
int main (int argc, char **argv)