Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F30350946
usb_style.sh
hselasky (Hans Petter Selasky)
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
hselasky
Oct 15 2021, 9:22 AM
2021-10-15 09:22:41 (UTC+0)
Size
983 B
Referenced Files
None
Subscribers
None
usb_style.sh
View Options
#!/bin/sh
#
# This script should be run on every USB C- and H- file before
# commit to enforce correct style.
#
[
-z
"
$1
"
]
&&
(
echo
"Please specify a filename."
)
&&
exit
#
# The "-ta" option is an extension to indent.
# Contact hselasky@freebsd.org to receive a
# patch that adds support for this option to
# indent !
#
#
# sed -E 's/&\(([^, \)]*)\)/\&\1/' |
#
for
F
in
$*
do
echo
"Now styling
$F
"
(
cat
$F
|
indent -Toss_mixerinfo -TFILE -Tu_char -Tu_int -Tu_long
\
-TTAILQ_HEAD -TLIST_HEAD -TTAILQ_ENTRY -TLIST_ENTRY
\
-TSTAILQ_HEAD -TSTAILQ_ENTRY
\
-Tu_short -Tfd_set -ta -st -bad -bap -nbbb -nbc -br -nbs
\
-c41 -cd41 -cdb -ce -ci4 -cli0 -d0 -di8 -ndj -ei -nfc1
\
-nfcb -i8 -ip8 -l79 -lc77 -ldi0 -nlp -npcs -psl -sc
\
-nsob -nv
|
sed -e
"s/_HEAD [(]/_HEAD(/g"
|
sed -e
"s/_ENTRY [(]/_ENTRY(/g"
|
sed -e
"s/ __packed/ __packed/g"
|
sed -e
"s/ __aligned/ __aligned/g"
|
sed -e
"s/^#define /#define /g"
)
> temp
(
diff temp
$F
> /dev/null
)
||
(
cp temp
$F
)
done
File Metadata
Details
Attached
Mime Type
text/x-shellscript
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4129958
Default Alt Text
usb_style.sh (983 B)
Attached To
Mode
D32502: kldstat(8): Fix indentation
Attached
Detach File
Event Timeline
Log In to Comment