| IDA SDK

Functions
Segment comments
Segments

## Detailed Description

Segment comments are rarely used yet.

The user may define a segment comment by pressing ':' while standing on the segment name at the segment start.

The main advantage of segment comments compared to anterior lines (see lines.hpp) is that they are attached to a segment, not to an address and they will move with the start of segment if the segment boundaries change.

You may set segment comments in your LDR module to describe characteristics of a segment in comments.

Repeatable segment comments are not used at all, because I don't know where they should be repeated.

## Functions
idaman ssize_t ida_export | get_segment_cmt (qstring *buf, const segment_t *s, bool repeatable)
| Get segment comment. More...
idaman void ida_export | set_segment_cmt (const segment_t *s, const char *cmt, bool repeatable)
| Set segment comment. More...
idaman void ida_export | std_out_segm_footer (struct outctx_t &ctx, segment_t *seg)
| Generate segment footer line as a comment line. More...

## Function Documentation

## ◆ get_segment_cmt()

idaman ssize_t ida_export get_segment_cmt | ( | qstring * | buf,
|  | const segment_t * | s,
|  | bool | repeatable
| ) |  |

Get segment comment.

Parameters

  buf | buffer for the comment
  s | pointer to segment structure
  repeatable | 0: get regular comment. 1: get repeatable comment.

Returns
  size of comment or -1

## ◆ set_segment_cmt()

idaman void ida_export set_segment_cmt | ( | const segment_t * | s,
|  | const char * | cmt,
|  | bool | repeatable
| ) |  |

Set segment comment.

Parameters

  s | pointer to segment structure
  cmt | comment string, may be multiline (with ' '). maximal size is 4096 bytes. Use empty str ("") to delete comment
  repeatable | 0: set regular comment. 1: set repeatable comment.

## ◆ std_out_segm_footer()

idaman void ida_export std_out_segm_footer | ( | struct outctx_t & | ctx,
|  | segment_t * | seg
| ) |  |

Generate segment footer line as a comment line.

This function may be used in IDP modules to generate segment footer if the target assembler doesn't have 'ends' directive.