#
# These functions are used to parse README.module files
#

set -h

#--*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*--
# $1 = succeed/found/warning/fail (0/1/254/255)
# $2 = general report
# $3 = fail report

function Report()
{
  if [ "$1" -eq 255 ]; then
    echo -n "Skipping"
  elif [ "$1" -eq 254 ]; then
    echo -n "Warning "
  elif [ "$1" -eq 1 ]; then
    echo -n "Found   "
  else
    echo -n "Adding  "
  fi
  echo -n " : $2"
  if [ ! "$3" = "" ]; then
    echo " ($3)"
  else
    echo ""
  fi
}

#--*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*--
# $1 = author name
# $2 = author address

function author()
{
  echo ": Copyright (c) $1 ($2)"
}

#--*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*--
# $1 = comment
# $2 = log it?

function comment()
{
  echo ": $1"
}

#--*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*--

function depend()
{
  echo > /dev/null
}

#--*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*--
# $1 = directory
# $2 = permissions

function dir()
{
  echo > /dev/null
}

#--*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*--
# no arguements

function endinfo()
{
  exit
}

#--*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*--
# $1 = source
# $2 = dest
# $3 = permissions

function file()
{
  echo > /dev/null
}

#--*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*--
# $1 = file to link to
# $2 = link

function link()
{
  echo > /dev/null
}

#--*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*--
# $1 = log comment
# $2 = echo it?

function log()
{
  echo > /dev/null
}

#--*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*--
# no arguements

function pause()
{
  echo > /dev/null
}

#--*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*--
# $1 = required util

function require()
{
  echo -n "This module requires '$1' "
  if which "$1" > /dev/null ; then
    echo "which is installed."
  else
    echo "which you need to install."
  fi
}

#--*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*--
# $1 = title

function title()
{
  echo "$1"
  echo "--------------------"
}
