diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2010-05-27 15:47:32 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2010-05-27 15:47:32 +0000 |
commit | 4e0f7f6517030c722fb51b50a499fc20e6085754 (patch) | |
tree | 6b99aa9b1f4e5f9a987ac8b8bdc5af484e56ceb0 | |
parent | e7ef935448a958efb07cbffa3d6c9e0c20c5022f (diff) | |
download | rockbox-4e0f7f6517030c722fb51b50a499fc20e6085754.tar.gz rockbox-4e0f7f6517030c722fb51b50a499fc20e6085754.zip |
make it slightyl more useful.. read in a up to 10Kb file, dump to stdout or outfile
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26333 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | utils/skinupdater/skinupdater.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/utils/skinupdater/skinupdater.c b/utils/skinupdater/skinupdater.c index 060d4dda47..a5e79fda96 100644 --- a/utils/skinupdater/skinupdater.c +++ b/utils/skinupdater/skinupdater.c | |||
@@ -189,11 +189,31 @@ top: | |||
189 | 189 | ||
190 | int main(int argc, char* argv[]) | 190 | int main(int argc, char* argv[]) |
191 | { | 191 | { |
192 | parse_text("%s%?it<%?in<%in. |>%it|%fn>\n" | 192 | char buffer[10*1024], temp[512]; |
193 | "%s%?ia<%ia|%?d2<%d2|(root)>>\n" | 193 | FILE *in, *out = stdout; |
194 | "%s%?id<%id|%?d1<%d1|(root)>> %?iy<(%iy)|>\n\n" | 194 | if( (argc < 2) || |
195 | "%al%pc/%pt%ar[%pp:%pe]\n" | 195 | strcmp(argv[1],"-h") == 0 || |
196 | "%fbkBit %?fv<avg|> %?iv<(id3v%iv)|(no id3)>\n" | 196 | strcmp(argv[1],"--help") == 0 ) |
197 | "%pb\n%pm\n", stdout); | 197 | { |
198 | printf("Usage: %s infile [outfile]\n", argv[0]); | ||
199 | return 0; | ||
200 | } | ||
201 | in = fopen(argv[1], "r"); | ||
202 | if (!in) | ||
203 | return 1; | ||
204 | while (fgets(temp, 512, in)) | ||
205 | strcat(buffer, temp); | ||
206 | |||
207 | if (argc == 3) | ||
208 | { | ||
209 | out = fopen(argv[2], "w"); | ||
210 | if (!out) | ||
211 | return 1; | ||
212 | } | ||
213 | |||
214 | parse_text(buffer, out); | ||
215 | fclose(in); | ||
216 | if (out != stdout) | ||
217 | fclose(out); | ||
198 | return 0; | 218 | return 0; |
199 | } | 219 | } |