Listing 1
/* line read from .asm file */ #define MAX_LINE_LEN 1024 typedef char LINE[MAX_LINE_LEN + 1]; /* set of tokens extracted from list in .asm file */ #define MAX_TOKENS 10 #define MAX_TOKEN_LEN 80 typedef char TOKENS[MAX_TOKENS][MAX_TOKEN_LEN + 1]; /* fcn name */ #define MAX_NAME_LEN 80 typedef char NAME[MAX_NAME_LEN + 1]; /* fcn call list */ typedef struct CELL *LIST; typedef struct CELL { NAME name; LIST calls, called_from, next; } CELL; /* Function prototypes. */ void build_graph(LIST *fcn_list, const char *filename); void insert_cell(LIST *list, const char *name); void delete_cell(LIST *list, const char *name); LIST find_cell(LIST list, const char *name); void print_calls(LIST list, const char *name, int depth, LIST *fcns); void print_all_calls(LIST list); void error(const char *message); int namecmp(const char *name1, const char *name2); /* End of File */