|
| 1 | +# |
| 2 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 3 | +# or more contributor license agreements. See the NOTICE file |
| 4 | +# distributed with this work for additional information |
| 5 | +# regarding copyright ownership. The ASF licenses this file |
| 6 | +# to you under the Apache License, Version 2.0 (the |
| 7 | +# "License"); you may not use this file except in compliance |
| 8 | +# with the License. You may obtain a copy of the License at |
| 9 | +# |
| 10 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +# |
| 12 | +# Unless required by applicable law or agreed to in writing, |
| 13 | +# software distributed under the License is distributed on an |
| 14 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | +# KIND, either express or implied. See the License for the |
| 16 | +# specific language governing permissions and limitations |
| 17 | +# under the License. |
| 18 | +# |
| 19 | + |
| 20 | +# awk script run AFTER uncrustify reformats code to format |
| 21 | +# STATS_NAME and STATS_SECT block to have indents removed |
| 22 | +# by uncrustify |
| 23 | + |
| 24 | +# detect begining of STATS_NAME section |
| 25 | +/^(static )?STATS_NAME_START[(]/ { stats_name = 1 } |
| 26 | +# detect end of STATN_NAME section |
| 27 | +/^STATS_NAME_END/ { stats_name = 0 } |
| 28 | +# for each line in sectin add 4 spaces eaten by uncrustify |
| 29 | +/^STATS_NAME[(]/ && stats_name == 1 { printf " " } |
| 30 | + |
| 31 | +# detect begining of STATS_SECT section |
| 32 | +/^STATS_SECT_START[(]/ { stats_sect = 1 } |
| 33 | +# detect end of STATN_SECT section |
| 34 | +/^STATS_SECT_END/ { stats_sect = 0 } |
| 35 | +# for each line in sectin add 4 spaces eaten by uncrustify |
| 36 | +/^STATS_SECT_ENTRY[(]/ && stats_sect == 1 { printf " " } |
| 37 | +{ print } |
0 commit comments