ScalpiEditor

Diff
Login

Diff

Differences From Artifact [a33f48795f]:

To Artifact [f26c9ff418]:


57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86

87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231











232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
                zig idiomatic:      if (link) |_| i += 1;
                zig but C pointer:  if (@intFromPtr(link) != @intFromPtr(c.NULL)) i += 1;
    */
// TODO
    /*
        remove name buffer_len. use buffer_max_size and buffer_used instead.
    */
// macro
    // enums
        // compilation target
            // os
                #define __TargetOs_windows__ 1
                #define __TargetOs_linux__   2
            // memory type
                #define __TargetMemoryType_endiansLittle__  1
                #define __TargetMemoryType_endiansBig__     2
        // lib
            // # __MemTree_fix_counts_Action__
                #define __MemTree_fix_counts_Action_plus__  'p'
                #define __MemTree_fix_counts_Action_minus__ 'm'
            // # __MemTree_fix_nested_Action__
                #define __MemTree_fix_nested_Action_plus__  'p'
                #define __MemTree_fix_nested_Action_minus__ 'm'
        // # __OsNetworkTcpSocketConnectResult__ (char)
            #define __OsNetworkTcpSocketConnectResult_error__      -1
            #define __OsNetworkTcpSocketConnectResult_inProgress__  0
            #define __OsNetworkTcpSocketConnectResult_success__     1
        // __LoggerWriters__
            #define __LoggerWriter_toFallback__  0
            #define __LoggerWriter_toFile__      1

            #define __LoggerWriter_toConsole__   2
            #define __LoggerWriter_toTerminal__  3
    // settings
        // platform
            // target
                // # __target_os__
                    //#define __target_os__  __TargetOs_linux__
                    #ifndef __target_os__
                        #ifdef _WIN32
                            #define __target_os__  __TargetOs_windows__
                        #elif defined(__linux__)
                            #define __target_os__  __TargetOs_linux__
                        #endif
                    #endif
                #define __target_memoryType__ __TargetMemoryType_endiansLittle__
            #define __OsFilePathLen_max__              1024
            #define __with_network__                      0
            #define __OsNetworkTcp_maxClientCount__       8
            #define __OsNetworkTcpHttp_maxHeaders__      48
            #define __TerminalInput_size__               32
        // __App__
            #define __AppEditorViewsEasyMotionHorizontal_step__  3
            #define __AppEditorViewsEasyMotionVertical_step__    2
            #define __App_expectedFps__                          30
            #define __AppEditorLineLen_max__                     (1024 * 8)
            // AppEditorTheme
                #define __AppEditorTheme_folded__ \ 
                    __ConsoleAnsiOutputFontStyle_start__ \
                    __ConsoleAnsiOutputFontStyle_bold__ \
                    __ConsoleAnsiOutputFontStyle_sep__ \
                    __ConsoleAnsiOutputFontStyle_bg_color_zero__ \
                    __ConsoleAnsiOutputFontStyle_sep__ \
                    __ConsoleAnsiOutputFontStyle_color_zero__ \
                    __ConsoleAnsiOutputFontStyle_end__
                #define __AppEditorTheme_folded_arrows__ \
                    __ConsoleAnsiOutputFontStyle_start__ \
                    __ConsoleAnsiOutputFontStyle_bold__ \
                    __ConsoleAnsiOutputFontStyle_sep__ \
                    __ConsoleAnsiOutputFontStyle_bg_color_gray__ \
                    __ConsoleAnsiOutputFontStyle_sep__ \
                    __ConsoleAnsiOutputFontStyle_color_yellow__ \
                    __ConsoleAnsiOutputFontStyle_end__
                #define __AppEditorTheme_current_folded__ \
                    __ConsoleAnsiOutputFontStyle_start__ \
                    __ConsoleAnsiOutputFontStyle_bold__ \
                    __ConsoleAnsiOutputFontStyle_sep__ \
                    __ConsoleAnsiOutputFontStyle_bg_color_zero__ \
                    __ConsoleAnsiOutputFontStyle_sep__ \
                    __ConsoleAnsiOutputFontStyle_color_light_green__ \
                    __ConsoleAnsiOutputFontStyle_end__
                #define __AppEditorTheme_notification__ \
                    __ConsoleAnsiOutputFontStyle_start__ \
                    __ConsoleAnsiOutputFontStyle_bg_color_zero__ \
                    __ConsoleAnsiOutputFontStyle_sep__ \
                    __ConsoleAnsiOutputFontStyle_color_red__ \
                    __ConsoleAnsiOutputFontStyle_end__
                #define __AppEditorTheme_headers__ \
                    __ConsoleAnsiOutputFontStyle_start__ \
                    __ConsoleAnsiOutputFontStyle_bold__ \
                    __ConsoleAnsiOutputFontStyle_sep__ \
                    __ConsoleAnsiOutputFontStyle_bg_color_zero__ \
                    __ConsoleAnsiOutputFontStyle_sep__ \
                    __ConsoleAnsiOutputFontStyle_color_cyan__ \
                    __ConsoleAnsiOutputFontStyle_end__
                #define __AppEditorTheme_easy_motion__ \
                    __ConsoleAnsiOutputFontStyle_start__ \
                    __ConsoleAnsiOutputFontStyle_bg_color_zero__ \
                    __ConsoleAnsiOutputFontStyle_sep__ \
                    __ConsoleAnsiOutputFontStyle_color_yellow__ \
                    __ConsoleAnsiOutputFontStyle_end__
                #define __AppEditorTheme_disabled__ \
                    __ConsoleAnsiOutputFontStyle_start__  \
                    __ConsoleAnsiOutputFontStyle_bg_color_zero__  \
                    __ConsoleAnsiOutputFontStyle_sep__  \
                    __ConsoleAnsiOutputFontStyle_color_magenta__ \
                    __ConsoleAnsiOutputFontStyle_end__
                #define __AppEditorTheme_commentary__ \ 
                    __ConsoleAnsiOutputFontStyle_start__ \
                    __ConsoleAnsiOutputFontStyle_bg_color_zero__ \
                    __ConsoleAnsiOutputFontStyle_sep__ \
                    __ConsoleAnsiOutputFontStyle_color_yellow__ \
                    __ConsoleAnsiOutputFontStyle_end__
                #define __AppEditorTheme_current_disabled__ \
                    __ConsoleAnsiOutputFontStyle_start__             \
                    __ConsoleAnsiOutputFontStyle_bg_color_zero__     \
                    __ConsoleAnsiOutputFontStyle_sep__               \
                    __ConsoleAnsiOutputFontStyle_color_light_green__ \
                    __ConsoleAnsiOutputFontStyle_end__
                #define __AppEditorTheme_current_commentary__ \
                    __ConsoleAnsiOutputFontStyle_start__         \
                    __ConsoleAnsiOutputFontStyle_bg_color_zero__ \
                    __ConsoleAnsiOutputFontStyle_sep__           \
                    __ConsoleAnsiOutputFontStyle_color_yellow__  \
                    __ConsoleAnsiOutputFontStyle_end__
                #define __AppEditorTheme_current__ \
                    __ConsoleAnsiOutputFontStyle_start__             \
                    __ConsoleAnsiOutputFontStyle_bg_color_zero__     \
                    __ConsoleAnsiOutputFontStyle_sep__               \
                    __ConsoleAnsiOutputFontStyle_color_light_green__ \
                    __ConsoleAnsiOutputFontStyle_end__
                #define __AppEditorTheme_current_rune__ \
                    __ConsoleAnsiOutputFontStyle_start__         \
                    __ConsoleAnsiOutputFontStyle_bg_color_zero__ \ 
                    __ConsoleAnsiOutputFontStyle_sep__           \
                    __ConsoleAnsiOutputFontStyle_color_magenta__ \ 
                    __ConsoleAnsiOutputFontStyle_end__
                #define __AppEditorTheme_reset__  \
                    __ConsoleAnsiOutputFontStyle_start__         \
                    __ConsoleAnsiOutputFontStyle_reset__         \
                    __ConsoleAnsiOutputFontStyle_sep__           \
                    __ConsoleAnsiOutputFontStyle_bg_color_zero__ \
                    __ConsoleAnsiOutputFontStyle_sep__           \
                    __ConsoleAnsiOutputFontStyle_color_zero__    \
                    __ConsoleAnsiOutputFontStyle_end__
                #define __AppEditorTheme_arrows__ \
                    __ConsoleAnsiOutputFontStyle_start__ \
                    __ConsoleAnsiOutputFontStyle_unbold__ \
                    __ConsoleAnsiOutputFontStyle_sep__ \
                    __ConsoleAnsiOutputFontStyle_bg_color_zero__ \
                    __ConsoleAnsiOutputFontStyle_sep__ \
                    __ConsoleAnsiOutputFontStyle_color_yellow__ \
                    __ConsoleAnsiOutputFontStyle_end__
    // lib
        // c
            // breakpoint
                #if __target_os__ == __TargetOs_windows__
                    #define breakpoint() DebugBreak()                      
                #elif __target_os__ == __TargetOs_linux__
                    #define breakpoint() raise(SIGTRAP)                      
                #else
                    #error "__target_os__ not implemented"
                #endif
            #define or   ||
            #define and  &&
            #define __arrayLen__(                             array)                        (sizeof((array)) / sizeof((array[0])))
            #define __Addr_fromPtr__(                         ptr)                          ((uintptr_t)(ptr))
            #define __Instance_fromPtr__(                     ptr)                          (*(ptr))
            #define __Struct_getFieldOffset__(                type, field)                  (__Addr_fromPtr__(__TypedPtr_getFieldPtr__(__TypedPtr_virtual__(type), field)))
            #define __TypedPtr_fromAddr__(                    type, addr)                   ((type*)(addr))
            #define __TypedPtr_virtual__(                     type)                         (__TypedPtr_fromAddr__(type, 0)) 
            #define __TypedPtr_getFieldPtr__(                 ptr, field_name)              (&(ptr)->field_name)
            // # fieldParentPtr
            #define __TypedPtr_getParentPtrFromFieldPtr__(    type, field_name, field_ptr)  (__TypedPtr_fromAddr__(type, __Addr_fromPtr__((field_ptr)) - __Struct_getFieldOffset__(type, field_name)))
            #define __Type_getSize__(                         type)                         (__Struct_getFieldOffset__(struct {type t; char c;}, c))
            #define __Type_getAlign__(                        type)                         (__Struct_getFieldOffset__(struct {char c; type t;}, t))











        // mem
            #define KB_size 1024
            #define MB_size (1024 * KB_size)
            #define GB_size (1024 * MB_size)
            // # __Mem_nativeToBig__
                #if __target_memoryType__ == __TargetMemoryType_endiansBig__
                    #define __Mem_nativeToBig__(dest, src, size)    __Mem_copy__(dest, src, size)
                #elif __target_memoryType__ == __TargetMemoryType_endiansLittle__
                    #define __Mem_nativeToBig__(dest, src, size)    __Mem_reverse__(dest, src, size)
                #else
                    #error "please define __target_memoryType__ with __TargetMemoryType_ (you can test endings with cpu_checkNumberFormat function)"
                #endif
            // # __Mem_nativeToLittle__
                #if __target_memoryType__ == __TargetMemoryType_endiansBig__
                    #define __Mem_nativeToLittle__(dest, src, size) __Mem_reverse__(dest, src, size)
                #elif __target_memoryType__ == __TargetMemoryType_endiansLittle__
                    #define __Mem_nativeToLittle__(dest, src, size) __Mem_copy__(dest, src, size)
                #else
                    #error "please define __target_memoryType__ with __TargetMemoryType_ (you can test endings with cpu_checkNumberFormat function)"
                #endif
        // compile-time text
            #define __CText_len__(           str)           (__arrayLen__(str) - 1)
            #define __CText_write__(         buffer, text)  (__Mem_copy__(buffer, text, __CText_len__(text)), __CText_len__(text))
            #define __CTextPtr_fromCText__(  text)          ((char(*)[__CText_len__(text)]) text)
            #define __CTextPtr_lvalue__(     name, text)    (char(*name)[__CText_len__(text)])
            #define __CTextPtr_declare__(    name, text)    __CTextPtr_lvalue__(name, text) = __CTextPtr_fromCText__(text)
            
            // slice
                #define __len_and_text__(     str)   __CText_len__(str), str
                #define __text_and_len__(     str)   str, __CText_len__(str)
                #define __Slice_fromCText__(  text)  {.ptr=text, .len=__CText_len__(text)}
        // __ConsoleAnsi_input_Key__
            // ascii
                #define __ConsoleAnsiInputKey_ascii_ctrl__     (-'a' + 1)  /* do not use externally */
                #define __ConsoleAnsiInputKey_ctrl_bs__         8  /* also ctrl_h */
                #define __ConsoleAnsiInputKey_tab__             9  /* also ctrl_i */
                #define __ConsoleAnsiInputKey_enter__          13  /* also ctrl_m */
                #define __ConsoleAnsiInputKey_escape__         27
                #define __ConsoleAnsiInputKey_back_space__    127 /* sometime delete */
                
                // #  1  start_of_heading __ConsoleAnsiInputKey_ctrl_a__
                    #define __ConsoleAnsiInputKey_ctrl_a__        ('a' + __ConsoleAnsiInputKey_ascii_ctrl__) 
                // #  2 __ConsoleAnsiInputKey_ctrl_b__
                    #define __ConsoleAnsiInputKey_ctrl_b__        ('b' + __ConsoleAnsiInputKey_ascii_ctrl__) 
                // #  3  __ConsoleAnsiInputKey_ctrl_c__
                    #define __ConsoleAnsiInputKey_ctrl_c__        ('c' + __ConsoleAnsiInputKey_ascii_ctrl__) 
                // #  4  __ConsoleAnsiInputKey_ctrl_d__
                    #define __ConsoleAnsiInputKey_ctrl_d__        ('d' + __ConsoleAnsiInputKey_ascii_ctrl__) 
                // #  5  __ConsoleAnsiInputKey_ctrl_e__
                    #define __ConsoleAnsiInputKey_ctrl_e__        ('e' + __ConsoleAnsiInputKey_ascii_ctrl__) 
                // #  6  __ConsoleAnsiInputKey_ctrl_f__
                    #define __ConsoleAnsiInputKey_ctrl_f__        ('f' + __ConsoleAnsiInputKey_ascii_ctrl__) 
                // #  7  __ConsoleAnsiInputKey_ctrl_g__
                    #define __ConsoleAnsiInputKey_ctrl_g__        ('g' + __ConsoleAnsiInputKey_ascii_ctrl__) 
                // #  8  also ctrl_bs __ConsoleAnsiInputKey_ctrl_h__
                    #define __ConsoleAnsiInputKey_ctrl_h__        ('h' + __ConsoleAnsiInputKey_ascii_ctrl__) 
                // #  9  also tab __ConsoleAnsiInputKey_ctrl_i__
                    #define __ConsoleAnsiInputKey_ctrl_i__        ('i' + __ConsoleAnsiInputKey_ascii_ctrl__) 
                // # 10  __ConsoleAnsiInputKey_ctrl_j__
                    #define __ConsoleAnsiInputKey_ctrl_j__        ('j' + __ConsoleAnsiInputKey_ascii_ctrl__) 
                // # 11  vertical_tab__ConsoleAnsiInputKey_ctrl_k__
                    #define __ConsoleAnsiInputKey_ctrl_k__        ('k' + __ConsoleAnsiInputKey_ascii_ctrl__) 
                // # 12  formFeed__ConsoleAnsiInputKey_ctrl_l__
                    #define __ConsoleAnsiInputKey_ctrl_l__        ('l' + __ConsoleAnsiInputKey_ascii_ctrl__) 
                // # 13  also enter __ConsoleAnsiInputKey_ctrl_m__
                    #define __ConsoleAnsiInputKey_ctrl_m__        ('m' + __ConsoleAnsiInputKey_ascii_ctrl__) 
                // # 14  __ConsoleAnsiInputKey_ctrl_n__
                    #define __ConsoleAnsiInputKey_ctrl_n__        ('n' + __ConsoleAnsiInputKey_ascii_ctrl__) 
                // # 15  __ConsoleAnsiInputKey_ctrl_o__
                    #define __ConsoleAnsiInputKey_ctrl_o__        ('o' + __ConsoleAnsiInputKey_ascii_ctrl__) 
                // # 16  __ConsoleAnsiInputKey_ctrl_p__
                    #define __ConsoleAnsiInputKey_ctrl_p__        ('p' + __ConsoleAnsiInputKey_ascii_ctrl__) 
                // # 17  __ConsoleAnsiInputKey_ctrl_q__
                    #define __ConsoleAnsiInputKey_ctrl_q__        ('q' + __ConsoleAnsiInputKey_ascii_ctrl__) 
                // # 18  __ConsoleAnsiInputKey_ctrl_r__
                    #define __ConsoleAnsiInputKey_ctrl_r__        ('r' + __ConsoleAnsiInputKey_ascii_ctrl__) 
                // # 19  __ConsoleAnsiInputKey_ctrl_s__
                    #define __ConsoleAnsiInputKey_ctrl_s__        ('s' + __ConsoleAnsiInputKey_ascii_ctrl__) 
                // # 20  __ConsoleAnsiInputKey_ctrl_t__
                    #define __ConsoleAnsiInputKey_ctrl_t__        ('t' + __ConsoleAnsiInputKey_ascii_ctrl__) 
                // # 21  __ConsoleAnsiInputKey_ctrl_u__
                    #define __ConsoleAnsiInputKey_ctrl_u__        ('u' + __ConsoleAnsiInputKey_ascii_ctrl__) 
                // # 22  __ConsoleAnsiInputKey_ctrl_v__
                    #define __ConsoleAnsiInputKey_ctrl_v__        ('v' + __ConsoleAnsiInputKey_ascii_ctrl__) 
                // # 23  __ConsoleAnsiInputKey_ctrl_w__
                    #define __ConsoleAnsiInputKey_ctrl_w__        ('w' + __ConsoleAnsiInputKey_ascii_ctrl__) 
                // # 24  __ConsoleAnsiInputKey_ctrl_x__
                    #define __ConsoleAnsiInputKey_ctrl_x__        ('x' + __ConsoleAnsiInputKey_ascii_ctrl__) 
                // # 25  __ConsoleAnsiInputKey_ctrl_y__
                    #define __ConsoleAnsiInputKey_ctrl_y__        ('y' + __ConsoleAnsiInputKey_ascii_ctrl__) 
                // # 26  __ConsoleAnsiInputKey_ctrl_z__
                    #define __ConsoleAnsiInputKey_ctrl_z__        ('z' + __ConsoleAnsiInputKey_ascii_ctrl__) 
            // __ConsoleAnsiInputKey_non_ascii__ 
                #define __ConsoleAnsiInputKey_special__       (1 << 8)
                #define __ConsoleAnsiInputKey_functional__    (1 << 9)
                #define __ConsoleAnsiInputKey_ctrl__          (1 << 10)
                #define __ConsoleAnsiInputKey_alt__           (1 << 11)
                #define __ConsoleAnsiInputKey_shift__         (1 << 12)
                #define __ConsoleAnsiInputKey_mouse__         (1 << 13)
                
                // FN
                    #define __ConsoleAnsiInputKey_f1__        (1 + __ConsoleAnsiInputKey_functional__)
                    #define __ConsoleAnsiInputKey_f2__        (2 + __ConsoleAnsiInputKey_functional__)
                    #define __ConsoleAnsiInputKey_f3__        (3 + __ConsoleAnsiInputKey_functional__)
                    #define __ConsoleAnsiInputKey_f4__        (4 + __ConsoleAnsiInputKey_functional__)
                    #define __ConsoleAnsiInputKey_f5__        (5 + __ConsoleAnsiInputKey_functional__)
                    #define __ConsoleAnsiInputKey_f6__        (6 + __ConsoleAnsiInputKey_functional__)
                    #define __ConsoleAnsiInputKey_f7__        (7 + __ConsoleAnsiInputKey_functional__)
                    #define __ConsoleAnsiInputKey_f8__        (8 + __ConsoleAnsiInputKey_functional__)
                    #define __ConsoleAnsiInputKey_f9__        (9 + __ConsoleAnsiInputKey_functional__)
                    #define __ConsoleAnsiInputKey_f10__       (10 + __ConsoleAnsiInputKey_functional__)
                    #define __ConsoleAnsiInputKey_f11__       (11 + __ConsoleAnsiInputKey_functional__)
                    #define __ConsoleAnsiInputKey_f12__       (12 + __ConsoleAnsiInputKey_functional__)
                // arrows
                    
                    // left
                    #define __ConsoleAnsiInputKey_left__              (1 + __ConsoleAnsiInputKey_special__)
                    #define __ConsoleAnsiInputKey_ctrl_left__         (__ConsoleAnsiInputKey_left__ + __ConsoleAnsiInputKey_ctrl__)
                    #define __ConsoleAnsiInputKey_alt_left__          (__ConsoleAnsiInputKey_left__ + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_shift_left__        (__ConsoleAnsiInputKey_left__ + __ConsoleAnsiInputKey_shift__)
                    #define __ConsoleAnsiInputKey_ctrl_shift_left__   (__ConsoleAnsiInputKey_left__ + __ConsoleAnsiInputKey_ctrl__ + __ConsoleAnsiInputKey_shift__)
                    
                    // right
                    #define __ConsoleAnsiInputKey_right__             (2 + __ConsoleAnsiInputKey_special__)
                    #define __ConsoleAnsiInputKey_ctrl_right__        (__ConsoleAnsiInputKey_right__ + __ConsoleAnsiInputKey_ctrl__)
                    #define __ConsoleAnsiInputKey_alt_right__         (__ConsoleAnsiInputKey_right__ + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_shift_right__       (__ConsoleAnsiInputKey_right__ + __ConsoleAnsiInputKey_shift__)
                    #define __ConsoleAnsiInputKey_ctrl_shift_right__  (__ConsoleAnsiInputKey_right__ + __ConsoleAnsiInputKey_ctrl__ + __ConsoleAnsiInputKey_shift__)
                    
                    // up
                    #define __ConsoleAnsiInputKey_up__                (3 + __ConsoleAnsiInputKey_special__)
                    #define __ConsoleAnsiInputKey_ctrl_up__           (__ConsoleAnsiInputKey_up__ + __ConsoleAnsiInputKey_ctrl__)
                    #define __ConsoleAnsiInputKey_alt_up__            (__ConsoleAnsiInputKey_up__ + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_shift_up__          (__ConsoleAnsiInputKey_up__ + __ConsoleAnsiInputKey_shift__)
                    
                    // down
                    #define __ConsoleAnsiInputKey_down__              (4 + __ConsoleAnsiInputKey_special__)
                    #define __ConsoleAnsiInputKey_ctrl_down__         (__ConsoleAnsiInputKey_down__ + __ConsoleAnsiInputKey_ctrl__)
                    #define __ConsoleAnsiInputKey_alt_down__          (__ConsoleAnsiInputKey_down__ + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_shift_down__        (__ConsoleAnsiInputKey_down__ + __ConsoleAnsiInputKey_shift__)
                // spec keys
                    #define __ConsoleAnsiInputKey_delete__            (5 + __ConsoleAnsiInputKey_special__)
                    #define __ConsoleAnsiInputKey_shift_delete__      (__ConsoleAnsiInputKey_delete__ + __ConsoleAnsiInputKey_shift__)
                    
                    #define __ConsoleAnsiInputKey_page_up__           (6 + __ConsoleAnsiInputKey_special__)
                    #define __ConsoleAnsiInputKey_page_down__         (7 + __ConsoleAnsiInputKey_special__)
                    #define __ConsoleAnsiInputKey_end__               (8 + __ConsoleAnsiInputKey_special__)
                    #define __ConsoleAnsiInputKey_home__              (9 + __ConsoleAnsiInputKey_special__)
                
                #define __ConsoleAnsiInputKey_ctrl_enter__                            (__ConsoleAnsiInputKey_enter__ + __ConsoleAnsiInputKey_special__ + __ConsoleAnsiInputKey_ctrl__)
                #define __ConsoleAnsiInputKey_ctrl_triangular_open_quotation_mark__   ('<' + __ConsoleAnsiInputKey_special__ + __ConsoleAnsiInputKey_ctrl__)
                #define __ConsoleAnsiInputKey_ctrl_triangular_close_quotation_mark__  ('>' + __ConsoleAnsiInputKey_special__ + __ConsoleAnsiInputKey_ctrl__)
                
                #define __ConsoleAnsiInputKey_ctrl_alt_v__  ('v' + __ConsoleAnsiInputKey_alt__ + __ConsoleAnsiInputKey_ctrl__)
                
                // altX
                    #define __ConsoleAnsiInputKey_alt_a__  ('a' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_b__  ('b' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_c__  ('c' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_d__  ('d' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_e__  ('e' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_f__  ('f' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_g__  ('g' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_h__  ('h' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_i__  ('i' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_j__  ('j' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_k__  ('k' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_l__  ('l' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_m__  ('m' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_n__  ('n' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_o__  ('o' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_p__  ('p' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_q__  ('q' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_r__  ('r' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_s__  ('s' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_t__  ('t' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_u__  ('u' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_v__  ('v' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_w__  ('w' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_x__  ('x' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_y__  ('y' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_z__  ('z' + __ConsoleAnsiInputKey_alt__)
                // alt_shiftX,
                    #define __ConsoleAnsiInputKey_alt_M__  ('M' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_N__  ('N' + __ConsoleAnsiInputKey_alt__)
                // altN
                    #define __ConsoleAnsiInputKey_alt_0__  ('0' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_1__  ('1' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_2__  ('2' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_3__  ('3' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_4__  ('4' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_5__  ('5' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_6__  ('6' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_7__  ('7' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_8__  ('8' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_9__  ('9' + __ConsoleAnsiInputKey_alt__)
                // alt_spec
                    #define __ConsoleAnsiInputKey_alt_comma__          (',' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_dot__            ('.' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_open_bracket__   ('[' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_close_bracket__  (']' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_semicolon__      (';' + __ConsoleAnsiInputKey_alt__)
                    #define __ConsoleAnsiInputKey_alt_apostrophe__     ('`' + __ConsoleAnsiInputKey_alt__)
        // crypto
            #define __Sha1Block_size__    64
            #define Sha1_digest_length 20
        // Network
            #if __target_os__ == __TargetOs_windows__
                #define WSA_SUCCESS 0
            #elif __target_os__ == __TargetOs_linux__
            #else
                #error "__target_os__ not implemented"
            #endif
    
            // __NetworkTcpHttpWebSocketHeader__
                #define __NetworkTcpHttpWebSocketHeaderMask_size__ 4
                #define __NetworkTcpHttpWebSocketHandShake_encoded_len__ 28
                
                // __NetworkTcpHttpWebSocketHeaderOpcode__
                    #define __NetworkTcpHttpWebSocketHeaderOpcode_continuation__ 0
                    #define __NetworkTcpHttpWebSocketHeaderOpcode_text__ 1
                    #define __NetworkTcpHttpWebSocketHeaderOpcode_binary__ 2
                    #define __NetworkTcpHttpWebSocketHeaderOpcode_close__ 8
                    #define __NetworkTcpHttpWebSocketHeaderOpcode_ping__ 9
                    #define __NetworkTcpHttpWebSocketHeaderOpcode_pong__ 10
                //  2 bytes header for sizes   1 ...   125
                    #define __NetworkTcpHttpWebSocketHeaderSmall__ 0  
                    #define __NetworkTcpHttpWebSocketHeaderSmall_size__ 2
                    #define __NetworkTcpHttpWebSocketHeaderSmallExtendedPayloadLen_size__ 0
                //  4 bytes header for sizes 126 ... 65535
                    #define __NetworkTcpHttpWebSocketHeaderMedium__ 1
                    #define __NetworkTcpHttpWebSocketHeaderMedium_flag__ 126
                    #define __NetworkTcpHttpWebSocketHeaderMediumExtendedPayloadLen_size__ 2
                    #define __NetworkTcpHttpWebSocketHeaderMedium_size__ (__NetworkTcpHttpWebSocketHeaderSmall_size__ + __NetworkTcpHttpWebSocketHeaderMediumExtendedPayloadLen_size__)
                // 10 bytes header for sizes more than 65535
                    #define __NetworkTcpHttpWebSocketHeaderLong__ 2
                    #define __NetworkTcpHttpWebSocketHeaderLong_flag__ 127
                    #define __NetworkTcpHttpWebSocketHeaderLongExtendedPayloadLen_size__ 8
                    #define __NetworkTcpHttpWebSocketHeaderLong_size__ (__NetworkTcpHttpWebSocketHeaderSmall_size__ + __NetworkTcpHttpWebSocketHeaderLongExtendedPayloadLen_size__)
        // time
            // # __TimeStamp_len__
                // for write time stamp like "00:00:00" as "HH:MM:SS" where HH - hours, MM - minuts, SS - seconds
                #define __TimeStamp_len__ 8
            // Fsec
                #define __Time_nsPerFsec__  0.000_000_001
                #define __Time_usPerFsec__  0.000_001
                #define __Time_msPerFsec__  0.001
            #define __Time_msPerSec__   1000
            #define __Time_msPerS__     1000
            #define __Time_secPerMin__  60
            #define __Time_minPerHour__ 60
            #define __Time_hourPerDay__ 24
            #define __Time_daysPerWeek__ 7
        // formats
            // Hex
                #define __Hex_lenFromBytesLen__(len) (len * 2)
                #define __Hex_bytesLenFromHex__(len) (len >> 1)
            // # __u64FromTextDec_maxLen__
                //#define __u64FromTextDec_maxLen__  __CText_len__("18446744073709551615")
                    #define __u64FromTextDec_maxLen__ 20
            // # __TextCharsDecFromU64_lenMax__
                //#define __TextCharsDecFromU64_lenMax__  __CText_len__("18446744073709551615")
                    #define __TextCharsDecFromU64_lenMax__  20
        // OsNetwork
            #define __OsNetworkTcp_maxAllowedListenPort__          49151
    // auto unwrap CText to text and len
        // # __OsConsoleOutput_writeCText__
            #define __OsConsoleOutput_writeCText__(  ctx, text)  \
                    __OsConsoleOutput_write__(       ctx, text, __CText_len__(text))
        // # __Terminal_Output_setFontStyleCText__
            #define __Terminal_Output_setFontStyleCText__(  ctx, text)  \
                    __Terminal_setFontStyle__(       ctx, text, __CText_len__(text))
    // auto casting
        // # __Mem_fillAny__
            #define __Mem_fillAny__(        dest, symbol, len) \
                    __Mem_fill__(    (char*)dest, symbol, len)
        // # __OsFile_readToAny__
            #define __OsFile_readToAny__(     file,          buffer,  buffer_len, offset ) \







