File: gen_subtype_info.sh

package info (click to toggle)
gridengine 8.1.9%2Bdfsg-10
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 56,880 kB
  • sloc: ansic: 432,689; java: 87,068; cpp: 31,958; sh: 29,429; jsp: 7,757; perl: 6,336; xml: 5,828; makefile: 4,701; csh: 3,928; ruby: 2,221; tcl: 1,676; lisp: 669; yacc: 519; python: 503; lex: 361; javascript: 200
file content (24 lines) | stat: -rwxr-xr-x 987 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

output=$1

echo "/* auto generated file */"             > $output
echo "#include \"cull.h\""                   >>$output
echo "#include \"sge_all_listsL.h\""         >>$output
#echo "#include \"sge_object.h\""             >>$output
echo ""                                      >>$output
echo "const lDescr *"                        >>$output
echo "object_get_subtype(int nm)"            >>$output
echo "{"                                     >>$output
echo "   const lDescr *ret = NULL;"          >>$output
echo "   switch (nm) {"                      >>$output
while read dummy name type; do
   if [ $type != CULL_ANY_SUBTYPE ]; then
      echo "      case $name:"               >>$output
      echo "         ret = $type;"           >>$output
      echo "         break;"                 >>$output
   fi
done
echo "   }"                                  >>$output
echo "   return ret;"                        >>$output
echo "}"                                     >>$output