| 487 | } |
| 488 | |
| 489 | void FunctionContext::SetFunctionState(FunctionStateScope scope, void* ptr) { |
| 490 | assert(!impl_->closed_); |
| 491 | switch (scope) { |
| 492 | case THREAD_LOCAL: |
| 493 | impl_->thread_local_fn_state_ = ptr; |
| 494 | break; |
| 495 | case FRAGMENT_LOCAL: |
| 496 | impl_->fragment_local_fn_state_ = ptr; |
| 497 | break; |
| 498 | default: |
| 499 | stringstream ss; |
| 500 | ss << "Unknown FunctionStateScope: " << scope; |
| 501 | SetError(ss.str().c_str()); |
| 502 | } |
| 503 | } |
| 504 | |
| 505 | const BuiltInFunctions* FunctionContext::Functions() const { |
| 506 | return &impl_->functions_; |