IDA C++ SDK 9.2
Loading...
Searching...
No Matches
srclang.hpp File Reference

Third-party compiler support. More...

Go to the source code of this file.

Typedefs

typedef int srclang_t
 Bitmask that describes all source languages supported by a compiler. Combination of Source language IDs values.

Functions

idaman bool ida_export select_parser_by_name (const char *name)
 Set the parser with the given name as the current parser.
idaman bool ida_export select_parser_by_srclang (srclang_t lang)
 Set the parser that supports the given language(s) as the current parser.
idaman bool ida_export get_selected_parser_name (qstring *out)
 Get current parser name.
idaman int ida_export set_parser_argv (const char *parser_name, const char *argv)
 Set the command-line args to use for invocations of the parser with the given name.
idaman int ida_export parse_decls_for_srclang (srclang_t lang, til_t *til, const char *input, bool is_path)
 Parse type declarations in the specified language.
idaman int ida_export parse_decls_with_parser_ext (const char *parser_name, til_t *til, const char *input, int hti_flags)
 Parse type declarations using the parser with the specified name.
idaman bool ida_export get_parser_option (qstring *out, const char *parser_name, const char *option_name)
 Get option for the parser with the specified name.
idaman bool ida_export set_parser_option (const char *parser_name, const char *option_name, const char *option_value)
 Set option for the parser with the specified name.
idaman int ida_export parse_decls_with_parser (const char *parser_name, til_t *til, const char *input, bool is_path)
 Parse type declarations using the parser with the specified name.

Detailed Description

Third-party compiler support.

Typedef Documentation

◆ srclang_t

typedef int srclang_t

Bitmask that describes all source languages supported by a compiler. Combination of Source language IDs values.

Function Documentation

◆ select_parser_by_name()

idaman bool ida_export select_parser_by_name ( const char * name)

Set the parser with the given name as the current parser.

Pass nullptr or an empty string to select the default parser.

Returns
false if no parser was found with the given name

◆ select_parser_by_srclang()

idaman bool ida_export select_parser_by_srclang ( srclang_t lang)

Set the parser that supports the given language(s) as the current parser.

The selected parser must support all languages specified by the given srclang_t.

Returns
false if no such parser was found

◆ get_selected_parser_name()

idaman bool ida_export get_selected_parser_name ( qstring * out)

Get current parser name.

Parameters
[out]outthe current (selected) parser name, is empty for default parser
Returns
success

◆ set_parser_argv()

idaman int ida_export set_parser_argv ( const char * parser_name,
const char * argv )

Set the command-line args to use for invocations of the parser with the given name.

Parameters
parser_namename of the target parser
argvargument list
Return values
-1no parser was found with the given name
-2the operation is not supported by the given parser
0success

◆ parse_decls_for_srclang()

idaman int ida_export parse_decls_for_srclang ( srclang_t lang,
til_t * til,
const char * input,
bool is_path )

Parse type declarations in the specified language.

Parameters
langthe source language(s) expected in the input
tiltype library to store the types
inputinput source. can be a file path or decl string
is_pathtrue if input parameter is a path to a source file, false if the input is an in-memory source snippet
Return values
-1no parser was found that supports the given source language(s)
elsethe number of errors encountered in the input source

◆ parse_decls_with_parser_ext()

idaman int ida_export parse_decls_with_parser_ext ( const char * parser_name,
til_t * til,
const char * input,
int hti_flags )

Parse type declarations using the parser with the specified name.

Parameters
parser_namename of the target parser
tiltype library to store the types
inputinput source. can be a file path or decl string
hti_flagscombination of Type formatting flags
Return values
-1no parser was found with the given name
elsethe number of errors encountered in the input source

◆ get_parser_option()

idaman bool ida_export get_parser_option ( qstring * out,
const char * parser_name,
const char * option_name )

Get option for the parser with the specified name.

Parameters
[out]outparser option value
parser_namename of the target parser
option_nameparser option name
Returns
success

◆ set_parser_option()

idaman bool ida_export set_parser_option ( const char * parser_name,
const char * option_name,
const char * option_value )

Set option for the parser with the specified name.

Parameters
parser_namename of the target parser
option_nameparser option name
option_valueparser option value
Returns
success
Note
For boolean option use "on"/"off"

◆ parse_decls_with_parser()

idaman int ida_export parse_decls_with_parser ( const char * parser_name,
til_t * til,
const char * input,
bool is_path )

Parse type declarations using the parser with the specified name.

Parameters
parser_namename of the target parser
tiltype library to store the types
inputinput source. can be a file path or decl string
is_pathtrue if input parameter is a path to a source file, false if the input is an in-memory source snippet
Return values
-1no parser was found with the given name
elsethe number of errors encountered in the input source