/* Return total size of values defined by a type string. */
size_t type_string_get_space_size(const char *type_str)
/* Return total size of values defined by a type string. */
size_t type_string_get_space_size(const char *type_str)
{
	size_t size;
	for (size = 0; *type_str; type_str++) {
		switch (*type_str) {
		case 'b':
			size += 1;
			break;
		case 'w':
			size += 2;
			break;
		case 'd':
			size += 4;
			break;
		default:
			return 0;
		}
	}
	return size;
}