/*
 * Everyone should use a slight modification of this .h for WordLoop.
 *
 *    written by J Dean Brock, Nov 2010
 *
 */

#ifndef _WORDLOOP_H
#define _WORDLOOP_H

/*
 * You must give the definition of the struct used to represent
 * the WordLoop here.  It is very likely that your code will
 * need supporting struct definitions which also must be here.
 */

/*
 * Definitions for supporting struct's must go here.
 */

/*
 * Define your top-level struct right here.
 * If should contain references to the supporting struct's.
 */

struct WordLoopNode {
    /* put your fields here */
} ;

/*
 * WordLoop should be a pointer to your top-level struct.
 * You should not need to change the following definition
 */
typedef struct WordLoopNode *WordLoop ;

/*
 * Create a WordLoop from a single word.  Your program *must*
 * make a copy of that word for its "internal" use.
 * Return a NULL if this operation cannot be performed
 * due to lack of dynamic storage.
 */
WordLoop       CreateWL   (const char *) ;

/*
 * Add a word to the *end" of the WordLoop.  Again, your
 * program must make a copy of the word.  The end of the
 * WordLoop is always the last word added.  Using AdvanceWL
 * or NextWordWL never changes the end of the WordLoop.
 * Return a non-zero value if this operation cannot be
 * performed due to lack of dynamic storage.
 */
int            AddWordWL  (WordLoop, const char *) ;

/*
 * Obtain the next word from the WordLoop.  The calling
 * program should *never* modify the returned value.
 */
const char *   NextWordWL (WordLoop) ;

/*
 * Advance the "pointer" to the next word of the WordLoop.
 */
void     AdvanceWL  (WordLoop) ;

/*
 * Delete all space used by the WordLoop.  Obviously, the
 * WordLoop should not be used after this call.
 */
void     DestroyWL  (WordLoop) ;

#endif   /* _WORDLOOP_H */
