Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

definitions again (Developers)

posted by tom Homepage, Germany (West), 21.04.2024, 21:20

> I have another question.
>
> In order to support EBCDIC ANSI X3.64 terminals on a mainframe
> (theoretically they could exist, but I created an emulator
> to do it instead), I need to know the ESC character. So in all
> my code I need to put #define ESC 0x1b for ASCII, and 0x27
> for EBCDIC (from memory).
>
> I think this should instead be in a header file, as:
>
> #define ESC_CHAR 0x1b
>
> #define ESC_STRING "\x1b"
>
Definitively NO. There is no reason *ever* to have a C90 program output
ESC_CHAR.

What you have probably in mind is something similar to

  switch (terminal_detected())
           {
           case VT_100:
              cursor_up_string = "\x1b[A";
              cursor_down_string = "\x1b[B";
              cursor_left_string = "\x1b[A";
              break;

           case EBCDIC_ANSI_X3.64:
              cursor_up_string = "\x27(J";
              ...





> rather than burdening the compiler to recognize '\e' or whatever.
if your compiler is burdened by this, change compiler.




> Do you agree that this should be in an "extended C90",
NO.

> along with those findfirst/findnext functions, and
> if so, should there be a generic header file called
> nonc90.h or something, rather than io.h plus whatever?
call it PAUL.H or KERRAVON.H or WHATEVER.H

the idea that a single person could set a standard is hilarious.
the idea that YOU could set a standard is more sad than hilarious.



Tom

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 165 users online (0 registered, 165 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum