예제 #1
0
STDMETHODIMP CZ80Assembler::get_Labels(LPSAFEARRAY *ppsa)
{
	CComSafeArray<IDispatch *> sa((ULONG) label_table->used);

	m_lIndex = sa.GetLowerBound(0);
	hash_enum(label_table, (HASH_ENUM_CALLBACK) get_label_callback, &sa);

	LPSAFEARRAY lpsa;
	sa.CopyTo(&lpsa);

	*ppsa = lpsa;
	return S_OK;
}
예제 #2
0
	STDMETHOD(get_Labels)(IDictionary **ppLabels)
	{
		if (m_fLabelsAreValid == FALSE)
		{
			m_labels.CreateInstance(__uuidof(Dictionary));
			if (label_table != NULL)
			{
				hash_enum(label_table, label_enum_callback, m_labels.GetInterfacePtr());
			}
			m_fLabelsAreValid = TRUE;
		}

		return m_labels->QueryInterface(ppLabels);
	}
예제 #3
0
void write_labels (char *filename) {
	FILE *symtable;
	label_t hdr_node;
	list_t label_list;
	list_t *node;

	symtable = fopen (filename, "w");
	if (!symtable) {
		printf ("Couldn't open output file %s\n", filename);
		return;
	}

	// Create a header node with an impossible label name
	hdr_node.name = strdup("#header");
	
	label_list.data = &hdr_node;
	label_list.next = NULL;
	
	int session = StartSPASMErrorSession();
	hash_enum (label_table, write_labels_callback, &label_list);
	hash_enum (define_table, write_defines_callback, &label_list);
	EndSPASMErrorSession(session);
	
	node = label_list.next;
	int index = 0;
	while (node != NULL) {
		label_t *label = (label_t *) node->data;
		fprintf (symtable, "%s = $%.4X\n", label->name, label->value);
		index++;
		node = node->next;
	}

	fclose (symtable);
	
	list_free (label_list.next, true, NULL);
	free(hdr_node.name);
}
예제 #4
0
void dump_defines() {

	hash_enum(define_table, (HASH_ENUM_CALLBACK) dump_defines_callback, NULL);

}
예제 #5
0
void dump_defines() {

	hash_enum(define_table, dump_defines_callback, NULL);

}