| 370 | } |
| 371 | |
| 372 | AVExpr *ff_parse_expr(const char *s, const char * const *const_name, |
| 373 | double (* const *func1)(void *, double), const char * const *func1_name, |
| 374 | double (* const *func2)(void *, double, double), const char * const *func2_name, |
| 375 | const char **error){ |
| 376 | Parser p; |
| 377 | AVExpr *e = NULL; |
| 378 | char *w = av_malloc(strlen(s) + 1); |
| 379 | char *wp = w; |
| 380 | |
| 381 | if (!w) |
| 382 | goto end; |
| 383 | |
| 384 | while (*s) |
| 385 | if (!isspace(*s++)) *wp++ = s[-1]; |
| 386 | *wp++ = 0; |
| 387 | |
| 388 | p.stack_index=100; |
| 389 | p.s= w; |
| 390 | p.const_name = const_name; |
| 391 | p.func1 = func1; |
| 392 | p.func1_name = func1_name; |
| 393 | p.func2 = func2; |
| 394 | p.func2_name = func2_name; |
| 395 | p.error= error; |
| 396 | |
| 397 | e = parse_expr(&p); |
| 398 | if (!verify_expr(e)) { |
| 399 | ff_free_expr(e); |
| 400 | e = NULL; |
| 401 | } |
| 402 | end: |
| 403 | av_free(w); |
| 404 | return e; |
| 405 | } |
| 406 | |
| 407 | double ff_eval_expr(AVExpr * e, const double *const_value, void *opaque) { |
| 408 | Parser p; |
no test coverage detected