+/* Dump the string from FINPUT to FOUTPUT. MATCH is the delimiter of
+ the string (either ' or "). */
+
+static inline void
+copy_string (FILE *finput, FILE *foutput, int match)
+{
+ int c;
+
+ putc (match, foutput);
+ c = getc (finput);
+
+ while (c != match)
+ {
+ if (c == EOF)
+ fatal (_("unterminated string at end of file"));
+ if (c == '\n')
+ {
+ warn (_("unterminated string"));
+ ungetc (c, finput);
+ c = match; /* invent terminator */
+ continue;
+ }
+
+ putc(c, foutput);
+
+ if (c == '\\')
+ {
+ c = getc (finput);
+ if (c == EOF)
+ fatal (_("unterminated string at end of file"));
+ putc (c, foutput);
+ if (c == '\n')
+ lineno++;
+ }
+
+ c = getc(finput);
+ }
+
+ putc(c, foutput);
+}
+
+
+/* Dump the comment from FINPUT to FOUTPUT. C is either `*' or `/',
+ depending upon the type of comments used. */
+
+static inline void
+copy_comment (FILE *finput, FILE *foutput, int c)
+{
+ int cplus_comment;
+ register int match;
+ register int ended;
+
+ cplus_comment = (c == '/');
+ putc (c, foutput);
+ c = getc (finput);
+
+ ended = 0;
+ while (!ended)
+ {
+ if (!cplus_comment && c == '*')
+ {
+ while (c == '*')
+ {
+ putc(c, foutput);
+ c = getc(finput);
+ }
+
+ if (c == '/')
+ {
+ putc(c, foutput);
+ ended = 1;
+ }
+ }
+ else if (c == '\n')
+ {
+ lineno++;
+ putc (c, foutput);
+ if (cplus_comment)
+ ended = 1;
+ else
+ c = getc(finput);
+ }
+ else if (c == EOF)
+ fatal (_("unterminated comment"));
+ else
+ {
+ putc (c, foutput);
+ c = getc (finput);
+ }
+ }
+}
+
+