示例#1
0
void fprint_remotes(FILE* f, const struct ir_remote* all, const char* commandline)
{
	while (all) {
		fprint_remote(f, all, commandline);
		fprintf(f, "\n\n");
		all = all->next;
	}
}
示例#2
0
void fprint_remotes(FILE *f, struct ir_remote *all){

    	while(all)
	{
                fprint_remote(f, all);
                fprintf(f, "\n\n");
                all=all->next;
        }
}
示例#3
0
/** Print a line for each remote definition in lircd.conf file on path. */
void print_remotes(const char* path)
{
	char my_path[256];
	char photo[256];
	char lircmd[256];
	struct ir_remote* r;
	FILE* f;
	const char* dir;
	const char* base;
	const char* timing;

	strncpy(my_path, path, sizeof(my_path));
	base = basename(my_path);
	dir = dirname(my_path);
	if (strrchr(dir, '/') != NULL)
		dir = strrchr(dir, '/') + 1;
	f = fopen(path, "r");
	if (f == NULL) {
		fprintf(stderr, "Cannot open %s (!)\n", path);
		return;
	}
	r = read_config(f, path);
	if (opt_silent)
		return;
	while (r != NULL && r != (void*)-1) {
		timing = r->pzero != 0 || r->pzero != 0 || is_raw(r) ?
			 "timing" : "no_timing";
		strncpy(photo, path, sizeof(photo));
		get_photo(path, photo, sizeof(photo));
		get_lircmd(path, lircmd, sizeof(lircmd));
		printf("%s;%s;%s;%s;%s;%s;%s;%s\n",
		       dir,
		       base,
		       lircmd,
		       photo,
		       r->name,
		       timing,
		       is_raw(r) ? "raw" : "no_raw",
		       r->driver != NULL ? r->driver : "no_driver");
		fflush(stdout);
		if (opt_dump)
			fprint_remote(stdout, r, "Dumped by lirc-lsremotes");
		r = r->next;
	}
	;
	fclose(f);
}