s502 assembler
A very simple assembler for the 6502 line of processors written in C
|
implement utility functions from util.h More...
#include "debugmalloc.h"
#include <string.h>
#include <stdlib.h>
#include "util.h"
#include "logging.h"
Go to the source code of this file.
Functions | |
char * | util_find_string_segment (char *ptr) |
find pointer to next space or null in string More... | |
int | util_match_char (char a, char b) |
Case-insensitive character compare. More... | |
int | util_match_string (char *first, char *second, int count) |
case-insensitive memcmp More... | |
char ** | util_split_string (char *str, int *n) |
split a string into segments on spaces More... | |
char* util_find_string_segment | ( | char * | ptr | ) |
int util_match_char | ( | char | a, |
char | b | ||
) |
Case-insensitive character compare.
a | first char to compare |
b | second char to compare |
Definition at line 21 of file util.c.
Referenced by Token::token_get_addressmode(), and util_match_string().
int util_match_string | ( | char * | first, |
char * | second, | ||
int | count | ||
) |
case-insensitive memcmp
count | how many bytes to match |
first | first string to compare |
second | second string to compare |
Definition at line 32 of file util.c.
References util_match_char().
Referenced by directive_compile(), and instruction_find().
char** util_split_string | ( | char * | str, |
int * | n | ||
) |
split a string into segments on spaces
str | string to split |
n | int pointer to return segment count to |
Uses a not-so-nice trick to enable easier handling
The returned *char[] also contains a buffer with the actual substring data
This also means simply freeing it is all what is needed to be done on the caller side
Definition at line 39 of file util.c.
Referenced by compile_data(), and compile_pad().