File: convert

package info (click to toggle)
librtpi 1.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 524 kB
  • sloc: ansic: 3,463; cpp: 1,121; makefile: 62; sh: 40
file content (14 lines) | stat: -rwxr-xr-x 336 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh

if [ $# -eq 0 ]; then
    echo "Usage:"
    echo -e "\t$0 <file_to_convert>"
    exit 1
fi

mv "$1" "$1.old"

sed 's/pthread_mutex_/pi_mutex_/g' "$1.old" | \
sed 's/pthread_cond_/pi_cond_/g' | \
sed 's/\(pi_cond_wait[\s]*([^,]*\)\([^\)]*\)/\1/g' | \
sed 's/\(pi_cond_timedwait[\s]*([^,]*\)\(,[^,]*\)\([^\)]*\)/\1\3/g' > "$1"