<
|
<
|
|
|
<
|
|
<
|
|
|
|
|
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
<
<
<
<
<
<
<
<
<
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|




|
|







57
58
59
60
61
62
63

64

65
66
67

68
69

70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259











260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
                zig idiomatic:      if (link) |_| i += 1;
                zig but C pointer:  if (@intFromPtr(link) != @intFromPtr(c.NULL)) i += 1;
    */
// TODO
    /*
        remove name buffer_len. use buffer_max_size and buffer_used instead.
    */

// enums

    // # __LoggerWriter__
        #define __LoggerWriter_toFallback__  0
        #define __LoggerWriter_toFile__      1

        #define __LoggerWriter_toConsole__   2
        #define __LoggerWriter_toTerminal__  3

    // # __MemTree_fix_counts_Action__
        #define __MemTree_fix_counts_Action_plus__  'p'
        #define __MemTree_fix_counts_Action_minus__ 'm'
    // # __MemTree_fix_nested_Action__
        #define __MemTree_fix_nested_Action_plus__  'p'
        #define __MemTree_fix_nested_Action_minus__ 'm'
    // # __OsNetworkTcpSocketConnectResult__ (char)
        #define __OsNetworkTcpSocketConnectResult_error__      -1
        #define __OsNetworkTcpSocketConnectResult_inProgress__  0
        #define __OsNetworkTcpSocketConnectResult_success__     1
    // # __TargetOs__
        #define __TargetOs_windows__ 1
        #define __TargetOs_linux__   2
    // # __TargetMemoryType__
        #define __TargetMemoryType_endiansLittle__  1
        #define __TargetMemoryType_endiansBig__     2
