orc_hash.sh 316 B

12345678910111213141516
  1. #!/bin/sh
  2. # SPDX-License-Identifier: GPL-2.0-or-later
  3. # Copyright (c) Meta Platforms, Inc. and affiliates.
  4. set -e
  5. printf '%s' '#define ORC_HASH '
  6. awk '
  7. /^#define ORC_(REG|TYPE)_/ { print }
  8. /^struct orc_entry {$/ { p=1 }
  9. p { print }
  10. /^}/ { p=0 }' |
  11. sha1sum |
  12. cut -d " " -f 1 |
  13. sed 's/\([0-9a-f]\{2\}\)/0x\1,/g'