eval.c 397 B

123456789101112131415161718192021222324
  1. #include <ctype.h>
  2. #include "decl.h"
  3. eval( str)
  4. char *str;
  5. /* Output 'str' and replace in it all $i occurances by the corrresponding
  6. * parameter-names, converted where necessary.
  7. */
  8. {
  9. register char c;
  10. int i;
  11. for ( c = *str++; c != '\0'; c= *str++)
  12. if ( c == '$' && isdigit( *str)) {
  13. i = *str++ - '0' - 1;
  14. out( "%s", C_instr_info->arg_conv[i]);
  15. }
  16. else
  17. out( "%c", c);
  18. }