// settings
    // platform
        // target
            // # __target_os__
                //#define __target_os__  __TargetOs_linux__
                #ifndef __target_os__
                    #ifdef _WIN32
                        #define __target_os__  __TargetOs_windows__
                    #elif defined(__linux__)
                        #define __target_os__  __TargetOs_linux__
                    #endif
                #endif
            #define __target_memoryType__ __TargetMemoryType_endiansLittle__
        #define __OsFilePathLen_max__              1024
        #define __with_network__                      0
        #define __OsNetworkTcp_maxClientCount__       8
        #define __OsNetworkTcpHttp_maxHeaders__      48
        #define __TerminalInput_size__               32
    // __App__
        #define __AppEditorViewsEasyMotionHorizontal_step__  3
        #define __AppEditorViewsEasyMotionVertical_step__    2
        #define __App_expectedFps__                          30
        #define __AppEditorLineLen_max__                     (1024 * 8)
        // AppEditorTheme
            #define __AppEditorTheme_folded__ \ 
                __ConsoleAnsiOutputFontStyle_start__ \
                __ConsoleAnsiOutputFontStyle_bold__ \
                __ConsoleAnsiOutputFontStyle_sep__ \
                __ConsoleAnsiOutputFontStyle_bg_color_zero__ \
                __ConsoleAnsiOutputFontStyle_sep__ \
                __ConsoleAnsiOutputFontStyle_color_zero__ \
                __ConsoleAnsiOutputFontStyle_end__
            #define __AppEditorTheme_folded_arrows__ \
                __ConsoleAnsiOutputFontStyle_start__ \
                __ConsoleAnsiOutputFontStyle_bold__ \
                __ConsoleAnsiOutputFontStyle_sep__ \
                __ConsoleAnsiOutputFontStyle_bg_color_gray__ \
                __ConsoleAnsiOutputFontStyle_sep__ \
                __ConsoleAnsiOutputFontStyle_color_yellow__ \
                __ConsoleAnsiOutputFontStyle_end__
            #define __AppEditorTheme_current_folded__ \
                __ConsoleAnsiOutputFontStyle_start__ \
                __ConsoleAnsiOutputFontStyle_bold__ \
                __ConsoleAnsiOutputFontStyle_sep__ \
                __ConsoleAnsiOutputFontStyle_bg_color_zero__ \
                __ConsoleAnsiOutputFontStyle_sep__ \
                __ConsoleAnsiOutputFontStyle_color_light_green__ \
                __ConsoleAnsiOutputFontStyle_end__
            #define __AppEditorTheme_notification__ \
                __ConsoleAnsiOutputFontStyle_start__ \
                __ConsoleAnsiOutputFontStyle_bg_color_zero__ \
                __ConsoleAnsiOutputFontStyle_sep__ \
                __ConsoleAnsiOutputFontStyle_color_red__ \
                __ConsoleAnsiOutputFontStyle_end__
            #define __AppEditorTheme_headers__ \
                __ConsoleAnsiOutputFontStyle_start__ \
                __ConsoleAnsiOutputFontStyle_bold__ \
                __ConsoleAnsiOutputFontStyle_sep__ \
                __ConsoleAnsiOutputFontStyle_bg_color_zero__ \
                __ConsoleAnsiOutputFontStyle_sep__ \
                __ConsoleAnsiOutputFontStyle_color_cyan__ \
                __ConsoleAnsiOutputFontStyle_end__
            #define __AppEditorTheme_easy_motion__ \
                __ConsoleAnsiOutputFontStyle_start__ \
                __ConsoleAnsiOutputFontStyle_bg_color_zero__ \
                __ConsoleAnsiOutputFontStyle_sep__ \
                __ConsoleAnsiOutputFontStyle_color_yellow__ \
                __ConsoleAnsiOutputFontStyle_end__
            #define __AppEditorTheme_disabled__ \
                __ConsoleAnsiOutputFontStyle_start__  \
                __ConsoleAnsiOutputFontStyle_bg_color_zero__  \
                __ConsoleAnsiOutputFontStyle_sep__  \
                __ConsoleAnsiOutputFontStyle_color_magenta__ \
                __ConsoleAnsiOutputFontStyle_end__
            #define __AppEditorTheme_commentary__ \ 
                __ConsoleAnsiOutputFontStyle_start__ \
                __ConsoleAnsiOutputFontStyle_bg_color_zero__ \
                __ConsoleAnsiOutputFontStyle_sep__ \
                __ConsoleAnsiOutputFontStyle_color_yellow__ \
                __ConsoleAnsiOutputFontStyle_end__
            #define __AppEditorTheme_current_disabled__ \
                __ConsoleAnsiOutputFontStyle_start__             \
                __ConsoleAnsiOutputFontStyle_bg_color_zero__     \
                __ConsoleAnsiOutputFontStyle_sep__               \
                __ConsoleAnsiOutputFontStyle_color_light_green__ \
                __ConsoleAnsiOutputFontStyle_end__
            #define __AppEditorTheme_current_commentary__ \
                __ConsoleAnsiOutputFontStyle_start__         \
                __ConsoleAnsiOutputFontStyle_bg_color_zero__ \
                __ConsoleAnsiOutputFontStyle_sep__           \
                __ConsoleAnsiOutputFontStyle_color_yellow__  \
                __ConsoleAnsiOutputFontStyle_end__
            #define __AppEditorTheme_current__ \
                __ConsoleAnsiOutputFontStyle_start__             \
                __ConsoleAnsiOutputFontStyle_bg_color_zero__     \
                __ConsoleAnsiOutputFontStyle_sep__               \
                __ConsoleAnsiOutputFontStyle_color_light_green__ \
                __ConsoleAnsiOutputFontStyle_end__
            #define __AppEditorTheme_current_rune__ \
                __ConsoleAnsiOutputFontStyle_start__         \
                __ConsoleAnsiOutputFontStyle_bg_color_zero__ \ 
                __ConsoleAnsiOutputFontStyle_sep__           \
                __ConsoleAnsiOutputFontStyle_color_magenta__ \ 
                __ConsoleAnsiOutputFontStyle_end__
            #define __AppEditorTheme_reset__  \
                __ConsoleAnsiOutputFontStyle_start__         \
                __ConsoleAnsiOutputFontStyle_reset__         \
                __ConsoleAnsiOutputFontStyle_sep__           \
                __ConsoleAnsiOutputFontStyle_bg_color_zero__ \
                __ConsoleAnsiOutputFontStyle_sep__           \
                __ConsoleAnsiOutputFontStyle_color_zero__    \
                __ConsoleAnsiOutputFontStyle_end__
            #define __AppEditorTheme_arrows__ \
                __ConsoleAnsiOutputFontStyle_start__ \
                __ConsoleAnsiOutputFontStyle_unbold__ \
                __ConsoleAnsiOutputFontStyle_sep__ \
                __ConsoleAnsiOutputFontStyle_bg_color_zero__ \
                __ConsoleAnsiOutputFontStyle_sep__ \
                __ConsoleAnsiOutputFontStyle_color_yellow__ \
                __ConsoleAnsiOutputFontStyle_end__
