#!/bin/ksh93
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
# 61haes_r714 src/43haes/lib/ksh93/util/KLIB_UTIL_word_count.sh 1.5 
#  
# Licensed Materials - Property of IBM 
#  
# Restricted Materials of IBM 
#  
# COPYRIGHT International Business Machines Corp. 2005,2012 
# All Rights Reserved 
#  
# US Government Users Restricted Rights - Use, duplication or 
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 
#  
# IBM_PROLOG_END_TAG 
# @(#)19	1.5 src/43haes/lib/ksh93/util/KLIB_UTIL_word_count.sh, hacmp, 61haes_r714 6/10/12 14:05:15

#
#=head1 NAME
#
# KLIB_UTIL_word_count - Count the number of words in a string
#
#=head1 SYNOPSIS
#
# typeset string="HACMP v5.3 on AIX 5.3"
# typeset -i word_count=0
# KLIB_UTIL_word_count word_count $string
# echo "Number of words: $word_count"
#
#=head1 DESCRIPTION
#
# Counts the number of words in a string
#
#=head1 ARGUMENTS
#
#   1: [by ref] counter returns the number of words counted
#   2+ [scalar] strings to count
#
#=head1 RETURN
#
#   None
#
#=head1 COPYRIGHT
#
#(C) COPYRIGHT International Business Machines Corp. 2005
#All Rights Reserved
#
#=cut
#
function KLIB_UTIL_word_count {
    LINENO=2 . $HALIBROOT/log_entry "$0()" "$CL" max
    : version=1.5, src/43haes/lib/ksh93/util/KLIB_UTIL_word_count.sh, hacmp, 61haes_r714
    : INPUTS: $*

    typeset -n result=$1
    shift
    result=$#

    log_return_msg 0 $0 $LINENO
    return $?
} # End of "KLIB_UTIL_word_count()"
