comparison lcdtest/showppm.c @ 19:f3671d3ad953

lcdtest: added cd command to avoid typing long pathnames for show
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 10 Apr 2018 23:37:19 +0000
parents 43cc53581975
children 1d8c499711f1
comparison
equal deleted inserted replaced
18:326a21ad56be 19:f3671d3ad953
1 #include <stdio.h> 1 #include <stdio.h>
2 #include <ctype.h> 2 #include <ctype.h>
3 #include <stdlib.h> 3 #include <stdlib.h>
4 #include <unistd.h>
4 5
5 char *ppm_filename; 6 char *ppm_filename;
6 FILE *ppmfile; 7 FILE *ppmfile;
7 int ppm_is_ascii; /* P3 format instead of P6 */ 8 int ppm_is_ascii; /* P3 format instead of P6 */
8 9
164 write_dr(rc); 165 write_dr(rc);
165 } 166 }
166 fclose(ppmfile); 167 fclose(ppmfile);
167 return(0); 168 return(0);
168 } 169 }
170
171 cmd_cd(argc, argv)
172 char **argv;
173 {
174 if (chdir(argv[1]) < 0) {
175 perror(argv[1]);
176 return(-1);
177 }
178 return(0);
179 }