Ignore:
Timestamp:
Mar 17, 2008, 11:31:35 PM (17 years ago)
Author:
bird
Message:

Made a variation of the $(eval) function call evalctx that pushes and pops the variable context - CONFIG_WITH_EVALCTX.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/function.c

    r1408 r1409  
    15051505
    15061506
     1507#ifdef CONFIG_WITH_EVALCTX
     1508/* Same as func_eval except that we push and pop the local variable
     1509   context before evaluating the buffer. */
     1510static char *
     1511func_evalctx (char *o, char **argv, const char *funcname UNUSED)
     1512{
     1513  char *buf;
     1514  unsigned int len;
     1515
     1516  /* Eval the buffer.  Pop the current variable buffer setting so that the
     1517     eval'd code can use its own without conflicting.  */
     1518
     1519  install_variable_buffer (&buf, &len);
     1520
     1521  push_new_variable_scope ();
     1522
     1523  eval_buffer (argv[0]);
     1524
     1525  pop_variable_scope ();
     1526
     1527  restore_variable_buffer (buf, len);
     1528
     1529  return o;
     1530}
     1531#endif /* CONFIG_WITH_EVALCTX */
     1532
    15071533static char *
    15081534func_value (char *o, char **argv, const char *funcname UNUSED)
     
    34903516  { STRING_SIZE_TUPLE("value"),         0,  1,  1,  func_value},
    34913517  { STRING_SIZE_TUPLE("eval"),          0,  1,  1,  func_eval},
     3518#ifdef CONFIG_WITH_EVALCTX
     3519  { STRING_SIZE_TUPLE("evalctx"),       0,  1,  1,  func_evalctx},
     3520#endif
    34923521#ifdef EXPERIMENTAL
    34933522  { STRING_SIZE_TUPLE("eq"),            2,  2,  1,  func_eq},
Note: See TracChangeset for help on using the changeset viewer.