ScalpiEditor

Diff
Login

Diff

Differences From Artifact [dd6a58f59e]:

To Artifact [1fb7515399]:


1104
1105
1106
1107
1108
1109
1110





























1111
1112
1113
1114
1115
1116
1117
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







                    #elif __target_os__ == __TargetOs_linux__
                        // input->handle = stdout
                        input->fileno = fileno(input->handle);
                    #else
                        #error "not implemented current __target_os__ or not defined. (expected __TargetOs_ value)"
                    #endif
                }
            
            bool __OsConsoleFlags_apply__(
                struct __OsConsoleFlags__  *t, 
                struct Os_Console_Input    *input, 
                struct __OsConsoleOutput__ *output
            ) {
                // expected inited
                
                bool ok = true;
                    #if __target_os__ == __TargetOs_windows__
                        int result1 = SetConsoleMode(input->handle, t->input_mode);
                        if (result1 == 0) {
                            ok = false;
                            // todo GetLastError();
                        }
                        
                        int result2 = SetConsoleMode(output->__OsConsoleOutput_handle__, t->output_mode);
                        if (result2 == 0) {
                            ok = false;
                            // todo GetLastError();
                        }
                    #elif __target_os__ == __TargetOs_linux__
                        tcsetattr(input->fileno,                      TCSANOW, &t->termios);
                        tcsetattr(output->__OsConsoleOutput_fileno__, TCSANOW, &t->termios);
                    #else
                        #error "not implemented current __target_os__ or not defined. (expected __TargetOs_ value)"
                    #endif
                return ok;
            }
            
            bool __OsConsoleFlags_init__(struct __OsConsoleFlags__ *t, struct Os_Console_Input* input, struct __OsConsoleOutput__ *output) {
                bool ok = true;
                    #if __target_os__ == __TargetOs_windows__
                        bool result1 = GetConsoleMode(input->handle, &t->input_mode);
                        if (result1 != 0) {
                            bool result2 = GetConsoleMode(output->__OsConsoleOutput_handle__, &t->output_mode);
1131
1132
1133
1134
1135
1136
1137

1138
1139
1140
1141
1142
1143
1144
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174







+







                            ok = false;
                        }
                    #else
                        #error "not implemented current __target_os__ or not defined. (expected __TargetOs_ value)"
                    #endif
                return ok;
            }
            
            
            
        
        size_t __OsFallbackConsole_write__(void* unused_ctx, char* data, size_t len) {
            #if __target_os__ == __TargetOs_windows__
                struct __OsConsoleOutput__ console_output;
                __OsConsoleOutput_init__(&console_output, GetStdHandle(STD_OUTPUT_HANDLE));