summaryrefslogtreecommitdiffstats
path: root/utils/skinupdater/skinupdater.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2010-05-27 15:47:32 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2010-05-27 15:47:32 +0000
commit4e0f7f6517030c722fb51b50a499fc20e6085754 (patch)
tree6b99aa9b1f4e5f9a987ac8b8bdc5af484e56ceb0 /utils/skinupdater/skinupdater.c
parente7ef935448a958efb07cbffa3d6c9e0c20c5022f (diff)
downloadrockbox-4e0f7f6517030c722fb51b50a499fc20e6085754.tar.gz
rockbox-4e0f7f6517030c722fb51b50a499fc20e6085754.tar.bz2
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
Diffstat (limited to 'utils/skinupdater/skinupdater.c')
-rw-r--r--utils/skinupdater/skinupdater.c32
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:
int main(int argc, char* argv[])
{
- parse_text("%s%?it<%?in<%in. |>%it|%fn>\n"
- "%s%?ia<%ia|%?d2<%d2|(root)>>\n"
- "%s%?id<%id|%?d1<%d1|(root)>> %?iy<(%iy)|>\n\n"
- "%al%pc/%pt%ar[%pp:%pe]\n"
- "%fbkBit %?fv<avg|> %?iv<(id3v%iv)|(no id3)>\n"
- "%pb\n%pm\n", stdout);
+ char buffer[10*1024], temp[512];
+ FILE *in, *out = stdout;
+ if( (argc < 2) ||
+ strcmp(argv[1],"-h") == 0 ||
+ strcmp(argv[1],"--help") == 0 )
+ {
+ printf("Usage: %s infile [outfile]\n", argv[0]);
+ return 0;
+ }
+ in = fopen(argv[1], "r");
+ if (!in)
+ return 1;
+ while (fgets(temp, 512, in))
+ strcat(buffer, temp);
+
+ if (argc == 3)
+ {
+ out = fopen(argv[2], "w");
+ if (!out)
+ return 1;
+ }
+
+ parse_text(buffer, out);
+ fclose(in);
+ if (out != stdout)
+ fclose(out);
return 0;
}