diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-07-12 21:20:11 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-07-12 21:20:11 +0300 |
commit | ffbab694ede33c294e5864a5e0bf4d1474446a71 (patch) | |
tree | d1bf96518d2a909215aa7820d0ea9041923d3996 /Documentation/media/uapi/rc | |
parent | 4855307b81f02af4853e02cba2ce16eb29376548 (diff) | |
download | linux-ffbab694ede33c294e5864a5e0bf4d1474446a71.tar.xz |
[media] docs-rst: escape [] characters
Those characters are used for citations. Better to escape, to
avoid them to be misinterpreted.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'Documentation/media/uapi/rc')
-rw-r--r-- | Documentation/media/uapi/rc/keytable.c.rst | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/Documentation/media/uapi/rc/keytable.c.rst b/Documentation/media/uapi/rc/keytable.c.rst index e6ce1e3f5a78..5ee6e8c6639d 100644 --- a/Documentation/media/uapi/rc/keytable.c.rst +++ b/Documentation/media/uapi/rc/keytable.c.rst @@ -35,16 +35,16 @@ file: uapi/v4l/keytable.c struct parse_key *p; for (p=keynames;p->name!=NULL;p++) { - if (p->value == (unsigned)codes[1]) { - printf("scancode 0x%04x = %s (0x%02x)\\n", codes[0], p->name, codes[1]); + if (p->value == (unsigned)codes\[1\]) { + printf("scancode 0x%04x = %s (0x%02x)\\n", codes\[0\], p->name, codes\[1\]); return; } } - if (isprint (codes[1])) - printf("scancode %d = '%c' (0x%02x)\\n", codes[0], codes[1], codes[1]); + if (isprint (codes\[1\])) + printf("scancode %d = '%c' (0x%02x)\\n", codes\[0\], codes\[1\], codes\[1\]); else - printf("scancode %d = 0x%02x\\n", codes[0], codes[1]); + printf("scancode %d = 0x%02x\\n", codes\[0\], codes\[1\]); } int parse_code(char *string) @@ -63,7 +63,7 @@ file: uapi/v4l/keytable.c { int fd; unsigned int i, j; - int codes[2]; + int codes\[2\]; if (argc<2 || argc>4) { printf ("usage: %s <device> to get table; or\\n" @@ -72,7 +72,7 @@ file: uapi/v4l/keytable.c return -1; } - if ((fd = open(argv[1], O_RDONLY)) < 0) { + if ((fd = open(argv\[1\], O_RDONLY)) < 0) { perror("Couldn't open input device"); return(-1); } @@ -80,16 +80,16 @@ file: uapi/v4l/keytable.c if (argc==4) { int value; - value=parse_code(argv[3]); + value=parse_code(argv\[3\]); if (value==-1) { - value = strtol(argv[3], NULL, 0); + value = strtol(argv\[3\], NULL, 0); if (errno) perror("value"); } - codes [0] = (unsigned) strtol(argv[2], NULL, 0); - codes [1] = (unsigned) value; + codes \[0\] = (unsigned) strtol(argv\[2\], NULL, 0); + codes \[1\] = (unsigned) value; if(ioctl(fd, EVIOCSKEYCODE, codes)) perror ("EVIOCSKEYCODE"); @@ -102,9 +102,9 @@ file: uapi/v4l/keytable.c if (argc==3) { FILE *fin; int value; - char *scancode, *keycode, s[2048]; + char *scancode, *keycode, s\[2048\]; - fin=fopen(argv[2],"r"); + fin=fopen(argv\[2\],"r"); if (fin==NULL) { perror ("opening keycode file"); return -1; @@ -113,8 +113,8 @@ file: uapi/v4l/keytable.c /* Clears old table */ for (j = 0; j < 256; j++) { for (i = 0; i < 256; i++) { - codes[0] = (j << 8) | i; - codes[1] = KEY_RESERVED; + codes\[0\] = (j << 8) | i; + codes\[1\] = KEY_RESERVED; ioctl(fd, EVIOCSKEYCODE, codes); } } @@ -149,12 +149,12 @@ file: uapi/v4l/keytable.c perror("value"); } - codes [0] = (unsigned) strtol(scancode, NULL, 0); - codes [1] = (unsigned) value; + codes \[0\] = (unsigned) strtol(scancode, NULL, 0); + codes \[1\] = (unsigned) value; - // printf("\\t%04x=%04x\\n",codes[0], codes[1]); + // printf("\\t%04x=%04x\\n",codes\[0\], codes\[1\]); if(ioctl(fd, EVIOCSKEYCODE, codes)) { - fprintf(stderr, "Setting scancode 0x%04x with 0x%04x via ",codes[0], codes[1]); + fprintf(stderr, "Setting scancode 0x%04x with 0x%04x via ",codes\[0\], codes\[1\]); perror ("EVIOCSKEYCODE"); } @@ -167,8 +167,8 @@ file: uapi/v4l/keytable.c /* Get scancode table */ for (j = 0; j < 256; j++) { for (i = 0; i < 256; i++) { - codes[0] = (j << 8) | i; - if (!ioctl(fd, EVIOCGKEYCODE, codes) && codes[1] != KEY_RESERVED) + codes\[0\] = (j << 8) | i; + if (!ioctl(fd, EVIOCGKEYCODE, codes) && codes\[1\] != KEY_RESERVED) prtcode(codes); } } |