comparison recpt1/recpt1.c @ 59:aeb885ed4e7e

recpt1 shows list of terrestrial channels if .recpt1-channels is available in the home directory.
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Sat, 03 Oct 2009 13:07:43 +0900
parents d3929562b8e7
children f1553492e8bb
comparison
equal deleted inserted replaced
58:7a03d5185067 59:aeb885ed4e7e
333 fprintf(stderr, "--list: Show channel list\n"); 333 fprintf(stderr, "--list: Show channel list\n");
334 } 334 }
335 void 335 void
336 show_channels(void) 336 show_channels(void)
337 { 337 {
338 FILE *f;
339 char *home;
340 char buf[255], filename[255];
341
338 fprintf(stderr, "Available Channels:\n"); 342 fprintf(stderr, "Available Channels:\n");
339 fprintf(stderr, "13-62:Terrestrial Channels\n"); 343
344 home = getenv("HOME");
345 sprintf(filename, "%s/.recpt1-channels", home);
346 f = fopen(filename, "r");
347 if(f) {
348 while(fgets(buf, 255, f))
349 fprintf(stderr, "%s", buf);
350 fclose(f);
351 }
352 else
353 fprintf(stderr, "13-62:Terrestrial Channels\n");
354
340 fprintf(stderr, "101ch:NHK BS1\n"); 355 fprintf(stderr, "101ch:NHK BS1\n");
341 fprintf(stderr, "102ch:NHK BS2\n"); 356 fprintf(stderr, "102ch:NHK BS2\n");
342 fprintf(stderr, "103ch:NHK BShi\n"); 357 fprintf(stderr, "103ch:NHK BShi\n");
343 fprintf(stderr, "141ch:BS Nittele\n"); 358 fprintf(stderr, "141ch:BS Nittele\n");
344 fprintf(stderr, "151ch:BS Asahi\n"); 359 fprintf(stderr, "151ch:BS Asahi\n");