| IDA SDK

Functions
Segment classes and types
Segments

## Detailed Description

See Segment types.

## Functions
idaman ssize_t ida_export | get_segm_class (qstring *buf, const segment_t *s)
| Get segment class. More...
idaman int ida_export | set_segm_class (segment_t *s, const char *sclass, int flags=0)
| Set segment class. More...
idaman uchar ida_export | segtype (ea_t ea)
| Get segment type. More...

## Function Documentation

## ◆ get_segm_class()

idaman ssize_t ida_export get_segm_class | ( | qstring * | buf,
|  | const segment_t * | s
| ) |  |

Get segment class.

Segment class is arbitrary text (max 8 characters).

Parameters

  buf | output buffer. cannot be nullptr.
  s | pointer to segment

Returns
  size of segment class (-1 if s==nullptr or bufsize<=0)

## ◆ set_segm_class()

idaman int ida_export set_segm_class | ( | segment_t * | s,
|  | const char * | sclass,
|  | int | flags = `0`
| ) |  |

Set segment class.

Parameters

  s | pointer to segment (may be nullptr)
  sclass | segment class (may be nullptr). If segment type is SEG_NORM and segment class is one of predefined names, then segment type is changed to: "CODE" -> SEG_CODE "DATA" -> SEG_DATA "STACK" -> SEG_BSS "BSS" -> SEG_BSS if "UNK" then segment type is reset to SEG_NORM.
  flags | Add segment flags

Return values

  1 | ok, name is good and segment is renamed
  0 | failure, name is nullptr or bad or segment is nullptr

## ◆ segtype()

idaman uchar ida_export segtype | ( | ea_t | ea | ) |

Get segment type.

Parameters

  ea | any linear address within the segment

Returns
  Segment types, SEG_UNDF if no segment found at 'ea'