IDA SDK

- Main Page
- Header Files
- Classes
- Modules

Functions
Convenience functions
Color definitions

## Detailed Description

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.

## Functions
idaman char *ida_export | tag_on (char *ptr, char *end, color_t tag)
| Append 'turn on color' sequence to a string. More...
idaman char *ida_export | tag_off (char *ptr, char *end, color_t tag)
| Append 'turn off color' sequence to a string. More...
idaman char *ida_export | tag_addchr (char *ptr, char *end, color_t tag, char chr)
| Append a colored character to a string. More...
idaman char *ida_export | tag_addstr (char *ptr, char *end, color_t tag, const char *string)
| Append a colored substring to a string. More...
idaman char *ida_export | tag_addr (char *ptr, char *end, ea_t ea)
| Append an address mark to a string. More...
idaman const char *ida_export | tag_advance (const char *line, int cnt)
| Move pointer to a 'line' to 'cnt' positions right. More...
idaman const char *ida_export | tag_skipcodes (const char *line)
| Move the pointer past all color codes. More...
idaman const char *ida_export | tag_skipcode (const char *line)
| Skip one color code. More...
idaman ssize_t ida_export | tag_strlen (const char *line)
| Calculate length of a colored string. More...
idaman ssize_t ida_export | tag_remove (const char *instr, char *buf, size_t bufsize)
| Remove color escape sequences from a string. More...

## Function Documentation

idaman char* ida_export tag_on | ( | char * | ptr,
|  | char * | end,
|  | color_t | tag
| ) |  |

Append 'turn on color' sequence to a string.

Parameters

  ptr | pointer to the output buffer
  end | pointer to the end of the buffer
  tag | one of Color tags

Returns
  ptr to end of string

idaman char* ida_export tag_off | ( | char * | ptr,
|  | char * | end,
|  | color_t | tag
| ) |  |

Append 'turn off color' sequence to a string.

Parameters

  ptr | pointer to the output buffer
  end | pointer to the end of the buffer
  tag | one of Color tags

Returns
  ptr to end of string

idaman char* ida_export tag_addchr | ( | char * | ptr,
|  | char * | end,
|  | color_t | tag,
|  | char | chr
| ) |  |

Append a colored character to a string.

Parameters

  ptr | pointer to the output buffer
  end | pointer to the end of the buffer
  tag | one of Color tags
  chr | character to append

Returns
  ptr to end of string

idaman char* ida_export tag_addstr | ( | char * | ptr,
|  | char * | end,
|  | color_t | tag,
|  | const char * | string
| ) |  |

Append a colored substring to a string.

Parameters

  ptr | pointer to the output buffer
  end | pointer to the end of the buffer
  tag | one of Color tags
  string | substring to append

Returns
  ptr to end of string

idaman char* ida_export tag_addr | ( | char * | ptr,
|  | char * | end,
|  | ea_t | ea
| ) |  |

Append an address mark to a string.

Parameters

  ptr | pointer to the output buffer
  end | pointer to the end of the buffer
  ea | address to include

Returns
  ptr to end of string

idaman const char* ida_export tag_advance | ( | const char * | line,
|  | int | cnt
| ) |  |

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

idaman const char* ida_export tag_skipcodes | ( | const char * | line | ) |

Move the pointer past all color codes.

Parameters

  line | can't be NULL

Returns
  moved pointer, can't be NULL

idaman const char* ida_export tag_skipcode | ( | const char * | line | ) |

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

idaman ssize_t ida_export tag_strlen | ( | const char * | line | ) |

Calculate length of a colored string.

Returns
  -1 if error

idaman ssize_t ida_export tag_remove | ( | const char * | instr,
|  | char * | buf,
|  | size_t | bufsize
| ) |  |

Remove color escape sequences from a string.

Input and output buffer may be the same.

Parameters

  instr | input colored string.
  buf | output buffer. if == NULL, then return -1.
  bufsize | size of output buffer.

Note
  passing 0 as bufsize parameter is now deprecated.

Returns
  length of resulting string, -1 if error