• Create a directory named ``pup2'' under your home directory.
    This directory must contain
    • Makefile
    • README
      Put your brief description of exercise in this file.
    • main.c
      (Or you can copy it from Textbook on page 20, but change prototype of makeargv to
      #include "argvlib.h".)
    • argvlib.c
      The C program contains your implementation of makeargv(). Your code should be thread-safe.
    • argvlib.h
      Contains the prototype for makeargv().
  • When type ``make'' in your exercise directory, an executable named ``argvtest'' must be generated.
  • Due day, 3/11 00:05am
  •  
       The prototype of makeargv() is 
       int makeargv(const char *s, const char *delimiters, char ***argvp); 
    
       Example: 
         char *string = "this is a test";
         char *delimiters = " ";
         char **fields;
         int  numOfTokens;
    
         numOfTokens = makeargv(string, delimiters, &fields);
    
      The makeargv() separates the string into tokens according the delimiters 
      which are passed in second argument.
      makeargv() does not change the original string and delimiters and 
      will allocate memory for the third argument which is returned as the
      parsing result. In the example, after the invokation of makeargv(),
      fields[0] should be "this" and  fields[1] = "is" .....
      The return value is the number of tokes found.  The return value of 
      above example should be 4.  If any error were found, return -1.