Higher level convenience functions are defined in ua.hpp.
Please use the following functions only if functions from ua.hpp are not useful in your case.
Insert an address mark into a string.
- Parameters
-
buf | pointer to the output buffer; the tag will be appended or inserted into it |
ea | address to include |
ins | if true, the tag will be inserted at the beginning of the buffer |
Move pointer to a 'line' to 'cnt' positions right.
Take into account escape sequences.
- Parameters
-
line | pointer to string |
cnt | number of positions to move right |
- Returns
- moved pointer
Move the pointer past all color codes.
- Parameters
-
- Returns
- moved pointer, can't be NULL
Skip one color code.
This function should be used if you are interested in color codes and want to analyze all of them. Otherwise tag_skipcodes() function is better since it will skip all colors at once. This function will skip the current color code if there is one. If the current symbol is not a color code, it will return the input.
- Returns
- moved pointer
Calculate length of a colored string This function computes the length in unicode codepoints of a line.
- Returns
- the number of codepoints in the line, or -1 on error
Remove color escape sequences from a string.
- Parameters
-
buf | output buffer with the string, can not be NULL. |
str | input string, can not be NULL. |
init_level | used to verify that COLOR_ON and COLOR_OFF tags are balanced |
- Returns
- length of resulting string, -1 if error