File: make-resource

package info (click to toggle)
kgames 2.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,596 kB
  • sloc: ansic: 31,589; yacc: 1,067; lex: 216; sh: 149; makefile: 9
file content (20 lines) | stat: -rwxr-xr-x 363 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

case $# in
    2)
    ;;
    *)
	echo "usage: $0 cards.c cards.h"
	exit 1
	;;
esac

input="$1"
output="$2"

(
    echo 'static const char *const defaultResources[] = {'
    sed -e 's/^[ \t]*//' -e 's/\\n/\\\\n/g' -e 's/"/\\"/g' -e 's/\([^\\]\)$/\1",/' -e 's/^$/"/' -e 's/\\$/"/' -e 's/^/    "/' "$input"
    echo "    0,"
    echo '};'
) > "$output"