| 2624 | * be written. If write_it is true, actually write the timer. |
| 2625 | */ |
| 2626 | staticfn int |
| 2627 | maybe_write_timer(NHFILE *nhfp, int range, boolean write_it) |
| 2628 | { |
| 2629 | int count = 0; |
| 2630 | timer_element *curr; |
| 2631 | |
| 2632 | for (curr = gt.timer_base; curr; curr = curr->next) { |
| 2633 | if (range == RANGE_GLOBAL) { |
| 2634 | /* global timers */ |
| 2635 | |
| 2636 | if (!timer_is_local(curr)) { |
| 2637 | count++; |
| 2638 | if (write_it) write_timer(nhfp, curr); |
| 2639 | } |
| 2640 | } else { |
| 2641 | /* local timers */ |
| 2642 | |
| 2643 | if (timer_is_local(curr)) { |
| 2644 | count++; |
| 2645 | if (write_it) write_timer(nhfp, curr); |
| 2646 | } |
| 2647 | } |
| 2648 | } |
| 2649 | |
| 2650 | return count; |
| 2651 | } |
| 2652 | |
| 2653 | |
| 2654 | /* |
no test coverage detected