/* Parse the flags string from a .flags attribute list into the varaccess enum.  */
enum env_flags_varaccess env_flags_parse_varaccess(const char *flags)
/* Parse the flags string from a .flags attribute list into the varaccess enum.  */
enum env_flags_varaccess env_flags_parse_varaccess(const char *flags)
{
	char *access;
	if (strlen(flags) <= ENV_FLAGS_VARACCESS_LOC)
		return env_flags_varaccess_any;
	access = strchr(env_flags_varaccess_rep,
		flags[ENV_FLAGS_VARACCESS_LOC]);
	if (access != NULL)
		return (enum env_flags_varaccess)
			(access - &env_flags_varaccess_rep[0]);
	printf("## Warning: Unknown environment variable access method '%c'\n",
		flags[ENV_FLAGS_VARACCESS_LOC]);
	return env_flags_varaccess_any;
}