WONKY



LOG | FILES | OVERVIEW


#ifndef WONKY_IDENTIFIER_C
#define WONKY_IDENTIFIER_C WONKY_IDENTIFIER_C
#include <identifier.h>

struct identifier* get_identifier(char *data,size_t size)
{
	struct identifier *ret;
	ret=wonky_malloc(sizeof(struct identifier));
	ret->size=size;
	ret->data=wonky_malloc(size+1);
	gmemmove(ret->data,data,size);
	ret->data[size]='\0';
	ret->last_defined_macro_with_this_id=NULL;
	ret->number_of_translation_unit_where_id_was_last_defined_as_a_macro=0;
	ret->was_already_expanded_as_a_macro=0;
	ret->hold_functionlike_define_directive=NULL;
	return ret;
}
_Bool id_is_a_macro(struct identifier *id,size_t translation_unit_number)
{
	/*dark majick*/
	return (id->number_of_translation_unit_where_id_was_last_defined_as_a_macro == translation_unit_number
		&&
		!id->was_already_expanded_as_a_macro);
}
#endif