--- os2sdk/demos/apps/terminal/options.c 2018/08/09 12:25:13 1.1.1.1 +++ os2sdk/demos/apps/terminal/options.c 2018/08/09 12:26:00 1.1.1.2 @@ -3,8 +3,7 @@ * TITLE * * options.c - * Copyright (C) Microsoft Corporation 1987 - * March 1987 + * Created by Microsoft Corporation 1987 * * DESCRIPTION * @@ -77,9 +76,12 @@ * */ +#define INCL_DOSSIGNALS +#define INCL_SUB + +#include +#include #include -#include -#include #include #include #include @@ -208,24 +210,24 @@ char *csData[] = { #define nData (sizeof(csData)/sizeof(char*)) #define wData 1 -unsigned char chData[nData] = { +UCHAR chData[nData] = { 7, 8 }; -char *csStop[] = { +NPCH csStop[] = { "1", "2" }; #define nStop (sizeof(csStop)/sizeof(char*)) #define wStop 1 -unsigned char chStop[nStop] = { +UCHAR chStop[nStop] = { 0, 2 }; -char *csParity[] = { +NPCH csParity[] = { "even", " odd", "none" @@ -233,35 +235,35 @@ char *csParity[] = { #define nParity (sizeof(csParity)/sizeof(char*)) #define wParity 4 -unsigned char chParity[nParity] = { +UCHAR chParity[nParity] = { EVEN, ODD, NONE }; -char *csConnect[] = { +NPCH csConnect[] = { "computer", " modem" }; #define nConnect (sizeof(csConnect)/sizeof(char*)) #define wConnect 8 -unsigned char chConnect[nConnect] = { +UCHAR chConnect[nConnect] = { COMPUTER, MODEM }; -char *csDial[] = { +NPCH csDial[] = { " tone", "pulse" }; #define nDial (sizeof(csDial)/sizeof(char*)) #define wDial 5 -unsigned char chDial[nConnect] = { +UCHAR chDial[nConnect] = { TONE, PULSE }; -char *csTone[] = { +NPCH csTone[] = { " 10", " 15", " 20", @@ -281,7 +283,7 @@ char *csTone[] = { #define wTone 3 int iTone[nTone] = {10,15,20,25,50,75,100,125,150,175,200,225,250}; -char *csCarrier[] = { +NPCH csCarrier[] = { "30", "25", "20", @@ -297,7 +299,7 @@ int iCarrier[nCarrier] = {30, 25, 20, 15 #define OT_SET 0 /* Option types */ #define OT_ASCIIZ 1 -unsigned char cMap[256]; +UCHAR cMap[256]; typedef struct { int sc_n; /* number of different values */ @@ -305,7 +307,7 @@ typedef struct { } setControl_s; typedef struct { - unsigned char az_Set; /* flags of valid characters */ + UCHAR az_Set; /* flags of valid characters */ } azControl_s; typedef struct { @@ -397,13 +399,13 @@ char *argv[]; FILE *fp; char OptionsSet = FALSE; /* indicate if options are set */ unsigned RetCode; - static struct ConfigData DispConfigData = {sizeof(DispConfigData),}; + static VIOCONFIGINFO DispConfigData = {sizeof(DispConfigData),}; /* if the display is monochrome, change the attributes */ - if ((RetCode = VIOGETCONFIG(RESERVED,&DispConfigData,RESERVED)) != 0) + if ((RetCode = VioGetConfig(RESERVED,&DispConfigData,RESERVED)) != 0) error(ERR_VIOGETCONFIG, RetCode); - if ((DispConfigData.adapter_type == MONOCHROME) || - (DispConfigData.display_type == MONOCHROME)) { + if ((DispConfigData.adapter == MONOCHROME) || + (DispConfigData.display == MONOCHROME)) { AttrPanel = MONO_PANEL; AttrOption = MONO_OPTION; AttrCursor = MONO_CURSOR; @@ -446,7 +448,7 @@ char *argv[]; show_option(); /* write option settings to the file specified. */ if ((fp = fopen(option[SETUP_FILE].oaz.oaz_str, "w")) != NULL) { - DOSHOLDSIGNAL(DISABLE_SIGNALS); + DosHoldSignal(HLDSIG_DISABLE); fprintf(fp, "%d %d %d %d %d %d %d %d %d \n", option[PORT_NAME].osc, option[BAUD_RATE].osc, option[DATA_BITS].osc, option[STOP_BITS].osc, @@ -456,7 +458,7 @@ char *argv[]; fprintf(fp, "%21s \n", option[PHONE_NUMBER].oaz.oaz_str); fprintf(fp, "%41s \n", option[SETUP_FILE].oaz.oaz_str); fclose(fp); - DOSHOLDSIGNAL(ENABLE_SIGNALS);} + DosHoldSignal(HLDSIG_ENABLE);} } } @@ -573,7 +575,7 @@ clear_screen() c.ch = ' '; c.at = ATTR(WHITE,BLACK); - if ((RetCode = VIOWRTNCELL((char *)(&c), N_of_Rows*N_of_Cols, + if ((RetCode = VioWrtNCell((PBYTE)(&c), N_of_Rows*N_of_Cols, 0, 0, RESERVED)) != 0) error(ERR_VIOWRTNCELL, RetCode); } /* clear_screen */ @@ -671,7 +673,7 @@ show_option() do_option(); clear_screen(); - if ((RetCode = VIOSETCURPOS(0, 0, RESERVED)) != 0) + if ((RetCode = VioSetCurPos(0, 0, RESERVED)) != 0) error(ERR_VIOSETCURPOS, RetCode); } /* show_option */ @@ -694,8 +696,8 @@ show_option() do_option() { - unsigned row, col; - char a; + USHORT row, col; + BYTE a; int RetCode, i, key, @@ -703,7 +705,7 @@ do_option() a = AttrPanel; for (row=0; row