File: gen_subtype_info.sh

package info (click to toggle)
gridengine 6.2-4
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 51,532 kB
  • ctags: 51,172
  • sloc: ansic: 418,155; java: 37,080; sh: 22,593; jsp: 7,699; makefile: 5,292; csh: 4,244; xml: 2,901; cpp: 2,086; perl: 1,895; tcl: 1,188; lisp: 669; ruby: 642; yacc: 393; lex: 266
file content (24 lines) | stat: -rwxr-xr-x 986 bytes parent folder | download
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