File: deema.c

package info (click to toggle)
clisp 1:2.27-0.5
  • links: PTS
  • area: main
  • in suites: woody
  • size: 49,860 kB
  • ctags: 20,752
  • sloc: ansic: 123,781; lisp: 67,533; asm: 19,633; xml: 11,766; sh: 9,788; fortran: 8,307; makefile: 3,570; objc: 2,481; perl: 1,744; java: 341; yacc: 318; sed: 117
file content (27 lines) | stat: -rw-r--r-- 498 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* C-Programm-Präprozessor-Hilfe:
   Fügt _EMA_ in leere Macro-Argumente ein.
   Äquivalent zu  sed -e 's/,)/,_EMA_)/g'
   Bruno Haible 29.12.1993
*/

#include <stdio.h>

#ifdef __cplusplus
extern "C" void exit(int);
#endif

int main ()
{
  int c;
  int c1 = -1;
  while (1) {
    c = getchar(); if (c==EOF) break;
    if ((c == ')') && (c1 == ','))
      fputs("_EMA_",stdout);
    putchar(c);
    c1 = c;
  }
  if (ferror(stdin) || fflush(stdout) || ferror(stdout)) { exit(1); }
  exit(0);
}