// macro
    // c
        // breakpoint
            #if __target_os__ == __TargetOs_windows__
                #define breakpoint() DebugBreak()                      
            #elif __target_os__ == __TargetOs_linux__
                #define breakpoint() raise(SIGTRAP)                      
            #else
                #error "__target_os__ not implemented"
            #endif
        #define or   ||
        #define and  &&
        #define __arrayLen__(                             array)                        (sizeof((array)) / sizeof((array[0])))
        #define __Addr_fromPtr__(                         ptr)                          ((uintptr_t)(ptr))
        #define __Instance_fromPtr__(                     ptr)                          (*(ptr))
        #define __Struct_getFieldOffset__(                type, field)                  (__Addr_fromPtr__(__TypedPtr_getFieldPtr__(__TypedPtr_virtual__(type), field)))
        #define __TypedPtr_fromAddr__(                    type, addr)                   ((type*)(addr))
        #define __TypedPtr_virtual__(                     type)                         (__TypedPtr_fromAddr__(type, 0)) 
        #define __TypedPtr_getFieldPtr__(                 ptr, field_name)              (&(ptr)->field_name)
        // # fieldParentPtr
        #define __TypedPtr_getParentPtrFromFieldPtr__(    type, field_name, field_ptr)  (__TypedPtr_fromAddr__(type, __Addr_fromPtr__((field_ptr)) - __Struct_getFieldOffset__(type, field_name)))
        #define __Type_getSize__(                         type)                         (__Struct_getFieldOffset__(struct {type t; char c;}, c))
        #define __Type_getAlign__(                        type)                         (__Struct_getFieldOffset__(struct {char c; type t;}, t))
    // compile-time text
        #define __CText_len__(           str)           (__arrayLen__(str) - 1)
        #define __CText_write__(         buffer, text)  (__Mem_copy__(buffer, text, __CText_len__(text)), __CText_len__(text))
        #define __CTextPtr_fromCText__(  text)          ((char(*)[__CText_len__(text)]) text)
        #define __CTextPtr_lvalue__(     name, text)    (char(*name)[__CText_len__(text)])
        #define __CTextPtr_declare__(    name, text)    __CTextPtr_lvalue__(name, text) = __CTextPtr_fromCText__(text)
        
        // slice
            #define __len_and_text__(     str)   __CText_len__(str), str
            #define __text_and_len__(     str)   str, __CText_len__(str)
            #define __Slice_fromCText__(  text)  {.ptr=text, .len=__CText_len__(text)}
    // mem
        #define KB_size 1024
        #define MB_size (1024 * KB_size)
        #define GB_size (1024 * MB_size)
        // # __Mem_nativeToBig__
            #if __target_memoryType__ == __TargetMemoryType_endiansBig__
                #define __Mem_nativeToBig__(dest, src, size)    __Mem_copy__(dest, src, size)
            #elif __target_memoryType__ == __TargetMemoryType_endiansLittle__
                #define __Mem_nativeToBig__(dest, src, size)    __Mem_reverse__(dest, src, size)
            #else
                #error "please define __target_memoryType__ with __TargetMemoryType_ (you can test endings with cpu_checkNumberFormat function)"
            #endif
        // # __Mem_nativeToLittle__
            #if __target_memoryType__ == __TargetMemoryType_endiansBig__
                #define __Mem_nativeToLittle__(dest, src, size) __Mem_reverse__(dest, src, size)
            #elif __target_memoryType__ == __TargetMemoryType_endiansLittle__
                #define __Mem_nativeToLittle__(dest, src, size) __Mem_copy__(dest, src, size)
            #else
                #error "please define __target_memoryType__ with __TargetMemoryType_ (you can test endings with cpu_checkNumberFormat function)"
            #endif











    // __ConsoleAnsi_input_Key__
        // ascii
            #define __ConsoleAnsiInputKey_ascii_ctrl__     (-'a' + 1)  /* do not use externally */
            #define __ConsoleAnsiInputKey_ctrl_bs__         8  /* also ctrl_h */
            #define __ConsoleAnsiInputKey_tab__             9  /* also ctrl_i */
            #define __ConsoleAnsiInputKey_enter__          13  /* also ctrl_m */
            #define __ConsoleAnsiInputKey_escape__         27
            #define __ConsoleAnsiInputKey_back_space__    127 /* sometime delete */
            
            // #  1  start_of_heading __ConsoleAnsiInputKey_ctrl_a__
                #define __ConsoleAnsiInputKey_ctrl_a__        ('a' + __ConsoleAnsiInputKey_ascii_ctrl__) 
            // #  2 __ConsoleAnsiInputKey_ctrl_b__
                #define __ConsoleAnsiInputKey_ctrl_b__        ('b' + __ConsoleAnsiInputKey_ascii_ctrl__) 
            // #  3  __ConsoleAnsiInputKey_ctrl_c__
                #define __ConsoleAnsiInputKey_ctrl_c__        ('c' + __ConsoleAnsiInputKey_ascii_ctrl__) 
            // #  4  __ConsoleAnsiInputKey_ctrl_d__
                #define __ConsoleAnsiInputKey_ctrl_d__        ('d' + __ConsoleAnsiInputKey_ascii_ctrl__) 
            // #  5  __ConsoleAnsiInputKey_ctrl_e__
                #define __ConsoleAnsiInputKey_ctrl_e__        ('e' + __ConsoleAnsiInputKey_ascii_ctrl__) 
            // #  6  __ConsoleAnsiInputKey_ctrl_f__
                #define __ConsoleAnsiInputKey_ctrl_f__        ('f' + __ConsoleAnsiInputKey_ascii_ctrl__) 
            // #  7  __ConsoleAnsiInputKey_ctrl_g__
                #define __ConsoleAnsiInputKey_ctrl_g__        ('g' + __ConsoleAnsiInputKey_ascii_ctrl__) 
            // #  8  also ctrl_bs __ConsoleAnsiInputKey_ctrl_h__
                #define __ConsoleAnsiInputKey_ctrl_h__        ('h' + __ConsoleAnsiInputKey_ascii_ctrl__) 
            // #  9  also tab __ConsoleAnsiInputKey_ctrl_i__
                #define __ConsoleAnsiInputKey_ctrl_i__        ('i' + __ConsoleAnsiInputKey_ascii_ctrl__) 
            // # 10  __ConsoleAnsiInputKey_ctrl_j__
                #define __ConsoleAnsiInputKey_ctrl_j__        ('j' + __ConsoleAnsiInputKey_ascii_ctrl__) 
            // # 11  vertical_tab__ConsoleAnsiInputKey_ctrl_k__
                #define __ConsoleAnsiInputKey_ctrl_k__        ('k' + __ConsoleAnsiInputKey_ascii_ctrl__) 
            // # 12  formFeed__ConsoleAnsiInputKey_ctrl_l__
                #define __ConsoleAnsiInputKey_ctrl_l__        ('l' + __ConsoleAnsiInputKey_ascii_ctrl__) 
            // # 13  also enter __ConsoleAnsiInputKey_ctrl_m__
                #define __ConsoleAnsiInputKey_ctrl_m__        ('m' + __ConsoleAnsiInputKey_ascii_ctrl__) 
            // # 14  __ConsoleAnsiInputKey_ctrl_n__
                #define __ConsoleAnsiInputKey_ctrl_n__        ('n' + __ConsoleAnsiInputKey_ascii_ctrl__) 
            // # 15  __ConsoleAnsiInputKey_ctrl_o__
                #define __ConsoleAnsiInputKey_ctrl_o__        ('o' + __ConsoleAnsiInputKey_ascii_ctrl__) 
            // # 16  __ConsoleAnsiInputKey_ctrl_p__
                #define __ConsoleAnsiInputKey_ctrl_p__        ('p' + __ConsoleAnsiInputKey_ascii_ctrl__) 
            // # 17  __ConsoleAnsiInputKey_ctrl_q__
                #define __ConsoleAnsiInputKey_ctrl_q__        ('q' + __ConsoleAnsiInputKey_ascii_ctrl__) 
            // # 18  __ConsoleAnsiInputKey_ctrl_r__
                #define __ConsoleAnsiInputKey_ctrl_r__        ('r' + __ConsoleAnsiInputKey_ascii_ctrl__) 
            // # 19  __ConsoleAnsiInputKey_ctrl_s__
                #define __ConsoleAnsiInputKey_ctrl_s__        ('s' + __ConsoleAnsiInputKey_ascii_ctrl__) 
            // # 20  __ConsoleAnsiInputKey_ctrl_t__
                #define __ConsoleAnsiInputKey_ctrl_t__        ('t' + __ConsoleAnsiInputKey_ascii_ctrl__) 
            // # 21  __ConsoleAnsiInputKey_ctrl_u__
                #define __ConsoleAnsiInputKey_ctrl_u__        ('u' + __ConsoleAnsiInputKey_ascii_ctrl__) 
            // # 22  __ConsoleAnsiInputKey_ctrl_v__
                #define __ConsoleAnsiInputKey_ctrl_v__        ('v' + __ConsoleAnsiInputKey_ascii_ctrl__) 
            // # 23  __ConsoleAnsiInputKey_ctrl_w__
                #define __ConsoleAnsiInputKey_ctrl_w__        ('w' + __ConsoleAnsiInputKey_ascii_ctrl__) 
            // # 24  __ConsoleAnsiInputKey_ctrl_x__
                #define __ConsoleAnsiInputKey_ctrl_x__        ('x' + __ConsoleAnsiInputKey_ascii_ctrl__) 
            // # 25  __ConsoleAnsiInputKey_ctrl_y__
                #define __ConsoleAnsiInputKey_ctrl_y__        ('y' + __ConsoleAnsiInputKey_ascii_ctrl__) 
            // # 26  __ConsoleAnsiInputKey_ctrl_z__
                #define __ConsoleAnsiInputKey_ctrl_z__        ('z' + __ConsoleAnsiInputKey_ascii_ctrl__) 
        // __ConsoleAnsiInputKey_non_ascii__ 
            #define __ConsoleAnsiInputKey_special__       (1 << 8)
            #define __ConsoleAnsiInputKey_functional__    (1 << 9)
            #define __ConsoleAnsiInputKey_ctrl__          (1 << 10)
            #define __ConsoleAnsiInputKey_alt__           (1 << 11)
            #define __ConsoleAnsiInputKey_shift__         (1 << 12)
            #define __ConsoleAnsiInputKey_mouse__         (1 << 13)
            
            // FN
                #define __ConsoleAnsiInputKey_f1__        (1 + __ConsoleAnsiInputKey_functional__)
                #define __ConsoleAnsiInputKey_f2__        (2 + __ConsoleAnsiInputKey_functional__)
                #define __ConsoleAnsiInputKey_f3__        (3 + __ConsoleAnsiInputKey_functional__)
                #define __ConsoleAnsiInputKey_f4__        (4 + __ConsoleAnsiInputKey_functional__)
                #define __ConsoleAnsiInputKey_f5__        (5 + __ConsoleAnsiInputKey_functional__)
                #define __ConsoleAnsiInputKey_f6__        (6 + __ConsoleAnsiInputKey_functional__)
                #define __ConsoleAnsiInputKey_f7__        (7 + __ConsoleAnsiInputKey_functional__)
                #define __ConsoleAnsiInputKey_f8__        (8 + __ConsoleAnsiInputKey_functional__)
                #define __ConsoleAnsiInputKey_f9__        (9 + __ConsoleAnsiInputKey_functional__)
                #define __ConsoleAnsiInputKey_f10__       (10 + __ConsoleAnsiInputKey_functional__)
                #define __ConsoleAnsiInputKey_f11__       (11 + __ConsoleAnsiInputKey_functional__)
                #define __ConsoleAnsiInputKey_f12__       (12 + __ConsoleAnsiInputKey_functional__)
            // arrows
                
                // left
                #define __ConsoleAnsiInputKey_left__              (1 + __ConsoleAnsiInputKey_special__)
                #define __ConsoleAnsiInputKey_ctrl_left__         (__ConsoleAnsiInputKey_left__ + __ConsoleAnsiInputKey_ctrl__)
                #define __ConsoleAnsiInputKey_alt_left__          (__ConsoleAnsiInputKey_left__ + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_shift_left__        (__ConsoleAnsiInputKey_left__ + __ConsoleAnsiInputKey_shift__)
                #define __ConsoleAnsiInputKey_ctrl_shift_left__   (__ConsoleAnsiInputKey_left__ + __ConsoleAnsiInputKey_ctrl__ + __ConsoleAnsiInputKey_shift__)
                
                // right
                #define __ConsoleAnsiInputKey_right__             (2 + __ConsoleAnsiInputKey_special__)
                #define __ConsoleAnsiInputKey_ctrl_right__        (__ConsoleAnsiInputKey_right__ + __ConsoleAnsiInputKey_ctrl__)
                #define __ConsoleAnsiInputKey_alt_right__         (__ConsoleAnsiInputKey_right__ + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_shift_right__       (__ConsoleAnsiInputKey_right__ + __ConsoleAnsiInputKey_shift__)
                #define __ConsoleAnsiInputKey_ctrl_shift_right__  (__ConsoleAnsiInputKey_right__ + __ConsoleAnsiInputKey_ctrl__ + __ConsoleAnsiInputKey_shift__)
                
                // up
                #define __ConsoleAnsiInputKey_up__                (3 + __ConsoleAnsiInputKey_special__)
                #define __ConsoleAnsiInputKey_ctrl_up__           (__ConsoleAnsiInputKey_up__ + __ConsoleAnsiInputKey_ctrl__)
                #define __ConsoleAnsiInputKey_alt_up__            (__ConsoleAnsiInputKey_up__ + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_shift_up__          (__ConsoleAnsiInputKey_up__ + __ConsoleAnsiInputKey_shift__)
                
                // down
                #define __ConsoleAnsiInputKey_down__              (4 + __ConsoleAnsiInputKey_special__)
                #define __ConsoleAnsiInputKey_ctrl_down__         (__ConsoleAnsiInputKey_down__ + __ConsoleAnsiInputKey_ctrl__)
                #define __ConsoleAnsiInputKey_alt_down__          (__ConsoleAnsiInputKey_down__ + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_shift_down__        (__ConsoleAnsiInputKey_down__ + __ConsoleAnsiInputKey_shift__)
            // spec keys
                #define __ConsoleAnsiInputKey_delete__            (5 + __ConsoleAnsiInputKey_special__)
                #define __ConsoleAnsiInputKey_shift_delete__      (__ConsoleAnsiInputKey_delete__ + __ConsoleAnsiInputKey_shift__)
                
                #define __ConsoleAnsiInputKey_page_up__           (6 + __ConsoleAnsiInputKey_special__)
                #define __ConsoleAnsiInputKey_page_down__         (7 + __ConsoleAnsiInputKey_special__)
                #define __ConsoleAnsiInputKey_end__               (8 + __ConsoleAnsiInputKey_special__)
                #define __ConsoleAnsiInputKey_home__              (9 + __ConsoleAnsiInputKey_special__)
            
            #define __ConsoleAnsiInputKey_ctrl_enter__                            (__ConsoleAnsiInputKey_enter__ + __ConsoleAnsiInputKey_special__ + __ConsoleAnsiInputKey_ctrl__)
            #define __ConsoleAnsiInputKey_ctrl_triangular_open_quotation_mark__   ('<' + __ConsoleAnsiInputKey_special__ + __ConsoleAnsiInputKey_ctrl__)
            #define __ConsoleAnsiInputKey_ctrl_triangular_close_quotation_mark__  ('>' + __ConsoleAnsiInputKey_special__ + __ConsoleAnsiInputKey_ctrl__)
            
            #define __ConsoleAnsiInputKey_ctrl_alt_v__  ('v' + __ConsoleAnsiInputKey_alt__ + __ConsoleAnsiInputKey_ctrl__)
            
            // altX
                #define __ConsoleAnsiInputKey_alt_a__  ('a' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_b__  ('b' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_c__  ('c' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_d__  ('d' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_e__  ('e' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_f__  ('f' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_g__  ('g' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_h__  ('h' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_i__  ('i' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_j__  ('j' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_k__  ('k' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_l__  ('l' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_m__  ('m' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_n__  ('n' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_o__  ('o' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_p__  ('p' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_q__  ('q' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_r__  ('r' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_s__  ('s' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_t__  ('t' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_u__  ('u' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_v__  ('v' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_w__  ('w' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_x__  ('x' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_y__  ('y' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_z__  ('z' + __ConsoleAnsiInputKey_alt__)
            // alt_shiftX,
                #define __ConsoleAnsiInputKey_alt_M__  ('M' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_N__  ('N' + __ConsoleAnsiInputKey_alt__)
            // altN
                #define __ConsoleAnsiInputKey_alt_0__  ('0' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_1__  ('1' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_2__  ('2' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_3__  ('3' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_4__  ('4' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_5__  ('5' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_6__  ('6' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_7__  ('7' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_8__  ('8' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_9__  ('9' + __ConsoleAnsiInputKey_alt__)
            // alt_spec
                #define __ConsoleAnsiInputKey_alt_comma__          (',' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_dot__            ('.' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_open_bracket__   ('[' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_close_bracket__  (']' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_semicolon__      (';' + __ConsoleAnsiInputKey_alt__)
                #define __ConsoleAnsiInputKey_alt_apostrophe__     ('`' + __ConsoleAnsiInputKey_alt__)
    // crypto
        #define __Sha1Block_size__    64
        #define Sha1_digest_length 20
    // Network
        #if __target_os__ == __TargetOs_windows__
            #define WSA_SUCCESS 0
        #elif __target_os__ == __TargetOs_linux__
        #else
            #error "__target_os__ not implemented"
        #endif

        // __NetworkTcpHttpWebSocketHeader__
            #define __NetworkTcpHttpWebSocketHeaderMask_size__ 4
            #define __NetworkTcpHttpWebSocketHandShake_encoded_len__ 28
            
            // __NetworkTcpHttpWebSocketHeaderOpcode__
                #define __NetworkTcpHttpWebSocketHeaderOpcode_continuation__ 0
                #define __NetworkTcpHttpWebSocketHeaderOpcode_text__ 1
                #define __NetworkTcpHttpWebSocketHeaderOpcode_binary__ 2
                #define __NetworkTcpHttpWebSocketHeaderOpcode_close__ 8
                #define __NetworkTcpHttpWebSocketHeaderOpcode_ping__ 9
                #define __NetworkTcpHttpWebSocketHeaderOpcode_pong__ 10
            //  2 bytes header for sizes   1 ...   125
                #define __NetworkTcpHttpWebSocketHeaderSmall__ 0  
                #define __NetworkTcpHttpWebSocketHeaderSmall_size__ 2
                #define __NetworkTcpHttpWebSocketHeaderSmallExtendedPayloadLen_size__ 0
            //  4 bytes header for sizes 126 ... 65535
                #define __NetworkTcpHttpWebSocketHeaderMedium__ 1
                #define __NetworkTcpHttpWebSocketHeaderMedium_flag__ 126
                #define __NetworkTcpHttpWebSocketHeaderMediumExtendedPayloadLen_size__ 2
                #define __NetworkTcpHttpWebSocketHeaderMedium_size__ (__NetworkTcpHttpWebSocketHeaderSmall_size__ + __NetworkTcpHttpWebSocketHeaderMediumExtendedPayloadLen_size__)
            // 10 bytes header for sizes more than 65535
                #define __NetworkTcpHttpWebSocketHeaderLong__ 2
                #define __NetworkTcpHttpWebSocketHeaderLong_flag__ 127
                #define __NetworkTcpHttpWebSocketHeaderLongExtendedPayloadLen_size__ 8
                #define __NetworkTcpHttpWebSocketHeaderLong_size__ (__NetworkTcpHttpWebSocketHeaderSmall_size__ + __NetworkTcpHttpWebSocketHeaderLongExtendedPayloadLen_size__)
    // time
        // # __TimeStamp_len__
            // for write time stamp like "00:00:00" as "HH:MM:SS" where HH - hours, MM - minuts, SS - seconds
            #define __TimeStamp_len__ 8
        // Fsec
            #define __Time_nsPerFsec__  0.000_000_001
            #define __Time_usPerFsec__  0.000_001
            #define __Time_msPerFsec__  0.001
        #define __Time_msPerSec__   1000
        #define __Time_msPerS__     1000
        #define __Time_secPerMin__  60
        #define __Time_minPerHour__ 60
        #define __Time_hourPerDay__ 24
        #define __Time_daysPerWeek__ 7
    // formats
        // Hex
            #define __Hex_lenFromBytesLen__(len) (len * 2)
            #define __Hex_bytesLenFromHex__(len) (len >> 1)
        // # __u64FromTextDec_maxLen__
            //#define __u64FromTextDec_maxLen__  __CText_len__("18446744073709551615")
                #define __u64FromTextDec_maxLen__ 20
        // # __TextCharsDecFromU64_lenMax__
            //#define __TextCharsDecFromU64_lenMax__  __CText_len__("18446744073709551615")
                #define __TextCharsDecFromU64_lenMax__  20
    // OsNetwork
        #define __OsNetworkTcp_maxAllowedListenPort__          49151
    // auto unwrap CText to text and len
        // # __OsConsoleOutput_writeCText__
            #define __OsConsoleOutput_writeCText__(  ctx, text)  \
                    __OsConsoleOutput_write__(       ctx, text, __CText_len__(text))
        // # __Terminal_setFontStyleCText__
            #define __Terminal_setFontStyleCText__(  ctx, text)  \
                    __Terminal_setFontStyle__(       ctx, text, __CText_len__(text))
    // auto casting
        // # __Mem_fillAny__
            #define __Mem_fillAny__(        dest, symbol, len) \
                    __Mem_fill__(    (char*)dest, symbol, len)
        // # __OsFile_readToAny__
            #define __OsFile_readToAny__(     file,          buffer,  buffer_len, offset ) \
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
                                terminal->output.font_style = font_style;
                                terminal->output.__TerminalOutput_fontStyleLen__ = font_style_len;
                                __OsConsoleOutput_write__(&terminal->console->output, font_style, font_style_len);
                            }
                        }
                    // # __Terminal_resetColors__
                        void __Terminal_resetColors__(struct __Terminal__  *terminal) {
                            __Terminal_Output_setFontStyleCText__(terminal, __ConsoleAnsiOutputFontStyle_command_reset__);
                        }
                // screen
                    // # __Terminal_updateOutputSize__
                        void __Terminal_updateOutputSize__(struct __Terminal__  *terminal) {
                            struct __Math2dPosU__ size;
                            __OsConsoleOutput_getSize__(&terminal->console->output, &size);
                            







|







4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
                                terminal->output.font_style = font_style;
                                terminal->output.__TerminalOutput_fontStyleLen__ = font_style_len;
                                __OsConsoleOutput_write__(&terminal->console->output, font_style, font_style_len);
                            }
                        }
                    // # __Terminal_resetColors__
                        void __Terminal_resetColors__(struct __Terminal__  *terminal) {
                            __Terminal_setFontStyleCText__(terminal, __ConsoleAnsiOutputFontStyle_command_reset__);
                        }
                // screen
                    // # __Terminal_updateOutputSize__
                        void __Terminal_updateOutputSize__(struct __Terminal__  *terminal) {
                            struct __Math2dPosU__ size;
                            __OsConsoleOutput_getSize__(&terminal->console->output, &size);