/// @file xed-address-width-enum.c

// This file was automatically generated.
// Do not edit this file.

#include <string.h>
#include <assert.h>
#include "xed-address-width-enum.h"

typedef struct {
    const char* name;
    xed_address_width_enum_t value;
} name_table_xed_address_width_enum_t;
static const name_table_xed_address_width_enum_t name_array_xed_address_width_enum_t[] = {
{"INVALID", XED_ADDRESS_WIDTH_INVALID},
{"16b", XED_ADDRESS_WIDTH_16b},
{"32b", XED_ADDRESS_WIDTH_32b},
{"64b", XED_ADDRESS_WIDTH_64b},
{"LAST", XED_ADDRESS_WIDTH_LAST},
{0, XED_ADDRESS_WIDTH_LAST},
};

        
xed_address_width_enum_t str2xed_address_width_enum_t(const char* s)
{
   const name_table_xed_address_width_enum_t* p = name_array_xed_address_width_enum_t;
   while( p->name ) {
     if (strcmp(p->name,s) == 0) {
      return p->value;
     }
     p++;
   }
        

   return XED_ADDRESS_WIDTH_INVALID;
}


const char* xed_address_width_enum_t2str(const xed_address_width_enum_t p)
{
   const name_table_xed_address_width_enum_t* q = name_array_xed_address_width_enum_t;
   while( q->name ) {
      if (q->value == p) {
         return q->name;
      }
      q++;
   }
   return "???";
}

xed_address_width_enum_t xed_address_width_enum_t_last(void) {
    return XED_ADDRESS_WIDTH_LAST;
}
       
/*

Here is a skeleton switch statement embedded in a comment


  switch(p) {
  case XED_ADDRESS_WIDTH_INVALID:
  case XED_ADDRESS_WIDTH_16b:
  case XED_ADDRESS_WIDTH_32b:
  case XED_ADDRESS_WIDTH_64b:
  case XED_ADDRESS_WIDTH_LAST:
  default:
     xed_assert(0);
  }
*/
