/*
   <p>Test harness for <i>strlwr()</i> and <i>strupr()</i>.</p>

   <kbd>
   <b>environ - C programming support functions</b><br>
   Copyright (C) 2005  Martin C Gregorie
   
   This program is free software; you can redistribute it and/or
   modify it under the terms of the Lesser GNU General Public License.
   
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
  
   You should have received a copy of the Lesser GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
   </kbd>
  
   <p>Contact Martin Gregorie at <i>martin@gregorie.org</i></p>
*/

#include <stdio.h>
#include <string.h>
#include "environ.h"

#ifdef LINUX
#include <stdlib.h>
#endif

main(int argc, char **argv)
{
    
    char buff[256];
    char *buff2;
    int  i;

    setprog(argv[0]);
    
    if (argc < 2)
        printf("Piss off, Noddy\n");
    else
    {
        for (i = 1; i < argc; i++)
        {
            strcpy(buff,argv[i]);
            buff2 = strdup(buff);
            if (buff2)
                printf("String duplicated\n");
            else
                {
                    printf("STRDUP failed to store string\n");
                    break;
                }
            printf("Input: %s ",buff);
            printf("lower: %s ",strlwr(buff));
            printf("upper: %s ",strupr(buff2));
            printf("\n");
            free(buff2);
        }
    }
    return 0;
}
    
