81int main(
int argc,
char *argv[]) {
85 " icnspack image.icns 1x.png 2x.png\n");
89 (void) remove(argv[1]);
92 int r1 = read_file(argv[2], &buffer1x, &size1x);
95 int r2 = read_file(argv[3], &buffer2x, &size2x);
98 if (r1 == 0 && r2 == 0) {
99 fh = fopen (argv[1],
"wb");
102 fwrite(
"icns",
sizeof(
uint32_t), 1, fh);
106 fwrite(
"ic07",
sizeof(
uint32_t), 1, fh);
108 fwrite(buffer1x, size1x, 1, fh);
111 fwrite(
"ic13",
sizeof(
uint32_t), 1, fh);
113 fwrite(buffer2x, size2x, 1, fh);
119 if (r1 == 0)
free(buffer1x);
120 if (r2 == 0)
free(buffer2x);
122 return fh != NULL ? 0 : -1;