You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
1.5 KiB
65 lines
1.5 KiB
/// @file xed-operand-visibility-enum.c
|
|
|
|
// This file was automatically generated.
|
|
// Do not edit this file.
|
|
|
|
#include <string.h>
|
|
#include <assert.h>
|
|
#include "xed-operand-visibility-enum.h"
|
|
|
|
typedef struct {
|
|
const char* name;
|
|
xed_operand_visibility_enum_t value;
|
|
} name_table_xed_operand_visibility_enum_t;
|
|
static const name_table_xed_operand_visibility_enum_t name_array_xed_operand_visibility_enum_t[] = {
|
|
{"INVALID", XED_OPVIS_INVALID},
|
|
{"EXPLICIT", XED_OPVIS_EXPLICIT},
|
|
{"IMPLICIT", XED_OPVIS_IMPLICIT},
|
|
{"SUPPRESSED", XED_OPVIS_SUPPRESSED},
|
|
{"LAST", XED_OPVIS_LAST},
|
|
{0, XED_OPVIS_LAST},
|
|
};
|
|
|
|
|
|
xed_operand_visibility_enum_t str2xed_operand_visibility_enum_t(const char* s)
|
|
{
|
|
const name_table_xed_operand_visibility_enum_t* p = name_array_xed_operand_visibility_enum_t;
|
|
while( p->name ) {
|
|
if (strcmp(p->name,s) == 0) {
|
|
return p->value;
|
|
}
|
|
p++;
|
|
}
|
|
|
|
|
|
return XED_OPVIS_INVALID;
|
|
}
|
|
|
|
|
|
const char* xed_operand_visibility_enum_t2str(const xed_operand_visibility_enum_t p)
|
|
{
|
|
xed_operand_visibility_enum_t type_idx = p;
|
|
if ( p > XED_OPVIS_LAST) type_idx = XED_OPVIS_LAST;
|
|
return name_array_xed_operand_visibility_enum_t[type_idx].name;
|
|
}
|
|
|
|
xed_operand_visibility_enum_t xed_operand_visibility_enum_t_last(void) {
|
|
return XED_OPVIS_LAST;
|
|
}
|
|
|
|
/*
|
|
|
|
Here is a skeleton switch statement embedded in a comment
|
|
|
|
|
|
switch(p) {
|
|
case XED_OPVIS_INVALID:
|
|
case XED_OPVIS_EXPLICIT:
|
|
case XED_OPVIS_IMPLICIT:
|
|
case XED_OPVIS_SUPPRESSED:
|
|
case XED_OPVIS_LAST:
|
|
default:
|
|
xed_assert(0);
|
|
}
|
|
*/
|