IDA C++ SDK 9.2
Loading...
Searching...
No Matches
config.hpp
Go to the documentation of this file.
1/*
2 * Interactive disassembler (IDA).
3 * Copyright (c) 1990-2025 Hex-Rays
4 * ALL RIGHTS RESERVED.
5 *
6 */
7
8#ifndef _CONFIG_HPP
9#define _CONFIG_HPP
10
11//-----------------------------------------------------------------------
15#define IDPOPT_STR 1
16#define IDPOPT_NUM 2
17#define IDPOPT_BIT 3
18#define IDPOPT_I64 5
19#define IDPOPT_CST 6
39#define IDPOPT_JVL 7
41
45#define IDPOPT_OK nullptr
46#define IDPOPT_BADKEY ((char*)1)
47#define IDPOPT_BADTYPE ((char*)2)
48#define IDPOPT_BADVALUE ((char*)3)
50
51
60
61typedef const char *(idaapi set_options_t)(
62 const char *keyword,
63 int value_type,
64 const void *value,
65 bool idb_loaded);
66
76#define IDPOPT_PRI_DEFAULT 1
77#define IDPOPT_PRI_HIGH 2
79
80
81//-------------------------------------------------------------------------
98class lexer_t;
99struct token_t;
100class idc_value_t;
101idaman bool ida_export parse_config_value(
102 idc_value_t *out,
103 lexer_t *lx,
104 const token_t &value);
105
106//-------------------------------------------------------------------------
107typedef const char *(idaapi cfgopt_handler_t)(
108 lexer_t *lx,
109 const token_t &keyword,
110 const token_t &value);
111
112//-------------------------------------------------------------------------
113typedef const char *(idaapi cfgopt_handler2_t)(
114 lexer_t *lx,
115 const token_t &keyword,
116 const token_t &value,
117 int64 param1,
118 int64 param2);
119
120//-------------------------------------------------------------------------
121typedef const char *(idaapi cfgopt_handler3_t)(
122 lexer_t *lx,
123 const token_t &keyword,
124 const token_t &value,
125 int64 param1,
126 int64 param2,
127 void *obj);
128
129//-----------------------------------------------------------------------
131#define IDPOPT_NUM_INT (0)
132#define IDPOPT_NUM_CHAR (1 << 24)
133#define IDPOPT_NUM_SHORT (2 << 24)
134#define IDPOPT_NUM_RANGE (1 << 26)
135#define IDPOPT_NUM_UNS (1 << 27)
136
137#define IDPOPT_BIT_UINT 0
138#define IDPOPT_BIT_UCHAR (1 << 24)
139#define IDPOPT_BIT_USHORT (2 << 24)
140#define IDPOPT_BIT_BOOL (3 << 24)
141
142#define IDPOPT_STR_QSTRING (1 << 24)
143#define IDPOPT_STR_LONG (1 << 25)
144
145#define IDPOPT_I64_RANGE (1 << 24)
146#define IDPOPT_I64_UNS (1 << 25)
147
148#define IDPOPT_CST_PARAMS (1 << 24)
149
150#define IDPOPT_MBROFF (1 << 18)
151
152//-------------------------------------------------------------------------
153struct cfgopt_t;
154idaman const char *ida_export cfgopt_t__apply(
155 const cfgopt_t *_this,
156 int vtype,
157 const void *vdata);
158idaman const char *ida_export cfgopt_t__apply2(
159 const cfgopt_t *_this,
160 int vtype,
161 const void *vdata,
162 void *obj);
163idaman const char *ida_export cfgopt_t__apply3(
164 const cfgopt_t *_this,
165 lexer_t *lx,
166 int vtype,
167 const void *vdata,
168 void *obj);
169
170struct jvalue_t;
171//-------------------------------------------------------------------------
172// cfgopt_t objects are suitable for being statically initialized, and
173// passed to 'read_config_file'.
174//
175// E.g.,
176// ---
177// static const cfgopt_t g_opts[] =
178// {
179// cfgopt_t("AUTO_UNDEFINE", &auto_undefine, -1, 1),
180// cfgopt_t("NOVICE", &novice, true),
181// cfgopt_t("EDITOR", editor_buf, sizeof(editor_buf)),
182// cfgopt_t("SCREEN_PALETTE", set_screen_palette), // specific handler for SCREEN_PALETTE
183// };
184//
185// ...
186//
187// read_config_file("myfile", g_opts, qnumber(g_opts), other_handler)
188// ---
189//
190// NOTES:
191// * so-called 'long' strings (the default) can span on multiple lines,
192// and are terminated by a ';'
194{
195 const char *name;
196 union
197 {
198 void *ptr;
199 size_t mbroff; // offset of a structure member
200 cfgopt_handler_t *hnd; // to avoid reinterpret_cast and gcc's error:
201 cfgopt_handler2_t *hnd2; // "a reinterpret_cast is not a constant expression"
203 };
204 int flags;
206 {
207 constexpr num_range_t(int64 _min, int64 _max) : minval(_min), maxval(_max) {}
210 };
211 struct params_t
212 {
213 constexpr params_t(int64 _p1, int64 _p2) : p1(_p1), p2(_p2) {}
216 };
217 union
218 {
219 size_t buf_size;
224 };
225
226 // IDPOPT_STR
227 constexpr cfgopt_t(const char *_n, char *_p, size_t _sz, bool _long = true)
228 : name(_n), ptr(_p), flags(IDPOPT_STR | (_long ? IDPOPT_STR_LONG : 0)), buf_size(_sz)
229 {}
230 constexpr cfgopt_t(const char *_n, qstring *_p, bool _long = true)
231 : name(_n), ptr(_p), flags(IDPOPT_STR | IDPOPT_STR_QSTRING | (_long ? IDPOPT_STR_LONG : 0)), buf_size(0)
232 {}
233
234 // IDPOPT_NUM
235 constexpr cfgopt_t(const char *_n, int *_p)
236 : name(_n), ptr(_p), flags(IDPOPT_NUM), buf_size(0) {}
237 constexpr cfgopt_t(const char *_n, uint *_p)
238 : name(_n), ptr(_p), flags(IDPOPT_NUM | IDPOPT_NUM_UNS), buf_size(0) {}
239 constexpr cfgopt_t(const char *_n, char *_p)
240 : name(_n), ptr(_p), flags(IDPOPT_NUM | IDPOPT_NUM_CHAR), buf_size(0) {}
241 constexpr cfgopt_t(const char *_n, uchar *_p)
242 : name(_n), ptr(_p), flags(IDPOPT_NUM | IDPOPT_NUM_UNS | IDPOPT_NUM_CHAR), buf_size(0) {}
243 constexpr cfgopt_t(const char *_n, short *_p)
244 : name(_n), ptr(_p), flags(IDPOPT_NUM | IDPOPT_NUM_SHORT), buf_size(0) {}
245 constexpr cfgopt_t(const char *_n, ushort *_p)
246 : name(_n), ptr(_p), flags(IDPOPT_NUM | IDPOPT_NUM_UNS | IDPOPT_NUM_SHORT), buf_size(0) {}
247 // IDPOPT_NUM + ranges
248 constexpr cfgopt_t(const char *_n, int *_p, int _min, int _max)
249 : name(_n), ptr(_p), flags(IDPOPT_NUM | IDPOPT_NUM_RANGE), num_range(_min, _max) {}
250 constexpr cfgopt_t(const char *_n, uint *_p, uint _min, uint _max)
251 : name(_n), ptr(_p), flags(IDPOPT_NUM | IDPOPT_NUM_UNS | IDPOPT_NUM_RANGE), num_range(_min, _max) {}
252 constexpr cfgopt_t(const char *_n, char *_p, char _min, char _max)
253 : name(_n), ptr(_p), flags(IDPOPT_NUM | IDPOPT_NUM_CHAR | IDPOPT_NUM_RANGE), num_range(_min, _max) {}
254 constexpr cfgopt_t(const char *_n, uchar *_p, uchar _min, uchar _max)
255 : name(_n), ptr(_p), flags(IDPOPT_NUM | IDPOPT_NUM_UNS | IDPOPT_NUM_CHAR | IDPOPT_NUM_RANGE), num_range(_min, _max) {}
256 constexpr cfgopt_t(const char *_n, short *_p, short _min, short _max)
257 : name(_n), ptr(_p), flags(IDPOPT_NUM | IDPOPT_NUM_RANGE | IDPOPT_NUM_SHORT), num_range(_min, _max) {}
258 constexpr cfgopt_t(const char *_n, ushort *_p, ushort _min, ushort _max)
259 : name(_n), ptr(_p), flags(IDPOPT_NUM | IDPOPT_NUM_UNS | IDPOPT_NUM_RANGE | IDPOPT_NUM_SHORT), num_range(_min, _max) {}
260
261 // IDPOPT_BIT
262 constexpr cfgopt_t(const char *_n, bool *_p, bool _flags) : name(_n), ptr(_p), flags(IDPOPT_BIT | IDPOPT_BIT_BOOL), bit_flags(_flags) {}
263 constexpr cfgopt_t(const char *_n, uchar *_p, uchar _flags) : name(_n), ptr(_p), flags(IDPOPT_BIT | IDPOPT_BIT_UCHAR), bit_flags(_flags) {}
264 constexpr cfgopt_t(const char *_n, ushort *_p, ushort _flags) : name(_n), ptr(_p), flags(IDPOPT_BIT | IDPOPT_BIT_USHORT), bit_flags(_flags) {}
265 constexpr cfgopt_t(const char *_n, uint32 *_p, uint32 _flags) : name(_n), ptr(_p), flags(IDPOPT_BIT), bit_flags(_flags) {}
266
267 // IDPOPT_I64
268 constexpr cfgopt_t(const char *_n, int64 *_p) : name(_n), ptr(_p), flags(IDPOPT_I64), buf_size(0) {}
269 constexpr cfgopt_t(const char *_n, uint64 *_p) : name(_n), ptr(_p), flags(IDPOPT_I64 | IDPOPT_NUM_UNS), buf_size(0) {}
270 // IDPOPT_I64 + ranges
271 constexpr cfgopt_t(const char *_n, int64 *_p, int64 _min, int64 _max)
272 : name(_n), ptr(_p), flags(IDPOPT_I64 | IDPOPT_I64_RANGE), num_range(_min, _max) {}
273 constexpr cfgopt_t(const char *_n, uint64 *_p, uint64 _min, uint64 _max)
274 : name(_n), ptr(_p), flags(IDPOPT_I64 | IDPOPT_I64_UNS | IDPOPT_I64_RANGE), num_range(int64(_min), int64(_max)) {}
275
276 // IDPOPT_CST
277 constexpr cfgopt_t(const char *_n, cfgopt_handler_t *_p)
278 : name(_n), hnd(_p), flags(IDPOPT_CST), buf_size(0) {}
279 // IDPOPT_CST + params
280 constexpr cfgopt_t(const char *_n, cfgopt_handler2_t *_p, int64 _p1=0, int64 _p2=0)
281 : name(_n), hnd2(_p), flags(IDPOPT_CST | IDPOPT_CST_PARAMS), params(_p1, _p2) {}
282
283 // IDPOPT_JVL
284 constexpr cfgopt_t(const char *_n, jvalue_t *_p)
285 : name(_n), ptr(_p), flags(IDPOPT_JVL), buf_size(0) {}
286
287 // configuration option based on the offset of a structure member
288
289 // IDPOPT_STR
290 template<class T>
291 constexpr cfgopt_t(const char *_n, qstring T:: *, size_t _mbroff, bool _long = true)
292 : name(_n),
293 mbroff(_mbroff),
294 flags(IDPOPT_MBROFF | IDPOPT_STR | IDPOPT_STR_QSTRING | (_long ? IDPOPT_STR_LONG : 0)),
295 buf_size(0)
296 {}
297#define CFGOPT_QS(nm, cfgt, cfgm, _long) \
298 cfgopt_t(nm, &cfgt::cfgm, qoffsetof(cfgt, cfgm), _long)
299
300#define CFGOPT_INNER_QS(nm, cfgt, cfgm, mt, mf, _long) \
301 cfgopt_t(nm, &mt::mf, qoffsetof(cfgt, cfgm) + qoffsetof(mt, mf), _long)
302
303 // IDPOPT_STR
304 template<class T>
305 constexpr cfgopt_t(const char *_n, char * T:: *, size_t _mbroff, bool _long = true)
306 : name(_n),
307 mbroff(_mbroff),
308 flags(IDPOPT_MBROFF | IDPOPT_STR | (_long ? IDPOPT_STR_LONG : 0)),
309 buf_size(0)
310 {}
311
312
313 // IDPOPT_NUM
314#define CTR_CFGOPT(ctrtype, ctrflags) \
315 template<class T> \
316 constexpr cfgopt_t(const char *_n, ctrtype T:: *, size_t _mbroff) \
317 : name(_n), \
318 mbroff(_mbroff), \
319 flags(IDPOPT_MBROFF|IDPOPT_NUM|ctrflags), \
320 buf_size(0) \
321 {}
323 CTR_CFGOPT(uint, IDPOPT_NUM_UNS)
324 CTR_CFGOPT(char, IDPOPT_NUM_CHAR)
325 CTR_CFGOPT(uchar, IDPOPT_NUM_UNS|IDPOPT_NUM_CHAR)
326 CTR_CFGOPT(short, IDPOPT_NUM_SHORT)
327 CTR_CFGOPT(ushort, IDPOPT_NUM_SHORT|IDPOPT_NUM_UNS)
328#undef CTR_CFGOPT
329
330#define CFGOPT_N(nm, cfgt, cfgm) \
331 cfgopt_t(nm, &cfgt::cfgm, qoffsetof(cfgt, cfgm))
332
333#define CFGOPT_INNER_N(nm, cfgt, cfgm, mt, mf) \
334 cfgopt_t(nm, &mt::mf, qoffsetof(cfgt, cfgm) + qoffsetof(mt, mf))
335
336
337 // IDPOPT_NUM + ranges
338#define CTR_CFGOPT(ctrtype, ctrflags) \
339 template<class T> \
340 constexpr cfgopt_t(const char *_n, ctrtype T:: *, size_t _mbroff, int64 _min, int64 _max) \
341 : name(_n), \
342 mbroff(_mbroff), \
343 flags(IDPOPT_MBROFF|IDPOPT_NUM|IDPOPT_NUM_RANGE|ctrflags), \
344 num_range(_min, _max) \
345 {}
347 CTR_CFGOPT(uint, IDPOPT_NUM_UNS)
348 CTR_CFGOPT(char, IDPOPT_NUM_CHAR)
349 CTR_CFGOPT(uchar, IDPOPT_NUM_UNS|IDPOPT_NUM_CHAR)
350 CTR_CFGOPT(short, IDPOPT_NUM_SHORT)
351 CTR_CFGOPT(ushort, IDPOPT_NUM_SHORT|IDPOPT_NUM_UNS)
352#undef CTR_CFGOPT
353
354#define CFGOPT_R(nm, cfgt, cfgm, min, max) \
355 cfgopt_t(nm, &cfgt::cfgm, qoffsetof(cfgt, cfgm), min, max)
356
357#define CFGOPT_INNER_R(nm, cfgt, cfgm, mt, mf, min, max) \
358 cfgopt_t(nm, &mt::mf, qoffsetof(cfgt, cfgm) + qoffsetof(mt, mf), min, max)
359
360
361 // IDPOPT_BIT
362#define CTR_CFGOPT(ctrtype, ctrflags) \
363 template<class T> \
364 constexpr cfgopt_t(const char *_n, ctrtype T:: *, size_t _mbroff, ctrtype _flags) \
365 : name(_n), \
366 mbroff(_mbroff), \
367 flags(IDPOPT_MBROFF|IDPOPT_BIT|ctrflags), \
368 bit_flags(_flags) \
369 {}
370 CTR_CFGOPT(bool, IDPOPT_BIT_BOOL);
371 CTR_CFGOPT(uchar, IDPOPT_BIT_UCHAR);
372 CTR_CFGOPT(ushort, IDPOPT_BIT_USHORT);
374#undef CTR_CFGOPT
375#define CFGOPT_B(nm, cfgt, cfgm, _flags) \
376 cfgopt_t(nm, &cfgt::cfgm, qoffsetof(cfgt, cfgm), _flags)
377
378#define CFGOPT_INNER_B(nm, cfgt, cfgm, mt, mf, _flags) \
379 cfgopt_t(nm, &mt::mf, qoffsetof(cfgt, cfgm) + qoffsetof(mt, mf), _flags)
380
381
382 // IDPOPT_I64
383 template<class T>
384 constexpr cfgopt_t(const char *_n, int64 T:: *, size_t _mbroff)
385 : name(_n),
386 mbroff(_mbroff),
387 flags(IDPOPT_MBROFF|IDPOPT_I64),
388 buf_size(0)
389 {}
390 template<class T>
391 constexpr cfgopt_t(const char *_n, uint64 T:: *, size_t _mbroff)
392 : name(_n),
393 mbroff(_mbroff),
394 flags(IDPOPT_MBROFF|IDPOPT_I64|IDPOPT_NUM_UNS),
395 buf_size(0)
396 {}
397
398 // IDPOPT_JVL
399 template<class T>
400 constexpr cfgopt_t(const char *_n, jvalue_t T:: *, size_t _mbroff)
401 : name(_n),
402 mbroff(_mbroff),
403 flags(IDPOPT_MBROFF | IDPOPT_JVL),
404 buf_size(0)
405 {}
406
407#define CFGOPT_J(nm, cfgt, cfgm) \
408 cfgopt_t(nm, &cfgt::cfgm, qoffsetof(cfgt, cfgm))
409
410 // IDPOPT_I64 + ranges
411 template<class T>
412 constexpr cfgopt_t(const char *_n, int64 T:: *, size_t _mbroff, int64 _min, int64 _max)
413 : name(_n),
414 mbroff(_mbroff),
415 flags(IDPOPT_MBROFF|IDPOPT_I64|IDPOPT_I64_RANGE),
416 num_range(_min, _max)
417 {}
418 template<class T>
419 constexpr cfgopt_t(const char *_n, uint64 T:: *, size_t _mbroff, uint64 _min, uint64 _max)
420 : name(_n),
421 mbroff(_mbroff),
422 flags(IDPOPT_MBROFF|IDPOPT_I64|IDPOPT_I64_UNS|IDPOPT_I64_RANGE),
423 num_range(int64(_min), int64(_max))
424 {}
425
426 // IDPOPT_CST + params
427 constexpr cfgopt_t(const char *_n, cfgopt_handler3_t *_p, int64 _p1=0, int64 _p2=0)
428 : name(_n), hnd3(_p), flags(IDPOPT_MBROFF|IDPOPT_CST), params(_p1, _p2) {}
429
430 int type() const { return flags & 0xf; }
431 int qualifier() const { return flags & 0xf000000; }
432 bool is_mbroff() const { return (flags & IDPOPT_MBROFF) != 0; }
434 int64 *out,
435 lexer_t *lx,
436 const token_t &_t,
437 int range_bit,
438 int usign_bit) const;
439 const char *apply(int vtype, const void *vdata, void *obj=nullptr) const
440 {
441 return cfgopt_t__apply3(this, nullptr, vtype, vdata, obj);
442 }
443 const char *apply(lexer_t *lx, int vtype, const void *vdata, void *obj=nullptr) const
444 {
445 return cfgopt_t__apply3(this, lx, vtype, vdata, obj);
446 }
447};
448
455
475
476idaman bool ida_export read_config(
477 const char *input,
478 cfg_input_kind_t input_kind,
479 const cfgopt_t opts[],
480 size_t nopts,
481 cfgopt_handler_t *defhdlr,
482 const char *const *defines = nullptr,
483 size_t ndefines = 0);
484
485idaman bool ida_export read_config2(
486 const char *input,
487 cfg_input_kind_t input_kind,
488 const cfgopt_t opts[],
489 size_t nopts,
490 cfgopt_handler_t *defhdlr,
491 const char *const *defines = nullptr,
492 size_t ndefines = 0,
493 void *obj = nullptr);
494
496 const char *filename,
497 const cfgopt_t opts[],
498 size_t nopts,
499 cfgopt_handler_t *defhdlr,
500 const char *const *defines = nullptr,
501 size_t ndefines = 0,
502 void *obj = nullptr)
503{
504 return read_config2(filename, cik_filename, opts, nopts, defhdlr, defines, ndefines, obj);
505}
506
514
516 const char *filename,
517 const cfgopt_t opts[],
518 size_t nopts,
519 cfgopt_handler_t *defhdlr,
520 const char *const *defines = nullptr,
521 size_t ndefines = 0)
522{
523 return read_config(filename, cik_filename, opts, nopts, defhdlr, defines, ndefines);
524}
525
526
530 const char *string,
531 const cfgopt_t opts[],
532 size_t nopts,
533 cfgopt_handler_t *defhdlr,
534 const char *const *defines = nullptr,
535 size_t ndefines = 0)
536{
537 return read_config(string, cik_string, opts, nopts, defhdlr, defines, ndefines);
538}
539
540
541typedef void idaapi config_changed_cb_t(const cfgopt_t &opt, int vtype, const void *vdata);
542
552
553idaman bool ida_export register_cfgopts(
554 const cfgopt_t opts[],
555 size_t nopts,
556 config_changed_cb_t cb=nullptr,
557 void *obj=nullptr);
558
563
564idaman bool ida_export get_config_value(jvalue_t *out, const char *key);
565
566//-------------------------------------------------------------------------
567// A set of (static const) config options
569{
570 const cfgopt_t *opts = nullptr;
571 size_t nopts = 0;
573 void *obj = nullptr;
574};
576struct cfgopt_set_vec_t : public qvector<cfgopt_set_t> {};
577
578
579#endif // _CONFIG_HPP
Class to hold idc values.
Definition expr.hpp:315
idc_object_t * obj
Definition expr.hpp:341
qvector(void)
Definition pro.h:2328
idaman bool ida_export read_config2(const char *input, cfg_input_kind_t input_kind, const cfgopt_t opts[], size_t nopts, cfgopt_handler_t *defhdlr, const char *const *defines=nullptr, size_t ndefines=0, void *obj=nullptr)
idaman const char *ida_export cfgopt_t__apply(const cfgopt_t *_this, int vtype, const void *vdata)
bool read_config_file2(const char *filename, const cfgopt_t opts[], size_t nopts, cfgopt_handler_t *defhdlr, const char *const *defines=nullptr, size_t ndefines=0, void *obj=nullptr)
Definition config.hpp:495
bool read_config_string(const char *string, const cfgopt_t opts[], size_t nopts, cfgopt_handler_t *defhdlr, const char *const *defines=nullptr, size_t ndefines=0)
For each directive in 'string', the same processing as that of read_config will be performed.
Definition config.hpp:529
idaman const char *ida_export cfgopt_t__apply2(const cfgopt_t *_this, int vtype, const void *vdata, void *obj)
cfg_input_kind_t
Definition config.hpp:450
@ cik_string
Definition config.hpp:451
@ cik_filename
Definition config.hpp:452
@ cik_path
Definition config.hpp:453
const char *idaapi cfgopt_handler2_t(lexer_t *lx, const token_t &keyword, const token_t &value, int64 param1, int64 param2)
Definition config.hpp:113
const char *idaapi cfgopt_handler3_t(lexer_t *lx, const token_t &keyword, const token_t &value, int64 param1, int64 param2, void *obj)
Definition config.hpp:121
idaman const char *ida_export cfgopt_t__apply3(const cfgopt_t *_this, lexer_t *lx, int vtype, const void *vdata, void *obj)
bool read_config_file(const char *filename, const cfgopt_t opts[], size_t nopts, cfgopt_handler_t *defhdlr, const char *const *defines=nullptr, size_t ndefines=0)
Search for all IDA system files with the given name.
Definition config.hpp:515
DECLARE_TYPE_AS_MOVABLE(cfgopt_set_t)
idaman bool ida_export register_cfgopts(const cfgopt_t opts[], size_t nopts, config_changed_cb_t cb=nullptr, void *obj=nullptr)
Register array of config options.
idaman bool ida_export parse_config_value(idc_value_t *out, lexer_t *lx, const token_t &value)
idaman bool ida_export read_config(const char *input, cfg_input_kind_t input_kind, const cfgopt_t opts[], size_t nopts, cfgopt_handler_t *defhdlr, const char *const *defines=nullptr, size_t ndefines=0)
Parse the input, and apply options.
const char *idaapi set_options_t(const char *keyword, int value_type, const void *value, bool idb_loaded)
Callback - called when a config directive is processed in IDA.
Definition config.hpp:61
const char *idaapi cfgopt_handler_t(lexer_t *lx, const token_t &keyword, const token_t &value)
Definition config.hpp:107
void idaapi config_changed_cb_t(const cfgopt_t &opt, int vtype, const void *vdata)
Definition config.hpp:541
idaman bool ida_export get_config_value(jvalue_t *out, const char *key)
Get json value from ida.cfg.
unsigned __int64 uint64
Definition llong.hpp:13
__int64 int64
Definition llong.hpp:14
unsigned int uint32
unsigned 32 bit value
Definition pro.h:348
unsigned char uchar
unsigned 8 bit value
Definition pro.h:337
unsigned int uint
unsigned 32 bit value
Definition pro.h:339
unsigned short ushort
unsigned 16 bit value
Definition pro.h:338
_qstring< char > qstring
regular string
Definition pro.h:3694
Definition config.hpp:569
void * obj
Definition config.hpp:573
config_changed_cb_t * cb
Definition config.hpp:572
const cfgopt_t * opts
Definition config.hpp:570
size_t nopts
Definition config.hpp:571
Definition config.hpp:576
Definition config.hpp:206
int64 maxval
Definition config.hpp:209
constexpr num_range_t(int64 _min, int64 _max)
Definition config.hpp:207
int64 minval
Definition config.hpp:208
Definition config.hpp:212
int64 p1
Definition config.hpp:214
constexpr params_t(int64 _p1, int64 _p2)
Definition config.hpp:213
int64 p2
Definition config.hpp:215
Definition config.hpp:194
constexpr cfgopt_t(const char *_n, jvalue_t T::*, size_t _mbroff)
Definition config.hpp:400
constexpr cfgopt_t(const char *_n, qstring T::*, size_t _mbroff, bool _long=true)
Definition config.hpp:291
constexpr cfgopt_t(const char *_n, int *_p, int _min, int _max)
Definition config.hpp:248
constexpr cfgopt_t(const char *_n, uint *_p)
Definition config.hpp:237
bool is_mbroff() const
Definition config.hpp:432
size_t mbroff
Definition config.hpp:199
constexpr cfgopt_t(const char *_n, uint *_p, uint _min, uint _max)
Definition config.hpp:250
constexpr cfgopt_t(const char *_n, int64 *_p)
Definition config.hpp:268
constexpr cfgopt_t(const char *_n, int64 *_p, int64 _min, int64 _max)
Definition config.hpp:271
constexpr cfgopt_t(const char *_n, bool *_p, bool _flags)
Definition config.hpp:262
constexpr cfgopt_t(const char *_n, ushort *_p, ushort _min, ushort _max)
Definition config.hpp:258
constexpr cfgopt_t(const char *_n, jvalue_t *_p)
Definition config.hpp:284
constexpr cfgopt_t(const char *_n, short *_p)
Definition config.hpp:243
size_t buf_size
Definition config.hpp:219
CTR_CFGOPT(uchar, IDPOPT_BIT_UCHAR)
int type() const
Definition config.hpp:430
constexpr cfgopt_t(const char *_n, char *_p, char _min, char _max)
Definition config.hpp:252
bool get_number(int64 *out, lexer_t *lx, const token_t &_t, int range_bit, int usign_bit) const
cfgopt_handler2_t * hnd2
Definition config.hpp:201
constexpr cfgopt_t(const char *_n, qstring *_p, bool _long=true)
Definition config.hpp:230
constexpr cfgopt_t(const char *_n, int64 T::*, size_t _mbroff)
Definition config.hpp:384
const char * name
Definition config.hpp:195
constexpr cfgopt_t(const char *_n, uint64 *_p, uint64 _min, uint64 _max)
Definition config.hpp:273
constexpr cfgopt_t(const char *_n, uint64 T::*, size_t _mbroff)
Definition config.hpp:391
cfgopt_handler_t * hnd
Definition config.hpp:200
constexpr cfgopt_t(const char *_n, uchar *_p)
Definition config.hpp:241
constexpr cfgopt_t(const char *_n, cfgopt_handler3_t *_p, int64 _p1=0, int64 _p2=0)
Definition config.hpp:427
constexpr cfgopt_t(const char *_n, uint32 *_p, uint32 _flags)
Definition config.hpp:265
constexpr cfgopt_t(const char *_n, uchar *_p, uchar _min, uchar _max)
Definition config.hpp:254
params_t params
Definition config.hpp:222
constexpr cfgopt_t(const char *_n, char *_p)
Definition config.hpp:239
uint32 bit_flags
Definition config.hpp:221
CTR_CFGOPT(ushort, IDPOPT_BIT_USHORT)
constexpr cfgopt_t(const char *_n, uint64 *_p)
Definition config.hpp:269
constexpr cfgopt_t(const char *_n, short *_p, short _min, short _max)
Definition config.hpp:256
constexpr cfgopt_t(const char *_n, cfgopt_handler2_t *_p, int64 _p1=0, int64 _p2=0)
Definition config.hpp:280
cfgopt_handler3_t * hnd3
Definition config.hpp:202
constexpr cfgopt_t(const char *_n, uint64 T::*, size_t _mbroff, uint64 _min, uint64 _max)
Definition config.hpp:419
constexpr cfgopt_t(const char *_n, cfgopt_handler_t *_p)
Definition config.hpp:277
const char * apply(int vtype, const void *vdata, void *obj=nullptr) const
Definition config.hpp:439
int flags
Definition config.hpp:204
constexpr cfgopt_t(const char *_n, int64 T::*, size_t _mbroff, int64 _min, int64 _max)
Definition config.hpp:412
constexpr cfgopt_t(const char *_n, ushort *_p)
Definition config.hpp:245
constexpr cfgopt_t(const char *_n, ushort *_p, ushort _flags)
Definition config.hpp:264
void * ptr
Definition config.hpp:198
constexpr cfgopt_t(const char *_n, uchar *_p, uchar _flags)
Definition config.hpp:263
CTR_CFGOPT(bool, IDPOPT_BIT_BOOL)
CTR_CFGOPT(int, 0) CTR_CFGOPT(uint
const char * apply(lexer_t *lx, int vtype, const void *vdata, void *obj=nullptr) const
Definition config.hpp:443
constexpr cfgopt_t(const char *_n, int *_p)
Definition config.hpp:235
void * mbroff_obj
Definition config.hpp:223
constexpr cfgopt_t(const char *_n, char *_p, size_t _sz, bool _long=true)
Definition config.hpp:227
int qualifier() const
Definition config.hpp:431
constexpr cfgopt_t(const char *_n, char *T::*, size_t _mbroff, bool _long=true)
Definition config.hpp:305
CTR_CFGOPT(uint32, 0)
num_range_t num_range
Definition config.hpp:220
Parser token.
Definition lex.hpp:48