Print this page
XXX Remove nawk(1)


  31 INCDIR=${ROOT}/usr/include/smbsrv
  32 
  33 PROGNAME=`basename $0`
  34 
  35 ndrgen_usage()
  36 {
  37         if [[ $1 != "" ]] ; then
  38                 print "$PROGNAME: ERROR: $1"
  39         fi
  40 
  41         echo "usage: $PROGNAME [-Y cpp-path] file [file]..."
  42         exit 1
  43 }
  44 
  45 # Copy header text from the input ndl file to the generated ndr C file.
  46 ndrgen_copy_header()
  47 {
  48         ndl_file=$1
  49         ndr_file=$2
  50 
  51         nawk 'BEGIN { copy=0; }
  52         /^\/\* NDRGEN_HEADER_BEGIN \*\// { copy=1; next; }
  53         /^\/\* NDRGEN_HEADER_END \*\// { copy=0; next; }
  54         /./ { if (copy==1) print; }' < $ndl_file > $ndr_file
  55 }
  56 
  57 if [[ $# -lt 1 ]] ; then
  58         ndrgen_usage
  59 fi
  60 
  61 while getopts "Y" FLAG $*; do
  62         case $FLAG in
  63         Y)
  64                 CC_FLAG="y"
  65                 ;;
  66         *)
  67                 ndrgen_usage
  68                 ;;
  69         esac
  70 done
  71 




  31 INCDIR=${ROOT}/usr/include/smbsrv
  32 
  33 PROGNAME=`basename $0`
  34 
  35 ndrgen_usage()
  36 {
  37         if [[ $1 != "" ]] ; then
  38                 print "$PROGNAME: ERROR: $1"
  39         fi
  40 
  41         echo "usage: $PROGNAME [-Y cpp-path] file [file]..."
  42         exit 1
  43 }
  44 
  45 # Copy header text from the input ndl file to the generated ndr C file.
  46 ndrgen_copy_header()
  47 {
  48         ndl_file=$1
  49         ndr_file=$2
  50 
  51         /usr/xpg4/bin/awk 'BEGIN { copy=0; }
  52         /^\/\* NDRGEN_HEADER_BEGIN \*\// { copy=1; next; }
  53         /^\/\* NDRGEN_HEADER_END \*\// { copy=0; next; }
  54         /./ { if (copy==1) print; }' < $ndl_file > $ndr_file
  55 }
  56 
  57 if [[ $# -lt 1 ]] ; then
  58         ndrgen_usage
  59 fi
  60 
  61 while getopts "Y" FLAG $*; do
  62         case $FLAG in
  63         Y)
  64                 CC_FLAG="y"
  65                 ;;
  66         *)
  67                 ndrgen_usage
  68                 ;;
  69         esac
  70 done
  71