#define QUOTE_OMIT_LEADING_TRAILING_QUOTES 0x02
#define QUOTE_OMIT_TRAILING_0 0x08
#define QUOTE_FORCE_HEX 0x10
+#define QUOTE_EMIT_COMMENT 0x20
extern int string_quote(const char *, char *, unsigned int, unsigned int);
extern int print_quoted_string(const char *, unsigned int, unsigned int);
}
}
+ if (style & QUOTE_EMIT_COMMENT)
+ s = stpcpy(s, " /* ");
if (!(style & QUOTE_OMIT_LEADING_TRAILING_QUOTES))
*s++ = '\"';
if (!(style & QUOTE_OMIT_LEADING_TRAILING_QUOTES))
*s++ = '\"';
+ if (style & QUOTE_EMIT_COMMENT)
+ s = stpcpy(s, " */");
*s = '\0';
/* Return zero if we printed entire ASCIZ string (didn't truncate it) */
asciz_ended:
if (!(style & QUOTE_OMIT_LEADING_TRAILING_QUOTES))
*s++ = '\"';
+ if (style & QUOTE_EMIT_COMMENT)
+ s = stpcpy(s, " */");
*s = '\0';
/* Return zero: we printed entire ASCIZ string (didn't truncate it) */
return 0;
tprints("???");
return -1;
}
- alloc_size += 1 + (style & QUOTE_OMIT_LEADING_TRAILING_QUOTES ? 0 : 2);
+ alloc_size += 1 + (style & QUOTE_OMIT_LEADING_TRAILING_QUOTES ? 0 : 2) +
+ (style & QUOTE_EMIT_COMMENT ? 7 : 0);
if (use_alloca(alloc_size)) {
outstr = alloca(alloc_size);