ScalpiEditor

Diff
Login

Diff

Differences From Artifact [c025a9a982]:

To Artifact [dd6a58f59e]:


1104
1105
1106
1107
1108
1109
1110





























1111
1112
1113
1114
1115
1116
1117
                    #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
                }





























        
        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));
                __OsConsoleOutput_write__(&console_output, data, len);
            #elif __target_os__ == __TargetOs_linux__







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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_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);
                            if (result2 != 0) {
                                t->inited = true;
                            } else {
                                ok = false;
                            }
                        } else {
                            ok = false;
                        }
                    #elif __target_os__ == __TargetOs_linux__
                        int result = tcgetattr(input->fileno, &t->termios);
                        if (result == 0) {
                            t->inited = true;
                        } else {
                            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));
                __OsConsoleOutput_write__(&console_output, data, len);
            #elif __target_os__ == __TargetOs_linux__