Mercurial > pt1
comparison recpt1/recpt1.c @ 74:b6607f6e2851
good citizens never use gray code. wise people never watch TV.
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Sat, 28 Nov 2009 00:12:05 +0900 |
parents | 18108d097707 |
children | 5a0126d8af17 |
comparison
equal
deleted
inserted
replaced
73:c44e16dbb0e2 | 74:b6607f6e2851 |
---|---|
20 #include <netinet/in.h> | 20 #include <netinet/in.h> |
21 | 21 |
22 #include <sys/ioctl.h> | 22 #include <sys/ioctl.h> |
23 #include "pt1_ioctl.h" | 23 #include "pt1_ioctl.h" |
24 | 24 |
25 #include "config.h" | |
26 #include "decoder.h" | |
25 #include "recpt1.h" | 27 #include "recpt1.h" |
26 #include "decoder.h" | |
27 #include "version.h" | 28 #include "version.h" |
28 #include "mkpath.h" | 29 #include "mkpath.h" |
29 | 30 |
30 /* maximum write length at once */ | 31 /* maximum write length at once */ |
31 #define SIZE_CHANK 1316 | 32 #define SIZE_CHANK 1316 |
309 } | 310 } |
310 | 311 |
311 void | 312 void |
312 show_usage(char *cmd) | 313 show_usage(char *cmd) |
313 { | 314 { |
315 #ifdef HAVE_LIBARIB25 | |
314 fprintf(stderr, "Usage: \n%s [--b25 [--round N] [--strip] [--EMM]] [--udp [--addr hostname --port portnumber]] [--device devicefile] channel rectime destfile\n", cmd); | 316 fprintf(stderr, "Usage: \n%s [--b25 [--round N] [--strip] [--EMM]] [--udp [--addr hostname --port portnumber]] [--device devicefile] channel rectime destfile\n", cmd); |
317 #else | |
318 fprintf(stderr, "Usage: \n%s [--strip] [--EMM]] [--udp [--addr hostname --port portnumber]] [--device devicefile] channel rectime destfile\n", cmd); | |
319 #endif | |
315 fprintf(stderr, "\n"); | 320 fprintf(stderr, "\n"); |
316 fprintf(stderr, "Remarks:\n"); | 321 fprintf(stderr, "Remarks:\n"); |
317 fprintf(stderr, "if rectime is '-', records indefinitely.\n"); | 322 fprintf(stderr, "if rectime is '-', records indefinitely.\n"); |
318 fprintf(stderr, "if destfile is '-', stdout is used for output.\n"); | 323 fprintf(stderr, "if destfile is '-', stdout is used for output.\n"); |
319 } | 324 } |
320 | 325 |
321 void | 326 void |
322 show_options(void) | 327 show_options(void) |
323 { | 328 { |
324 fprintf(stderr, "Options:\n"); | 329 fprintf(stderr, "Options:\n"); |
330 #ifdef HAVE_LIBARIB25 | |
325 fprintf(stderr, "--b25: Decrypt using BCAS card\n"); | 331 fprintf(stderr, "--b25: Decrypt using BCAS card\n"); |
326 fprintf(stderr, " --round N: Specify round number\n"); | 332 fprintf(stderr, " --round N: Specify round number\n"); |
327 fprintf(stderr, " --strip: Strip null stream\n"); | 333 fprintf(stderr, " --strip: Strip null stream\n"); |
328 fprintf(stderr, " --EMM: Instruct EMM operation\n"); | 334 fprintf(stderr, " --EMM: Instruct EMM operation\n"); |
335 #endif | |
329 fprintf(stderr, "--udp: Turn on udp broadcasting\n"); | 336 fprintf(stderr, "--udp: Turn on udp broadcasting\n"); |
330 fprintf(stderr, " --addr hostname: Hostname or address to connect\n"); | 337 fprintf(stderr, " --addr hostname: Hostname or address to connect\n"); |
331 fprintf(stderr, " --port portnumber: Port number to connect\n"); | 338 fprintf(stderr, " --port portnumber: Port number to connect\n"); |
332 fprintf(stderr, "--device devicefile: Specify devicefile to use\n"); | 339 fprintf(stderr, "--device devicefile: Specify devicefile to use\n"); |
333 fprintf(stderr, "--help: Show this help\n"); | 340 fprintf(stderr, "--help: Show this help\n"); |
544 }; | 551 }; |
545 | 552 |
546 int result; | 553 int result; |
547 int option_index; | 554 int option_index; |
548 struct option long_options[] = { | 555 struct option long_options[] = { |
556 #ifdef HAVE_LIBARIB25 | |
549 { "b25", 0, NULL, 'b'}, | 557 { "b25", 0, NULL, 'b'}, |
550 { "B25", 0, NULL, 'b'}, | 558 { "B25", 0, NULL, 'b'}, |
559 #endif | |
551 { "round", 1, NULL, 'r'}, | 560 { "round", 1, NULL, 'r'}, |
552 { "strip", 0, NULL, 's'}, | 561 { "strip", 0, NULL, 's'}, |
553 { "emm", 0, NULL, 'm'}, | 562 { "emm", 0, NULL, 'm'}, |
554 { "EMM", 0, NULL, 'm'}, | 563 { "EMM", 0, NULL, 'm'}, |
555 { "udp", 0, NULL, 'u'}, | 564 { "udp", 0, NULL, 'u'}, |