-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathse-log.cx
More file actions
executable file
·127 lines (127 loc) · 2.99 KB
/
se-log.cx
File metadata and controls
executable file
·127 lines (127 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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
//-*-C-*-
/*******************************************************************************
* ___ public
* ¦OUX¦ C+
* ¦/C+¦ OUX/C+ OS
* --- kernel
* start/exit log
* (c)overcq on WSL\Debian (Linux 6.6.87.2) 2025-12-19 f
*******************************************************************************/
// W przyszłości usunąć możliwość wypisywania z przerwań.
//==============================================================================
_private volatile Pc E_se_log_S_buffer;
_private volatile N E_se_log_S_buffer_l;
_private volatile N E_se_log_S_lines;
//==============================================================================
_private
N
E_se_log_M( void
){ E_se_log_S_buffer_l = 0;
E_se_log_S_buffer = M( E_se_log_S_buffer_l );
if( !E_se_log_S_buffer )
return ~0;
E_se_log_S_lines = 1;
return 0;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_private
N
E_se_log_I_log( Pc scope
, Pc fmt
, ...
){ E_flow_I_cli();
N r;
Pc s_1 = M(1);
if( !s_1 )
{ E_flow_I_sti();
return ~0;
}
*s_1 = '\n';
r = E_text_Z_s_I_append_s0( &s_1, scope );
if( !r )
{ r = ~0;
goto End_0;
}
r = E_text_Z_s_I_append_s0_0( &s_1, ": " );
if( !r )
{ r = ~0;
goto End_0;
}
r = E_text_Z_s_I_append_s0( &E_se_log_S_buffer, s_1 );
if( !r )
{ r = ~0;
goto End_0;
}
E_se_log_S_buffer_l += E_text_Z_s0_R_l( s_1 );
E_se_log_S_lines++;
Pc s_2;
va_list args;
va_start( args, fmt );
r = E_text_I_vsprintf( &s_2, fmt, args );
va_end(args);
if(r)
goto End_0;
r = E_text_Z_s_I_append_s0( &E_se_log_S_buffer, s_2 );
if( !r )
{ r = ~0;
goto End_1;
}
E_se_log_S_buffer_l += E_text_Z_s0_R_l( s_2 );
if( E_emerg_print_S_active )
{ r = E_emerg_print_I_print( s_1 );
if(r)
goto End_1;
r = E_emerg_print_I_print( s_2 );
}else if( E_window_log_S_active )
{ X_A( gui, draw );
X_F( gui, draw );
r = 0;
}else
r = 0;
End_1:
N r_ = W( s_2 );
if( !r )
r = r_;
End_0:
r_ = W( s_1 );
if( !r )
r = r_;
E_flow_I_sti();
return r;
}
_private
N
E_se_log_I_log_( Pc fmt
, ...
){ E_flow_I_cli();
Pc s;
va_list args;
va_start( args, fmt );
N r = E_text_I_vsprintf( &s, fmt, args );
va_end(args);
if(r)
{ E_flow_I_sti();
return r;
}
r = E_text_Z_s_I_append_s0( &E_se_log_S_buffer, s );
if( !r )
{ r = ~0;
goto End_0;
}
E_se_log_S_buffer_l += E_text_Z_s0_R_l(s);
if( E_emerg_print_S_active )
r = E_emerg_print_I_print(s);
else if( E_window_log_S_active )
{ X_A( gui, draw );
X_F( gui, draw );
r = 0;
}else
r = 0;
End_0:
N r_ = W(s);
if( !r )
r = r_;
E_flow_I_sti();
return r;
}
/******************************************************************************/