#define TRX_MAGIC 0x30524448 /* "HDR0" */
#define TRX_VERSION 1
-#define TRX_MAX_LEN 0x5A0000
+#define TRX_MAX_LEN 0x720000
#define TRX_NO_HEADER 1 /* Do not write TRX header */
struct trx_header {
char *ofn = NULL;
char *buf;
char *e;
- int c, i;
+ int c, i, append = 0;
size_t n;
uint32_t cur_len;
unsigned long maxlen = TRX_MAX_LEN;
in = NULL;
i = 0;
- while ((c = getopt(argc, argv, "-:o:m:a:b:f:")) != -1) {
+ while ((c = getopt(argc, argv, "-:o:m:a:b:f:A:")) != -1) {
switch (c) {
+ case 'A':
+ append = 1;
+ /* fall through */
case 'f':
case 1:
- p->offsets[i++] = STORE32_LE(cur_len);
+ if (!append)
+ p->offsets[i++] = STORE32_LE(cur_len);
if (!(in = fopen(optarg, "r"))) {
fprintf(stderr, "can not open \"%s\" for reading\n", optarg);
n += ROUND - (n & (ROUND-1));
}
cur_len += n;
+ append = 0;
break;
case 'o':
fprintf(stderr, "realloc failed");
return EXIT_FAILURE;
}
+ p = (struct trx_header *) buf;
break;
case 'a':
errno = 0;
}
fclose(out);
-
+
return EXIT_SUCCESS;
}