#include <stdlib.h>
#include "WordMap.h"

/*
 * Everyone should start with this implementation of WordMap
 *
 *    written by J Dean Brock, Nov 2010
 *
 */


/*
 * In case you decide to use hashing, this public domain function
 * which is part of the UNIX ELF specification is widely used.
 *
 * If you don't use hashing, remove this function to avoid a warning.
 */

static unsigned int hash(const char *name)
{
  unsigned int h = 0, g;

  while ( *name ) {
    h = ( h << 4 ) + *name++;
    if ( (g = h & 0xF0000000) )
      h ^= g >> 24;
    h &= ~g;
  }

  return h;
}


/*
 * The initial implementation does nothing!
 */

WordMap CreateWM(void) {
    /* Delete the following line and add code to do something */
    return (WordMap) NULL ;
}


int     InsertWM(WordMap wm, const char *key, const void *value) {
    /* Delete the following line and add code to do something */
    return 1 ;
}

void *  LookupWM(WordMap wm, const char *key) {
    /* Delete the following line and add code to do something */
  return (void *) "FIX ME" ;
}

void    DestroyWM (WordMap wm) {
    /* Add code to do somethig */
}
