Artifact 5be60cec7527d0042c37d3c197a65c727af4fd20:
- Executable file tools/c-struct.sh — part of check-in [f24ab8b2d8] at 2021-03-27 12:19:46 on branch trunk — Added tools/c-struct.sh, which has proven useful for generating skeleton code for various structs used by the library. (user: stephan size: 496)
#!/bin/bash if [[ x = "x$1" ]]; then echo "Usage: $0 struct_name" exit 1 fi s=$1 cat <<EOF /** */ struct $s { int dummy; }; /** Convenience typedef. */ typedef struct $s $s; /** Initialized-with-defaults $s structure, intended for const-copy initialization. */ #define ${s}_empty_m {0} /** Initialized-with-defaults $s structure, intended for non-const copy initialization. */ extern const $s ${s}_empty; // Put this in a C file: const $s ${s}_empty = ${s}_empty_m; EOF