| 482 | } // namespace |
| 483 | |
| 484 | absl::Status RegisterTimeFunctions(FunctionRegistry& registry, |
| 485 | const RuntimeOptions& options) { |
| 486 | CEL_RETURN_IF_ERROR(RegisterTimestampFunctions(registry, options)); |
| 487 | CEL_RETURN_IF_ERROR(RegisterDurationFunctions(registry)); |
| 488 | |
| 489 | // Special arithmetic operators for Timestamp and Duration |
| 490 | // TODO(uncreated-issue/37): deprecate unchecked time math functions when clients no |
| 491 | // longer depend on them. |
| 492 | if (options.enable_timestamp_duration_overflow_errors) { |
| 493 | return RegisterCheckedTimeArithmeticFunctions(registry); |
| 494 | } |
| 495 | |
| 496 | return RegisterUncheckedTimeArithmeticFunctions(registry); |
| 497 | } |
| 498 | |
| 499 | } // namespace cel |