s502 assembler
A very simple assembler for the 6502 line of processors written in C
|
Go to the documentation of this file. 1 #include "debugmalloc.h"
20 ERROR(
"Memory allocation error in map_new()!\n");
48 ERROR(
"Memory allocation error in map_set()!\n");
65 while (map->
head != NULL) {
87 printf(
"\t%s:\t\t%d\n", ptr->name, ptr->value);
int map_set(Map *map, char *name, int value)
Sets a key in the map.
#define LOG(LVL,...)
logging macro - works like printf
void map_debug_print(Map *map)
Print all key-value pairs of the map.
Simple key->value map (str->int)
struct MapEntry * next
pointer to the next entry or NULL
void map_free(Map *map)
Free the map with all associated memory.
int map_get(Map *map, char *name)
Get the value of a key.
char name[MAP_MAX_KEY_LEN]
key of the entry
logging and fancy-printing
@ MAP_MAX_KEY_LEN
Key buffer size for Map.
struct MapEntry * map_find(Map *map, char *key)
Find a key in a map.
#define ERROR(...)
Fancy-print an error (cause of faliure). Works like printf.
Map * map_new()
Create a new map with 0 elements.
int value
the value the entry holds