home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
smart21b.zip
/
SMARTAUX
/
WN32PWPC
/
WN32PWPC.DCT
< prev
Wrap
Text File
|
1994-12-12
|
70KB
|
1,446 lines
.Notice =Database dictionary
.Table =Win32 to Workplace OS/2
.Version =1.0
.Date =11/22/94
.Keyword =010 010 300 GetEnvironmentVariable
.SComment=Replace GetEnvironmentVariable with DosGetEnv
.LComment=Replace with DosGetEnv noting that there are differences in
=the returned codes as well as the format of the data
=returned in the buffer. If the call is successful
=GetEnvironmentVariable returns the minimum required size of
=the memory area pointed to by lpszValue in order for this
=buffer to receive the retrieved value of the specified
=environment variable. If unseccessful it returns 0. On the
=other hand, DosGetEnv returns 0 in order to indicate
=success. Anything else indicates an error. The required
=size of the buffer is returned in BufferLength field. This
=may require changes to any logic dependent upon the value of
=the return code. Also note that GetEnvironmentVariable
=retrieves the value of the environment variable specified in
=the lpszName variable and that DosGetEnv retrieves the
=entire environment string. For this reason DosGetEnv does
=not need a parameter which specifies the name of the
=environment variable to query and thus needs only two
=parameters.
.Sample =Win32:
= DWORD rc = GetEnvironmentVariable ("Path", NULL, 0);
= LPTSTR lpszValue = calloc (1, rc);
= rc = GetEnvironmentVariable ("Path", lpszValue, rc);
= ...
=OS/2 for PowerPC:
= ULONG BufferLength = 0;
= APIRET rc = DosGetEnv (&BufferLength, NULL);
= PVOID Buffer = calloc (1, BufferLength);
= rc = DosGetEnv (&BufferLength, Buffer);
= ...
.Prototyp=APIRET APIENTRY DosGetEnv (PULONG BufferLength,
= PVOID Buffer);
.Template=DosGetEnv (&$P3, $P2);
.Refer =DosGetEnv
.Keyword =010 020 999 WriteConsoleOutputCharacter
.SComment=Replace WriteConsoleOutputCharacter with VioWrtCharStr
.LComment=Replace with VioWrtCharStr noting the differences in the
=parameters passed and values returned. The second and third
=parameters of WriteConsoleOutputCharacter correspond to the
=first and second parameters of VioWrtCharStr respectively.
=The first parameter of WriteConsoleOutputCharacter is a
=handle to a screen buffer which was returned by a call to
=CreateConsoleScreenBuffer and this can be mapped to the
=fifth parameter of VioWrtCharStr; however the value of this
=variable will be derived in a different manner. If the
=migrated version will be a Presentation Manager application
=then the value of this variable will be determined in a call
=to VioCreatePS. If it is to be a VIO application then the
=value of this variable will be 0. The values of the third
=and fourth parameters of VioWrtCharStr must be extracted
=from the fourth parameter of WriteConsoleOutputCharacter.
=If the migrated version will be a Presentation Manager
=application then this can be done by including OS2DEF.H and
=converting the Windows COORD type to a POINTL and specifying
=the y field of this structure as the third parameter and the
=x field as the fourth. If the migrated version is to be a
=VIO application instead, then new variables will need to be
=declared and assigned. Finaly, WriteConsoleOutputCharacter
=returns 1 in order to indicate success and 0 in order to
=indicate an error. VioWrtCharStr returns 0 in order to
=indicate success. Any other value indicates an error.
=Because of this it will be necessary to modify any logic
=which is dependent upon the return code.
.Sample =Win32:
= HANDLE hConsoleOutput = CreateConsoleScreenBuffer
= (GENERIC_WRITE,
= FILE_SHARE_READ, lpsa,
= CONSOLE_TEXT_MODE, NULL);
= ...
= COORD coordWriteCoord = {0, 0};
= DWORD lpcWritten;
= BOOL rc = WriteConsoleOutputCharacter
= (hConsoleOutput, "Hello!", 6,
= coordWriteCoord, &lpcWritten);
= ...
=OS/2 for PowerPC:
= HVIO hvps;
= POINTL coordWriteCoord = {0, 0};
= APIRET rc = VioCreatePS (&hvps, 25, 80, 1, 1, 0);
= ...
= rc = VioWrtCharStr ("Hello!", 6, coordWriteCoord.y,
= coordWriteCoord.x, hvps);
= ...
.Prototyp=APIRET APIENTRY VioWrtCharStr (PCH pchStr, ULONG cb,
= ULONG ulRow, ULONG ulColumn,
= HVIO hvio);
.Template=VioCreatePS (&P2, $P3, $P4.y, $P4.x, $P1);
.Template=VioCreatePS (&P2, $P3, , , 0);
.Command =IF $GAPPTYPE = '' THEN
= SmDisplayDlg ('Will the migrated version be a VIO or PM based application?',
= $GAPPTYPE, ~VIO | ~PM | ~Cancel)
=IF $GAPPTYPE = 'PM' THEN
= DO
= SmMigrateKeyword ($T1)
= SmOutputNote = ('Must modify logic dependent upon value returned from VioWrtCharStr')
= END
=ELSE
= DO
= IF $GAPPTYPE = 'VIO' THEN
= DO
= SmMigrateKeyword ($T2)
= SmOutputNote = ('Must modify logic dependent upon return value from VioWrtCharStr')
= END
= END
=TERMINATE
.Refer =VioWrtCharStr
.Keyword =010 040 999 WriteConsoleOutputAttribute
.SComment=Replace WriteConsoleOutputAttribute with VioWrtNAttr
.LComment=Replace with VioWrtNAttr noting the differences in the
=parameters passed, values returned, and functionality. The
=third parameters of WriteConsoleOutputAttribute corresponds
=to the second parameters of VioWrtNAttr. The first
=parameter of WriteConsoleOutputAttribute is a handle to a
=screen buffer which was returned by a call to
=CreateConsoleScreenBuffer and this can be mapped to the
=fifth parameter of VioWrtNAttr; however the value of this
=variable will be derived in a different manner. If the
=migrated version will be a Presentation Manager application
=then the value of this variable will be determined in a call
=to VioCreatePS. If it is to be a VIO application then the
=value of this variable will be 0. The values of the third
=and fourth parameters of VioWrtNAttr must be extracted from
=the fourth parameter of WriteConsoleOutputAttribute If the
=migrated version will be a Presentation Manager application,
=this can be done by including OS2DEF.H and converting the
=Windows COORD type to a POINTL and specifying the y field of
=this structure as the third parameter and the x field as the
=fourth. If the migrated version is to be a VIO application
=instead then new variables will need to be declared and
=assigned. With WriteConsoleOutputAttribute you can specify
=a pointer to an array of attributes in the second parameter.
=This will cause the number of cells specified in the third
=parameter to each receive its attribute from a different
=member of this array. With VioWrtNAttr only one attribute
=can be specified in the first parameter and this will cause
=each of the number of cells specified in the second
=parameter to receive this same attribute. In order to
=overcome this in Workplace OS/2 it will be necessary in the
=migrated code to create a loop with a call to VioWrtNAttr
=inside it and pass a variable into this call which will
=sequentially reference a different element of the array for
=iteration through the loop. Note that the Windows
=attribute macros will have to be mapped to their
=Workplace OS/2 hex counterparts. Finaly,
=WriteConsoleOutputAttribute returns 1 in order to indicate
=success and 0 in order to indicate an error. VioWrtNAttr
=returns 0 in order to indicate success. Any other value
=indicates an error. Because of this it will be necessary to
=modify any logic which is dependent upon the return code.
.Sample =Win32:
= HANDLE hConsoleOutput = CreateConsoleScreenBuffer
= (GENERIC_WRITE,
= FILE_SHARE_READ, lpsa,
= CONSOLE_TEXT_MODE, NULL);
= ...
= COORD coordWriteCoord = {0, 0};
= DWORD lpcWritten;
= WORD wAttribute = FOREGROUND_RED | BACKGROUND_BLUE;
= BOOL rc = WriteConsoleOutputAttribute
= (hConsoleOutput, &wAttribute, 1,
= coordWriteCoord, &lpcWritten);
= ...
=OS/2 for PowerPC:
= HVIO hvps;
= APIRET rc = VioCreatePS (&hvps, 25, 80, 1, 1, 0);
= ...
= POINTL coordWriteCoord = {0, 0};
= BYTE Attr = 0x1E
= rc = VioWrtNAttr (&Attr, 1, coordWriteCoord.y,
= coordWriteCoord.x, hvps);
= ...
.Prototyp=APIRET APIENTRY VioWrtNAttr (PBYTE pAttr, ULONG cb,
= ULONG ulRow, ULONG ulColumn,
= HVIO hvio);
.Template=VioWrtNAttr (, $P3, $P4.y, $P4.x, $P1);
.Template=VioWrtNAttr (, $P3, , , 0);
.Refer =VioWrtNAttr
.Keyword =010 040 999 WriteConsoleOutput
.SComment=Replace WriteConsoleOutput with VioWrtCellStr
.LComment=Replace WriteConsoleOutput with VioWrtCellStr. If the
=rectangular block being written encompasses more than one
=line then it will be necessary to make several calls to
=VioWrtCellStr within a loop in order to emulate this feature.
=of WriteConsoleOutput. Although the parameters are quite
=different between the two calls, you should be able to
=derive the parameters for VioWrtCellStr from those passed to
=WriteConsoleOutput. In the case of the first parameter of
=VioWrtCellStr; if the migrated version will be a
=Presentation Manager application then the value of this
=variable will be determined in a call to VioCreatePS. If it
=is to be a VIO application then the value of this variable
=will be 0. Finaly, WriteConsoleOutput returns 1 in order to
=indicate success and 0 in order to indicate an error.
=VioWrtNAttr returns 0 in order to indicate success. Any
=other value indicates an error. Because of this it will be
=necessary to modify any logic which is dependent upon the
=return code.
.Sample =Win32:
= HANDLE hConsoleOutput = CreateConsoleScreenBuffer
= (GENERIC_WRITE,
= FILE_SHARE_READ, lpsa,
= CONSOLE_TEXT_MODE, NULL);
= ...
= CHAR_INFO chiSrcBuffer;
= ...
= COORD coordSrcBufferSize = {10, 4};
= COORD coordSrcBufferCoord = {5, 15};
= SMALL_RECT psrctDestRect = {8, 3, 18, 7};
= BOOL rc = WriteConsoleOutput (hConsoleOutput,
= &chiSrcBuffer,
= coordSrcBufferSize,
= coordSrcBufferCoord,
= &psrctDestRect);
= ...
=OS/2 for PowerPC:
= HVIO hvps;
= APIRET rc = VioCreatePS (&hvps, 25, 80, 1, 1, 0);
= ...
= PSZ CellStr;
= ...
= rc = VioWrtCellStr (CellStr, 10, 12, 13, hvps);
= ...
.Prototyp=APIRET APIENTRY VioWrtCellStr (PCH pchCellStr, ULONG cb,
= ULONG ulRow, ULONG ulColumn,
= HVIO hvio);
.Template=VioWrtCellStr (, , , , $P1);
.Template=VioWrtCellStr (, , , , 0);
.Refer =VioWrtCellStr
.Keyword =010 040 999 WriteConsoleInput
.SComment=Replace WriteConsoleInput with WinPostMsg
.LComment=Replace WriteConsoleInput with WinPostMsg specifying WM_CHAR
=or one of the mouse button messages, depending on the source
=of the input in the Windows version.
.Sample =Win32:
= HANDLE hConsoleOutput = CreateConsoleScreenBuffer
= (GENERIC_WRITE,
= FILE_SHARE_READ, lpsa,
= CONSOLE_TEXT_MODE, NULL);
= ...
= INPUT_RECORD irBuffer;
= ...
= DWORD cInRecords;
= BOOL rc = WriteConsoleInput (hConsoleOutput, &irBuffer,
= 3, &cInRecords);
= ...
=OS/2 for PowerPC:
= HWND hwnd1;
= MPARAM mp1, mp2;
= ...
= BOOL rc = WinPostMsg (hwnd1, WM_CHAR, mp1, mp2);
= ...
.Prototyp=BOOL APIENTRY WinPostMsg(HWND hwnd, ULONG msg, MPARAM mp1,
= MPARAM mp2);
.Template=WinPostMsg (, , , );
.Refer =WinPostMsg
.Keyword =010 020 999 WriteConsole
.SComment=Replace WriteConsole with VioWrtTTY noting differences
.LComment=Replace WriteConsole with VioWrtTTY noting the differences
=between the two calls in the parameters passed as well as
=the values returned. Note that the first and second
=parameters of VioWrtTTY can be mapped to the second and
=third parameters of WriteConsole. The third parameter of
=VioWrtTTY will be 0 if the migrated version is to be a VIO
=application. If it is a Presentation Manager application
=then the value of this parameter will be returned from a
=call to VioCreatePS. WriteConsole returns 1 in order to
=indicate success and VioWrtTTY returns 0 in order to
=indicate success. Because of this, any code which depends
=on this returned value must be modified.
.Sample =Win32:
= HANDLE hConsoleOutput = CreateConsoleScreenBuffer
= (GENERIC_WRITE,
= FILE_SHARE_READ, lpsa,
= CONSOLE_TEXT_MODE, NULL);
= ...
= DWORD cchWritten;
= BOOL rc = WriteConsole (hConsoleOutput, "Hello!", 6,
= &cchWritten, NULL);
= ...
=OS/2 for PowerPC:
= HVIO hvps;
= APIRET rc = VioCreatePS (&hvps, 25, 80, 1, 1, 0);
= ...
= rc = VioWrtTTY ("Hello!", 6, hvps);
= ...
.Prototyp=APIRET APIENTRY VioWrtTTY (PCH pch, ULONG cb, HVIO hvio);
.Template=VioWrtTTY ($P2, $P3, $P1);
.Template=VioWrtTTY ($P2, $P3, 0);
.Command =IF $GAPPTYPE = '' THEN
= SmDisplayDlg ('Will the migrated version be a VIO or PM based application?',
= $GAPPTYPE, ~VIO | ~PM | ~Cancel)
=IF $GAPPTYPE = 'PM' THEN
= DO
= SmMigrateKeyword ($T1)
= SmOutputNote = ('Must modify logic dependent upon return value from VioWrtTTY')
= END
=ELSE
= DO
= IF $GAPPTYPE = 'VIO' THEN
= DO
= SmMigrateKeyword ($T2)
= SmOutputNote = ('Must modify logic dependent upon return value from VioWrtTTY')
= END
= END
=TERMINATE
.Refer =VioWrtTTY
.Keyword =010 040 999 AllocConsole
.SComment=Replace AllocConsole with VioCreatePS
.LComment=If you are creating a PM application which will use VIO,
=replace AllocConsole with VioCreatePS. VioCreatePS is
=usually issued during WM_CREATE. Before using the
=presentation space be sure to associate it with a device
=context by calling VioAssociate. If you are creating only a
=VIO application (program type WINDOWCOMPAT as opposed to
=WINDOWAPI) then do not use VioCreatePS; simply remove
=AllocConsole.
.Sample =Win32:
= BOOL bOK = AllocConsole();
=OS/2 for PowerPC:
= APIRET Error;
= HVIO hvps;
= ULONG Rows = 25;
= ULONG Columns = 80;
= Error = VioCreatePS (&hvps, Rows, Columns, 2, 1, 0);
.Prototyp=APIRET APIENTRY VioCreatePS (PHVIO phvps, ULONG Rows,
= ULONG Columns, ULONG Format,
= ULONG AttrBytes, HVIO hvps);
.Template=VioCreatePS (, , , , , );
.Refer =VioCreatePS
.Refer =VioAssociate
.Refer =$CreateConsoleScreenBuffer
.Keyword =010 040 999 CreateConsoleScreenBuffer
.SComment=Replace CreateConsoleScreenBuffer with VioCreatePS
.LComment=If you are creating a PM application which will use VIO,
=replace CreateConsoleScreenBuffer with VioCreatePS.
=VioCreatePS is usually issued during WM_CREATE. Before
=using the presentation space be sure to associate it with a
=device context by calling VioAssociate. If you are creating
=only a VIO application (program type WINDOWCOMPAT as opposed
=to WINDOWAPI) then do not use VioCreatePS; simply remove
=AllocConsole.
.Sample =Win32:
= HANDLE hConsole;
= SECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES),
= NULL, TRUE };
= hConsole=CreateConsoleScreenBuffer(GENERIC_READ |
= GENERIC_WRITE, 0, &sa, CONSOLE_TEXTMODE_BUFFER, NULL);
= SetConsoleActiveScreenBuffer(hConsole);
=OS/2 for PowerPC:
= HDC hdc;
= HVPS hvps;
= hdc = WinOpenWindowDC (hwnd) ;
= VioCreatePS ((PHVPS)&hvps, (SHORT) NUMLINES,
= (SHORT) MAXWIDTH, (SHORT) 0, (SHORT) 1,
= (HVPS) NULL) ;
= VioAssociate (hdc, hvps) ;
.Prototyp=APIRET VioCreatePS(PHVIO phvps, ULONG Rows, ULONG Columns,
= ULONG Format, ULONG AttrBytes, HVIO hvps);
.Template=VioCreatePS (&$KRTN, , , , , );
.Refer =VioCreatePS
.Refer =VioAssociate
.Refer =$AllocConsole
.Keyword =010 030 999 FlushConsoleInputBuffer
.SComment=Replace FlushConsoleInputBuffer with MouFlushQue and KbdFlushBuffer
.LComment=If your program is a PM application(WINDOWAPI), simply
=remove FlushConsoleInputBuffer. For VIO applications
=(WINDOWAPI) replace with MouFlushQue and KbdFlushBuffer.
.Sample =Win32:
= FlushConsoleInputBuffer(hConsole);
=OS/2 for PowerPC:
= MouFlushQue(hMouse);
= KbdFlushBuffer(hkbd);
.Prototyp=APIRET KbdFlushBuffer(HKBD);
=APIRET MouFlushQue(HMOU);
.Template=KbdFlushBuffer();
=MouFlushQue();
.Refer =MouFlushQue
.Refer =MouFlushBuffer
.Keyword =010 010 999 FreeConsole
.SComment=Replace FreeConsole with VioAssociate
.LComment=If you are creating a PM application which will use VIO,
=replace FreeConsole with VioAssociate, specifying
=NULLHANDLE as the device context handle. The value for the
=second parameter (hvps) comes from a call to VioCreatePS.
=If you are creating only a VIO application(program type
=WINDOWCOMPAT as opposed to WINDOWAPI) then do not use
=VioAssoicate; simply remove FreeConsole.
.Sample =Win32:
= BOOL bOK = FreeConsole();
=OS/2 for PowerPC:
= sError = VioAssociate (NULLHANDLE, hvps);
.Prototyp=APIRET VioAssociate(HDC hdc, HVIO hvps);
.Template=VioAssociate(NULL, );
.Refer =VioAssociate
.Refer =VioCreatePS
.Keyword =010 010 999 GetConsoleCursorInfo
.SComment=Replace GetConsoleCursorInfo with VioGetCurType
.LComment=Replace GetConsoleCursorInfo with VioGetCurType.
.Sample =Win32:
= CONSOLE_CURSOR_INFO CursorInfo;
= GetConsoleCursorInfo(hConsole, &CursorInfo);
=OS/2 for PowerPC:
= VIOCURSORINFO CursorData;
= VioGetCurType(&CursorData, hvps);
.Prototyp=APIRET APIENTRY VioGetCurType
= (PVIOCURSORINFO pvioCursorInfo, HVIO hvio);
.Template=VioGetCurType($P2, $P1);
.Refer =VioSetCurType
.Refer =VioGetCurType
.Refer =$SetConsoleCursorInfo
.Keyword =010 020 999 GetConsoleOutputCP
.SComment=Replace GetConsoleOutputCP with VioGetCp
.LComment=For a VIO application the HVIO parameter must be zero. Must
=modify logic dependent upon returned value.
.Sample =Win32:
= UNIT CodePage;
= CodePage = GetConsoleOutputCP();
=OS/2 for PowerPC:
= USHORT CodePage;
= VioGetCp(0, &CodePage, hvps);
.Prototyp=APIRET VioGetCp(ULONG Reserved, PUSHORT CodePage,
= HVIO hvio);
.Template=VioGetCp(0, &$KRTN, )
=VioGetCp(0, &$KRTN, 0)
.Command =IF $GAPPTYPE = '' THEN
= SmDisplayDlg ('Will the migrated version be a VIO or PM based application?',
= $GAPPTYPE, ~VIO | ~PM | ~Cancel)
=IF $GAPPTYPE = 'PM' THEN
= DO
= SmMigrateKeyword ($T1)
= SmOutputNote = ('Provide new return variable for VioGetCp. Third parameter HVIO from VioCreatePS.')
= END
=ELSE
= DO
= IF $GAPPTYPE = 'VIO' THEN
= DO
= SmMigrateKeyword ($T2)
= SmOutputNote = ('Provide new return variable for VioGetCp. Third parameter HVIO from VioCreatePS.')
= END
= END
=TERMINATE
.Refer =VioSetCp
.Refer =$SetConsoleOutputCP
.Keyword =010 040 999 GetConsoleScreenBufferInfo
.SComment=Replace VioGetOrigin, VioGetCurPos and VioGetMode.
.LComment=VioGetOrigin will return the position in the
=presentation space which maps to the first row and column
=of the window. VioGetCurPos returns the coordinates of the
=cursor. VioGetMode returns the size of the screen buffer, but
=only if the application is of type WINDOWCOMP; i.e.
=not a Presentation Manager application. The size of the
=screen buffer associated with the window cannot be changed
=in a Presentation Manager application.
.Sample =Win32:
= CONSOLE_SCREEN_BUFFER_INFO consoleBuffer;
= GetConsoleScreenBufferInfo(hConsole, &consoleBuffer);
=OS/2 for PowerPC:
= ULONG ORow, OColumn, CurRow, CurColumn;
= VIOMODEINFO vioMode
= VioGetOrigin(&ORow, &OColumn, hvps);
= VioGetCurPos(&CurRow, &CurColumn, hvps);
= VioGetMode(&vioMode, hvps);
.Prototyp=APIRET APIENTRY VioGetOrigin(PULONG Row, PULONG Column,
= HVIO hvps);
=APIRET APIENTRY VioGetMode (PVIOMODEINFO pvioModeInfo,
= HVIO hvio);
=APIRET APIENTRY VioGetCp (ULONG ulReserved,
= PUSHORT pIdCodePage, HVIO hvio);
.Template=VioGetOrigin(, , )
=VioGetCurPos(, , )
=VioGetMode(, )
.Refer =VioGetOrigin
.Refer =VioGetMode
.Refer =VioGetCurPos
.Refer =$SetConsoleWindowInfo
.Keyword =030 040 999 GetConsoleTitle
.SComment=Replace GetConsoleTitle with WinGetWindowText
.LComment=WinGetWindowText is only appropriate for Presentation
=Manager applications.
.Sample =Win32:
= CHAR Buffer[45];
= GetConsoleTitle(Buffer, sizeof(Buffer));
=OS/2 for PowerPC:
= CHAR Buffer[45];
= WinQueryWindowText(hwndFrame, sizeof(Buffer), Buffer);
.Prototyp=APIRET APIENTRY WinQueryWindowText(HWND hwnd, ULONG length,
= PCH pchBuffer);
.Template=WinQueryWindowText(, , );
.Refer =WinQueryWindowText
.Keyword =010 020 999 GetNumberOfConsoleMouseButtons
.SComment=Replace GetNumberOfConsoleMouseButtons with MouGetNumButtons.
.LComment=MouGetNumButtons is only appropriate for VIO programs not
=for Presentation Manager programs. Notice the return value
=differences between the two functions. Modify any logic
=dependent upon the returned value.
.Sample =Win32:
= DWORD lpcMouseButtons;
= GetNumberOfMouseButtons(&MouseButtons);
=OS/2 for PowerPC:
= ULONG numButtons;
= HMOU hMouse;
= MouGetNumButtons(&numButtons, hMouse);
.Prototyp=APIRET APIENTRY MouGetNumButtons(PULONG number, HMOU hMouse);
.Template=MouGetNumButtons ($P1, 0)
.Refer =MouGetNumButtons
.Keyword =030 040 999 PeekConsoleInput
.SComment=Replace PeekConsoleInput with KbdConsole or WinPeekMsg
.LComment=For VIO applications replace PeekConsoleInput with
=KbdGetConsole, specifying 2 for the flag parameter.
=KbdGetConsole returns one and only one event.
=KbdGetConsole cannot be used in Presentation Manager
=applications. For Presentation Manager applications use
=WinPeekMsg.
.Sample =Win32:
= INPUT_RECORD inRecord;
= DWORD numRead;
= PeekConsoleInput(hConsole, &inRecord, 1, &numRead);
=OS/2 for PowerPC:
= typedef union _EVENT {
= KBDKEYINFO KeyInfo;
= MOUQUEINFO MouInfo; } EVENT;
= EVENT Event;
= ULONG Type;
= UHSORT Character;
= ULONG MouState;
= KbdGetConsole(Data, &Type, 2, hKbd);
= if (Type == 2) {
= Character = Event.KeyInfo.chChar;
= . . .
= }
= else if (Type == 3)
= MouState = Event.MouInfo.fs;
= . . .
= }
.Prototyp=APIRET APIENTRY KbdGetConsole(PVOID Data, PULONG Kind, ULONG Flag,
= HKBD hKbd);
=BOOL APIENTRY WinPeekMsg(HAB hab, PQMSG pqmsg,
= HWND hwndFilter,
= ULONG msgFilterFirst,
= ULONG msgFilterLast, ULONG fl);
.Template=KbdGetConsole(, , , );
=WinPeekMsg(, , , , , );
.Refer =WinPeekMsg
.Refer =KbdGetConsole
.Keyword =030 040 999 ReadConsoleInput
.SComment=Replace with WinGetMsg or KbdGetConsole
.LComment=For VIO applications use KbdGetConsole, specifying 1 for
=the flag; for Presentation Manager applications use
=WinGetMsg.
.Sample =Win32:
= INPUT_RECORD inRecord;
= DWORD numRead;
= ReadConsoleInput(hConsole, &inRecord, 1, &numRead);
=OS/2 for PowerPC:
= typedef union _EVENT {
= KBDKEYINFO KeyInfo;
= MOUQUEINFO MouInfo; } EVENT;
= EVENT Event;
= ULONG Type;
= UHSORT Character;
= ULONG MouState;
= KbdGetConsole(Data, &Type, 1, hKbd);
= if (Type == 2) {
= Character = Event.KeyInfo.chChar;
= . . .
= }
= else if (Type == 3)
= MouState = Event.MouInfo.fs;
= . . .
= }
.Prototyp=APIRET KbdGetConsole(PVOID Data, PULONG Kind, ULONG Flag,
= HKBD hKbd);
=BOOL APIENTRY WinGetMsg(HAB hab, PQMSG pqmsg,
= HWND hwndFilter,
= ULONG msgFilterFirst,
= ULONG msgFilterLast);
.Template=KbdGetConsole(, , , );
.Template=WinGetMsg(, , , , );
.Refer =WinPeekMsg
.Refer =WinGetMsg
.Refer =KbdGetConsole
.Keyword =030 040 999 ReadConsoleOutput
.SComment=Replace ReadConsoleOutput with VioReadCellStr
.LComment=Replace ReadConsoleOutput with VioReadCellStr
.Sample =Win32:
= CHAR_INFO Buffer[10];
= SMALL_RECT small_rect = { 0, 0, 0, 10};
= COORD BufSize = { 1, 10 };
= COORD DestBuf = { 0, 0 };
= ReadConsoleOutput(hConsole, &Buffer, &BufSize, &DestBuf,
= Buffer, &small_rect);
=OS/2 for PowerPC:
= CH CellStr[10];
= ULONG Length = 10;
= VioReadCellStr(CellStr, &Length, 0, 0, hvps);
.Prototyp=APIRET VioReadCellStr(PCH CellStr, PULONG Length,
= ULONG Row, ULONG Column, hvps);
.Template=VioReadCellStr(, , , , );
.Refer =VioReadCellStr
.Refer =VioWrtCellStr
.Keyword =030 020 999 ReadConsoleOutputCharacter
.SComment=Replace ReadConsoleOutputCharacter with VioReadCharStr.
.LComment=Replace ReadConsoleOutputCharacter with VioReadCharStr. Be
=sure to provide two ULONG parameters derived from the COORD
=structure passed to ReadConsoleOutputCharacter. Modify any
=logic dependent upon the return code. The value of the
=fifth parameter to VioReadCharStr depends on whether the
=migrated version is PM or VIO.
.Sample =Win32:
= char Buffer[20];
= DWORD NumRead;
= COORD StartCoord = { 0, 0 };
= ReadConsoleOutputCharacter(hConsole, Buffer, 20,
= StartCoord, &NumRead);
=OS/2 for PowerPC:
= char Buffer[20];
= ULONG Length = 20;
= VioReadCharStr(Buffer, &Length, 0, 0, hvps);
.Prototyp=APIRET APIENTRY VioReadCharStr (PCH pchCellStr, PULONG pcb,
= ULONG ulRow, ULONG ulColumn,
= HVIO hvio);
.Template=VioReadCharStr($P2, $P3, , , $P1)
=VioReadCharStr($P2, $P3, , , 0)
.Command =IF $GAPPTYPE = '' THEN
= SmDisplayDlg ('Will the migrated version be a VIO or PM based application?',
= $GAPPTYPE, ~VIO | ~PM | ~Cancel)
=IF $GAPPTYPE = 'PM' THEN
= DO
= SmMigrateKeyword ($T1)
= SmOutputNote = ('Modify logic dependent upon the value returned from VioReadCharStr.')
= END
=ELSE
= DO
= IF $GAPPTYPE = 'VIO' THEN
= DO
= SmMigrateKeyword ($T2)
= SmOutputNote = ('Modify logic dependent upon the value returned from VioReadCharStr.')
= END
= END
=TERMINATE
.Refer =VioReadCharStr
.Refer =VioReadCellStr
.Keyword =030 020 999 ScrollConsoleScreenBuffer
.SComment=Replace with VioScrolIUp, VioScrollDown, VioScrollLeft or VioScrollRight.
.LComment=The VIO scroll functions do not use a clipping rectangle.
=They employ an integral value to indicate the number of
=lines to scroll the rectangle specified. The parameters
=for the VIO APIs must be derived from the parameters of
=ScrollConsoleScreenBuffer. Be sure to modify any code
=which is dependent upon the value returned.
.Sample =Win32:
= SMALL_RECT srcScrollRect, srctClipRect;
= CHAR_INFO chiFill;
= COORD coordDest;
= CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
= GetConsoleBufferInfo(hStdOut, &csbiInfo);
= srctScrollRect.Top = csbiInfo.dwSize.Y - 16;
= srctScrollRect.Bottom = csbiInfo.dwSize.Y - 1;
= srctScrollRect.Left = 0;
= srctScrollRect.Right = csbiInfo.dwSize.X - 1;
= /* The destination for the scroll rectangle is one row up. */
= coordDest.X = 0;
= coordDest.Y = csbiInfo.dwSize.Y - 17;
= /* The clipping rectangle is the same as the scrolling
= rectangle. The destination row is left unchanged. */
= srctClipRect = srctScrollRect;
= /* Fill the bottom row with green blanks. */
= chiFill.Attributes = BACKGROUND_GREEN | FOREGROUND_RED;
= chiFill.Char.AsciiChar = ' ';
= /* Scroll up one line. */
= ScrollConsoleScreenBuffer(
= hStdout, /* screen buffer handle */
= &srctScrollRect, /* scrolling rectangle */
= &srctClipRect, /* clipping rectangle */
= coordDest, /* top left destination cell*/
= &chiFill); /* fill character and color */
=OS/2 for PowerPC:
= HVIO hvps;
= ULONG Rows = 25;
= ULONG Columns = 80;
= ULONG TopRow, LeftCol, BotRow, RightCol;
= BYTE bCell[2];
= VioCreatePS(&hvps, Rows, Columns, 2, 1, 0);
= . . .
= TopRow = Rows - 15 - 1;
= LeftCol = 0;
= RightCol = 79;
= BotRow = Rows - 1;
= bCell[0] = 0x20;
= bCell[1] = ( 0x01 << 4 ) + 0x0F;
= VioScrollUp(TopRow, LeftCol, BotRow, RightCol, 1, bCell,
= hvps);
.Prototyp=APIRET APIENTRY VioScrollUp (ULONG ulTopRow,
= ULONG ulLeftCol, LONG ulBotRow,
= ULONG ulRightCol,
= ULONG cbLines, PBYTE pCell,
= HVIO hvio);
=APIRET APIENTRY VioScrollDown (ULONG ulTopRow,
= ULONG ulLeftCol,
= ULONG ulBotRow,
= ULONG ulRightCol,
= ULONG cbLines, PBYTE pCell,
= HVIO hvio);
=APIRET APIENTRY VioScrollLeft (ULONG ulTopRow,
= ULONG ulLeftCol,
= ULONG ulBotRow,
= ULONG ulRightCol,
= ULONG cbCol, PBYTE pCell,
= HVIO hvio);
=APIRET APIENTRY VioScrollRight (ULONG ulTopRow,
= ULONG ulLeftCol,
= ULONG ulBotRow,
= ULONG ulRightCol,
= ULONG cbCol, PBYTE pCell,
= HVIO hvio);
.Template=VioScrollUp(, , , , , , )
.Template=VioScrollDown(, , , , , , )
.Template=VioScrollLeft(, , , , , , )
.Template=VioScrollRight(, , , , , , )
.Refer =VioScrollUp
.Refer =VioScrollDown
.Refer =VioScrollLeft
.Refer =VioScrollRight
.Refer =$SetConsoleWindowInfo
.Keyword =010 020 999 SetConsoleActiveScreenBuffer
.SComment=Replace SetConsoleActiveScreenBuffer with VioAssociate
.LComment=VioAssociate is only needed for Presentation Manager
=applications. It is not needed for VIO applications.
.Sample =Win32:
= HANDLE hConsole;
= SECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES),
= NULL, TRUE };
= hConsole=CreateConsoleScreenBuffer(GENERIC_READ |
= GENERIC_WRITE, 0, &sa, CONSOLE_TEXTMODE_BUFFER, NULL);
= SetConsoleActiveScreenBuffer(hConsole);
=OS/2 for PowerPC:
= HDC hdc;
= HVPS hvps;
= hdc = WinOpenWindowDC (hwnd) ;
= VioCreatePS ((PHVPS)&hvps, (SHORT) NUMLINES,
= (SHORT) MAXWIDTH, (SHORT) 0, (SHORT) 1,
= (HVPS) NULL) ;
= VioAssociate (hdc, hvps) ;
.Prototyp=APIRET APIENTRY VioAssociate(HDC hdc, HVIO hvps);
.Template=VioAssociate(, $P1)
.Command =SmMigrateKeyword ($T1)
=SmOutputNote ('Provide hdc parameter for VioAssociate.')
.Refer =VioAssoicate
.Refer =VioCreatePS
.Refer =$CreateActiveScreenBuffer
.Keyword =010 040 999 SetConsoleCursorInfo
.SComment=Replace SetConsoleCursorInfo with VioSetCurType
.LComment=If you creating a VIO application, replace
=SetConsoleCursorInfo with VioSetCurType.
=To set the CURSORDATA fields indicating CursorStartLine
=and CursorEndLine independent of the number of scan lines
=for each character cell, you may specify these parameters
=as percentages. Workplace OS then calculates the physical
=start and end scan lines, respectively, by multiplying the
=percentage specified for the parameter by the total number
=of scan lines in the character cell and rounding to the
=nearest scan line. Percentages are specified as negative
=values (or 0) in the range 0 through -100. Specifying
=CursorStartLine -90 and CursorEndLine -100 requests a cursor
=that occupies the bottom 10 percent of the character cell.
=Most of the fields of the VIOCURSORINFO structure can be
=initialized based on the fields of the CONSOLE_CURSOR_INFO
=structure.
.Sample =Win32:
= CONSOLE_CURSOR_INFO cursorInfo;
= cursorInfo = { 1, TRUE };
= SetConsoleCursorInfo(hConsole, &cursorInfo);
=OS/2 for PowerPC:
= VIOCURSORINFO cursorInfo;
= cursorInfo = { -90, -100, 1, 0 };
= VioSetCurType(&cursorInfo, hvps);
.Prototyp=APIRET APIENTRY VioSetCurType
= (PVIOCURSORINFO pvioCursorInfo, HVIO hvio);
.Template=VioSetCurType($P2, $P1)
=VioSetCurType($P2, 0)
.Command =IF $GAPPTYPE = '' THEN
= SmDisplayDlg ('Will the migrated version be a VIO or PM based application?',
= $GAPPTYPE, ~VIO | ~PM | ~Cancel)
=IF $GAPPTYPE = 'PM' THEN
= DO
= SmMigrateKeyword ($T1)
= SmOutputNote = ('Modify logic dependent upon the value returned from VioSetCurType.')
= END
=ELSE
= DO
= IF $GAPPTYPE = 'VIO' THEN
= DO
= SmMigrateKeyword ($T2)
= SmOutputNote = ('Modify logic dependent upon the value returned from VioSetCurType.')
= END
= END
=TERMINATE
.Refer =VioSetCurType
.Refer =VioGetCurType
.Keyword =010 020 999 SetConsoleCursorPosition
.SComment=Replace SetConsoleCursorPosition with VioSetCurPos.
.LComment=Replace SetConsoleCursorPosition with VioSetCurPos. The
=values of the third and fourth parameters of VioWrtCharStr
=must be extracted from the fourth parameter of
=WriteConsoleOutputCharacter. If the migrated version will
=be a Presentation Manager application then this can be done
=by including OS2DEF.H and converting the Windows COORD type
=to a POINTL and specifying the y field of this structure as
=the third parameter and the x field as the fourth. If the
=migrated version is to be a VIO application instead, then
=new variables will need to be declared and assigned. Finaly
=WriteConsoleOutputCharacter returns 1 in order to indicate
=success and 0 in order to indicate an error. VioWrtCharStr
=returns 0 in order to indicate success. Any other value
=indicates an error. Because of this it will be necessary to
=modify any logic which is dependent upon the return code.
.Sample =Win32:
= COORD coord = { 10, 10 };
= SetConsoleCursorPosition(hConsole, coord);
=OS/2 for PowerPC:
= VioSetCurPos(10, 10, hvps);
.Prototyp=APIRET APIENTRY VioSetCurPos (ULONG Row, ULONG Column, HVIO hvps);
.Template=VioSetCurPos ($P2.y, $P2.x, $P1)
=VioSetCurPos ($P2.y, $P2.x, 0)
.Command =IF $GAPPTYPE = '' THEN
= SmDisplayDlg ('Will the migrated version be a VIO or PM based application?',
= $GAPPTYPE, ~VIO | ~PM | ~Cancel)
=IF $GAPPTYPE = 'PM' THEN
= DO
= SmMigrateKeyword ($T1)
= SmOutputNote = ('Modify logic dependent upon the value returned from VioSetCurPos.')
= END
=ELSE
= DO
= IF $GAPPTYPE = 'VIO' THEN
= DO
= SmMigrateKeyword ($T2)
= SmOutputNote = ('Modify logic dependent upon the value returned from VioSetCurPos.')
= END
= END
=TERMINATE
.Refer =VioSetCurPos
.Keyword =010 020 999 SetConsoleOutputCP
.SComment=SetConsoleOutputCP with VioSetCp
.LComment=The codepage must be a valid Workplace OS codepage. Provide
=the proper HVIO for the third parameter of VioSetCp.
.Sample =Win32:
= UINT IDCodePage;
= ...
= BOOL rc = SetConsoleOutputCP (IDCodePage);
=OS/2 for PowerPC:
= HVIO hvps;
= APIRET rc = VioCreatePS (&hvps, 25, 80, 1, 1, 0);
= USHORT CodePageID;
= ...
= APIRET rc = VioSetCp (0, CodePageID, hvps);
= ...
.Prototyp=APIRET APIENTRY VioSetCp (ULONG ulReserved,
= USHORT idCodePage, HVIO hvio);
.Template=VioSetCp (0, $P1, )
=VioSetCp (0, $P1, 0)
.Command =IF $GAPPTYPE = '' THEN
= SmDisplayDlg ('Will the migrated version be a VIO or PM based application?',
= $GAPPTYPE, ~VIO | ~PM | ~Cancel)
=IF $GAPPTYPE = 'PM' THEN
= DO
= SmMigrateKeyword ($T1)
= SmOutputNote = ('Modify logic dependent upon the value returned from VioSetCp.')
= END
=ELSE
= DO
= IF $GAPPTYPE = 'VIO' THEN
= DO
= SmMigrateKeyword ($T2)
= SmOutputNote = ('Modify logic dependent upon the value returned from VioSetCp.')
= END
= END
=TERMINATE
.Refer =VioGetCp
.Refer =VioSetCp
.Refer =$GetConsoleOutputCP
.Keyword =010 020 999 SetConsoleScreenBufferSize
.SComment=Replace SetConsoleScreenBufferSize with VioSetMode
.LComment=The screen buffer size cannot be changed in Presentation
=Manager applications. VioSetMode cannot be use in
=Presentation Manager applications. Derive the values for
=the necessary fields in the VIOMODEINFO parameter of
=VioSetMode from the fields in the COORD parameter of
=SetConsoleScreenBufferSize. The second parameter of
=VioSetMode will be 0 if the migrated version is to be a VIO
=application. If it is a Presentation Manager application
=then the value of this parameter will be returned from a
=call to VioCreatePS.
.Sample =Win32:
= CONSOLE_SCREEN_BUFFER_INFO buffer;
= COORD coord;
= GetConsoleScreenBufferInfo(hConsole, &buffer);
= coord = buffer.dwSize;
= coord.x -= 1;
= coord.y -= 1;
= SetConsoleScreenBufferSize(hConsole, &buffer);
=OS/2 for PowerPC:
= VIOMODEINFO vioMode;
= VioGetMode(&vioMode, hvps);
= vioMode.row -= 1;
= vioMode.col -= 1;
= VioSetMode(&vioMode, hvps);
.Prototyp=APIRET APIENTRY VioSetMode (PVIOMODEINFO pvioModeInfo,
= HVIO hvio);
.Template=VioSetMode ($P2, $P1)
=VioSetMode ($P2, 0)
.Command =IF $GAPPTYPE = '' THEN
= SmDisplayDlg ('Will the migrated version be a VIO or PM based application?',
= $GAPPTYPE, ~VIO | ~PM | ~Cancel)
=IF $GAPPTYPE = 'PM' THEN
= DO
= SmMigrateKeyword ($T1)
= SmOutputNote = ('Modify logic dependent upon the value returned from VioSetMode.')
= END
=ELSE
= DO
= IF $GAPPTYPE = 'VIO' THEN
= DO
= SmMigrateKeyword ($T2)
= SmOutputNote = ('Modify logic dependent upon the value returned from VioSetMode.')
= END
= END
=TERMINATE
.Refer =VioSetMode
.Refer =VioGetMode
.Refer =$GetConsoleScreenBufferInfo
.Keyword =030 030 999 SetConsoleTitle
.SComment=Replace SetConsoleTitle with WinSetWindowText
.LComment=WinSetWindowText is only appropriate for Presentation
=Manager applications. Must query the frame window handle
=and provide this as the first parameter to WinSetWindowText.
.Sample =Win32:
= char *pszTitle = "Sample Title";
= SetConsoleTitle(hConsole, (LPTSTR) pszTitle);
=OS/2 for PowerPC:
= HWND hwndFrame;
= char *pszTitle = "Sample Title";
= hwndFrame = WinQueryWindow(hwndClient, QW_PARENT);
= WinSetWindowText(hwndFrame, pszTitle);
.Prototyp=BOOL APIENTRY WinSetWindowText(HWND hwnd, PSZ pszText);
.Template=WinSetWindowText(, $P1)
.Refer =WinSetWindowText
.Refer =$GetConsoleTile
.Keyword =010 030 999 SetConsoleWindowInfo
.SComment=Replace SetConsoleWindowInfo with VioSetOrigin
.LComment=The Row and Column parameters to VioSetOrigin specify
=the new absolute Row and Column. These must be derived from
=the third parameter of SetConsoleWindowInfo. The third
=parameter of VioSetOrigin will be 0 if the migrated version
=is to be a VIO application. If it is a Presentation Manager
=application then the value of this parameter will be
=returned from a call to VioCreatePS. Be sure to modify any
=logic which is dependent upon the value returned.
.Sample =Win32:
= SMALL_RECT smRect = { 10, 0, 40, 79 };
= SetConsoleWindowInfo(hConsole, TRUE, &smRect);
=OS/2 for PowerPC:
= VioSetOrigin(10, 0, hvps);
.Prototyp=APIRET APIENTRY VioSetOrigin(ULONG Row, ULONG Column,
= HVIO hvps);
.Template=VioSetOrigin(, , $P1)
=VioSetOrigin(, , 0)
.Refer =VioGetOrigin
.Refer =$GetConsoleScreenBufferInfo
.Keyword =010 030 570 GetLocaleInfoW
.SComment=Replace with UniQueryLocaleInfo or UniQueryLocaleItem
.LComment=Replace with UniQueryLocaleInfo or UniQueryLocaleItem depending on the type
=of information being requested. If the lcType parameter of the original call
=is requesting information about time or date then UniQueryLocaleItem should
=be used to replace this keyword, else UniQueryLocaleInfo should be used.
=The proper migration for each of the keywords is as follows:
=
=UniQueryLocaleInfo
=******************
=A locale object handle obtained from a previous call to UniCreateLocaleObject
=must be inserted for the first parameter. The second parameter must be the
=address of a pointer to a UniLconv structure. The memory for the structure is
=automatically allocated by the function call. It is the application's
=responsibility to free the memory with the UniFreeLocaleInfo function when the
=UniLconv structure is no longer needed. The member of the UniLconv structure
=that contains the same information as the requested LCTYPE can be determined
=with the mapping below:
=
= LCTYPE Structure Member
= ------ ----------------
= LOCALE_SDECIMAL UniChar *decimal_point
= LOCALE_STHOUSAND UniChar *thousands_sep
= LOCALE_SGROUPING UniChar *grouping
= LOCALE_SINTLSYMBOL UniChar *int_curr_symbol
= LOCALE_SCURRENCY UniChar *currency_symbol
= LOCALE_SMONDECIMALSEP UniChar *mon_decimal_point
= LOCALE_SMONTHOUSANDSEP UniChar *mon_thousands_sep
= LOCALE_SMONGROUPING UniChar *mon_grouping
= LOCALE_SPOSITIVESIGN UniChar *positive_sign
= LOCALE_SNEGATIVESIGN UniChar *negative_sign
= LOCALE_IINTLCURRDIGITS UniChar int_frac_digits
= LOCALE_ICURRDIGITS UniChar frac_digits
= LOCALE_IPOSSYMPRECEDES UniChar p_cs_precedes
= LOCALE_IPOSSEPBYSPACE UniChar p_sep_by_space
= LOCALE_INEGSYMPRECEDES UniChar n_cs_precedes
= LOCALE_INEGSEPBYSPACE UniChar n_sep_by_space
= LOCALE_IPOSSIGNPOSN UniChar p_sign_posn
= LOCALE_INEGSIGNPOSN UniChar n_sign_posn
=
=UniQueryLocaleItem
=******************
=A locale object handle obtained from a previous call to UniCreateLocaleObject
=must be inserted for the first parameter. The second parameter must be the
=informational item to be retrieved. The last parameter is the address of a
=pointer that points to the start of the target string. The item constant name
=to obtain the information requested with LCTYPE can be determined with the
=mapping below:
=
= LCTYPE Item Constant Name
= ------ ------------------
= LOCALE_SSHORTDATE D_FMT
= LOCALE_STIMEFORMAT T_FMT
= LOCALE_S1159 AM_STR
= LOCALE_S2359 PM_STR
= LOCALE_SDAYNAME7 DAY_1
= LOCALE_SDAYNAME1 DAY_2
= LOCALE_SDAYNAME2 DAY_3
= LOCALE_SDAYNAME3 DAY_4
= LOCALE_SDAYNAME4 DAY_5
= LOCALE_SDAYNAME5 DAY_6
= LOCALE_SDAYNAME6 DAY_7
= LOCALE_SABBREVDAYNAME7 ABDAY_1
= LOCALE_SABBREVDAYNAME1 ABDAY_2
= LOCALE_SABBREVDAYNAME2 ABDAY_3
= LOCALE_SABBREVDAYNAME3 ABDAY_4
= LOCALE_SABBREVDAYNAME4 ABDAY_5
= LOCALE_SABBREVDAYNAME5 ABDAY_6
= LOCALE_SABBREVDAYNAME6 ABDAY_7
= LOCALE_SMONTHNAME1 MON_1
= LOCALE_SMONTHNAME2 MON_2
= LOCALE_SMONTHNAME3 MON_3
= LOCALE_SMONTHNAME4 MON_4
= LOCALE_SMONTHNAME5 MON_5
= LOCALE_SMONTHNAME6 MON_6
= LOCALE_SMONTHNAME7 MON_7
= LOCALE_SMONTHNAME8 MON_8
= LOCALE_SMONTHNAME9 MON_9
= LOCALE_SMONTHNAME10 MON_10
= LOCALE_SMONTHNAME11 MON_11
= LOCALE_SMONTHNAME12 MON_12
= LOCALE_SMONTHNAME13 MON_13
= LOCALE_SABBREVMONTHNAME1 ABMON_1
= LOCALE_SABBREVMONTHNAME2 ABMON_2
= LOCALE_SABBREVMONTHNAME3 ABMON_3
= LOCALE_SABBREVMONTHNAME4 ABMON_4
= LOCALE_SABBREVMONTHNAME5 ABMON_5
= LOCALE_SABBREVMONTHNAME6 ABMON_6
= LOCALE_SABBREVMONTHNAME7 ABMON_7
= LOCALE_SABBREVMONTHNAME8 ABMON_8
= LOCALE_SABBREVMONTHNAME9 ABMON_9
= LOCALE_SABBREVMONTHNAME10 ABMON_10
= LOCALE_SABBREVMONTHNAME11 ABMON_11
= LOCALE_SABBREVMONTHNAME12 ABMON_12
= LOCALE_SABBREVMONTHNAME13 ABMON_13
.Sample =Win32:
= GetLocaleInfoW(lcid, lcType, &lcData, StrSize);
=OS/2 for PowerPC:
= UniQueryLocaleInfo(locale_object, &pLconv);
= UniQueryLocaleItem(locale_object, item, &pInfoItemStr);
.Prototyp=int UniQueryLocaleInfo(const LocaleObject locale_object, struct UniLconv** UniLconv_addr_ptr);
=int UniQueryLocaleItem(const LocaleObject locale_object, nl_item item ,UniChar** info_item_addr_ptr);
.Template=UniQueryLocaleInfo( , )
=UniQueryLocaleItem( , ?Item, )
.Command =IF $P2 = "locale_sshortdate" THEN
= ?Item = "D_FMT"
=IF $P2 = "locale_stimeformat" THEN
= ?Item = "T_FMT"
=IF $P2 = "locale_s1159" THEN
= ?Item = "AM_STR"
=IF $P2 = "locale_s2359" THEN
= ?Item = "PM_STR"
=IF $P2 = "locale_sdayname7" THEN
= ?Item = "DAY_1"
=IF $P2 = "locale_sdayname1" THEN
= ?Item = "DAY_2"
=IF $P2 = "locale_sdayname2" THEN
= ?Item = "DAY_3"
=IF $P2 = "locale_sdayname3" THEN
= ?Item = "DAY_4"
=IF $P2 = "locale_sdayname4" THEN
= ?Item = "DAY_5"
=IF $P2 = "locale_sdayname5" THEN
= ?Item = "DAY_6"
=IF $P2 = "locale_sdayname6" THEN
= ?Item = "DAY_7"
=IF $P2 = "locale_sabbrevdayname7" THEN
= ?Item = "ABDAY_1"
=IF $P2 = "locale_sabbrevdayname1" THEN
= ?Item = "ABDAY_2"
=IF $P2 = "locale_sabbrevdayname2" THEN
= ?Item = "ABDAY_3"
=IF $P2 = "locale_sabbrevdayname3" THEN
= ?Item = "ABDAY_4"
=IF $P2 = "locale_sabbrevdayname4" THEN
= ?Item = "ABDAY_5"
=IF $P2 = "locale_sabbrevdayname5" THEN
= ?Item = "ABDAY_6"
=IF $P2 = "locale_sabbrevdayname6" THEN
= ?Item = "ABDAY_7"
=IF $P2 = "locale_smonthname1" THEN
= ?Item = "MON_1"
=IF $P2 = "locale_smonthname2" THEN
= ?Item = "MON_2"
=IF $P2 = "locale_smonthname3" THEN
= ?Item = "MON_3"
=if $p2 = "locale_smonthname4" then
= ?Item = "MON_4"
=IF $P2 = "locale_smonthname5" THEN
= ?Item = "MON_5"
=IF $P2 = "locale_smonthname6" THEN
= ?Item = "MON_6"
=IF $P2 = "locale_smonthname7" THEN
= ?Item = "MON_7"
=IF $P2 = "locale_smonthname8" THEN
= ?Item = "MON_8"
=IF $P2 = "locale_smonthname9" THEN
= ?Item = "MON_9"
=IF $P2 = "locale_smonthname10" THEN
= ?Item = "MON_10"
=IF $P2 = "locale_smonthname11" THEN
= ?Item = "MON_11"
=IF $P2 = "locale_smonthname12" THEN
= ?Item = "MON_12"
=IF $P2 = "LOCALE_SMONTHNAME13" THEN
= ?Item = "MON_13"
=IF $P2 = "locale_sabbrevmonthname1" THEN
= ?Item = "ABMON_1"
=IF $P2 = "locale_sabbrevmonthname2" THEN
= ?Item = "ABMON_2"
=IF $P2 = "locale_sabbrevmonthname3" THEN
= ?Item = "ABMON_3"
=IF $P2 = "locale_sabbrevmonthname4" THEN
= ?Item = "ABMON_4"
=IF $P2 = "locale_sabbrevmonthname5" THEN
= ?Item = "ABMON_5"
=IF $P2 = "locale_sabbrevmonthname6" THEN
= ?Item = "ABMON_6"
=IF $P2 = "locale_sabbrevmonthname7" THEN
= ?Item = "ABMON_7"
=IF $P2 = "locale_sabbrevmonthname8" THEN
= ?Item = "ABMON_8"
=IF $P2 = "locale_sabbrevmonthname9" THEN
= ?Item = "ABMON_9"
=IF $P2 = "locale_sabbrevmonthname10" THEN
= ?Item = "ABMON_10"
=IF $P2 = "locale_sabbrevmonthname11" THEN
= ?Item = "ABMON_11"
=IF $P2 = "locale_sabbrevmonthname12" THEN
= ?Item = "ABMON_12"
=IF $P2 = "LOCALE_SABBREVMONTHNAME13" THEN
= ?Item = "ABMON_13"
=SmNoComment(ALL)
=IF ?Item = "" THEN
= DO
= SmMigrateKeyword($T1)
= NOTE1 = "A locale object handle obtained from a previous call to UniCreateLocaleObject"
= NOTE2 = "must be inserted for the first parameter. The second parameter must be the"
= NOTE3 = "address of a pointer to a UniLconv structure. The memory for the structure is"
= NOTE4 = "automatically allocated by the function call. It is the application's"
= NOTE5 = "responsibility to free the memory with the UniFreeLocaleInfo function when the"
= NOTE6 = "UniLconv structure is no longer needed. The member of the UniLconv structure"
= NOTE7 = "that contains the same information as the requested lctype can be determined"
= NOTE8 = "with the mapping below:"
= NOTE9 = " "
= NOTE10 = " lctype Structure Member"
= NOTE11 = " ------ ----------------"
= NOTE12 = " locale_sdecimal UniChar *decimal_point"
= NOTE13 = " locale_sthousand UniChar *thousands_sep"
= NOTE14 = " locale_sgrouping UniChar *grouping"
= NOTE15 = " locale_sintlsymbol UniChar *int_curr_symbol"
= NOTE16 = " locale_scurrency UniChar *currency_symbol"
= NOTE17 = " locale_smondecimalsep UniChar *mon_decimal_point"
= NOTE18 = " locale_smonthousandsep UniChar *mon_thousands_sep"
= NOTE19 = " locale_smongrouping UniChar *mon_grouping"
= NOTE20 = " locale_spositivesign UniChar *positive_sign"
= NOTE21 = " locale_snegativesign UniChar *negative_sign"
= NOTE22 = " locale_iintlcurrdigits UniChar int_frac_digits"
= NOTE23 = " locale_icurrdigits UniChar frac_digits"
= NOTE24 = " locale_ipossymprecedes UniChar p_cs_precedes"
= NOTE25 = " locale_ipossepbyspace UniChar p_sep_by_space"
= NOTE26 = " locale_inegsymprecedes UniChar n_cs_precedes"
= NOTE27 = " locale_inegsepbyspace UniChar n_sep_by_space"
= NOTE28 = " locale_ipossignposn UniChar p_sign_posn"
= NOTE29 = " locale_inegsignposn UniChar n_sign_posn"
= SmOutputNote(NOTE1)
= SmOutputNote(NOTE2)
= SmOutputNote(NOTE3)
= SmOutputNote(NOTE4)
= SmOutputNote(NOTE5)
= SmOutputNote(NOTE6)
= SmOutputNote(NOTE7)
= SmOutputNote(NOTE8)
= SmOutputNote(NOTE9)
= SmOutputNote(NOTE10)
= SmOutputNote(NOTE11)
= SmOutputNote(NOTE12)
= SmOutputNote(NOTE13)
= SmOutputNote(NOTE14)
= SmOutputNote(NOTE15)
= SmOutputNote(NOTE16)
= SmOutputNote(NOTE17)
= SmOutputNote(NOTE18)
= SmOutputNote(NOTE19)
= SmOutputNote(NOTE20)
= SmOutputNote(NOTE21)
= SmOutputNote(NOTE22)
= SmOutputNote(NOTE23)
= SmOutputNote(NOTE24)
= SmOutputNote(NOTE25)
= SmOutputNote(NOTE26)
= SmOutputNote(NOTE27)
= SmOutputNote(NOTE28)
= SmOutputNote(NOTE29)
= END
=ELSE
= DO
= SmMigrateKeyword($T2)
= NOTE1 = "A locale object handle obtained from a previous call to UniCreateLocaleObject"
= NOTE2 = "must be inserted for the first parameter. The second parameter must be the"
= NOTE3 = "informational item to be retrieved. The last parameter is the address of a"
= NOTE4 = "pointer that points to the start of the target string."
= SmOutputNote(NOTE1)
= SmOutputNote(NOTE2)
= SmOutputNote(NOTE3)
= SmOutputNote(NOTE4)
= END
.Keyword =010 020 070 GetTimeFormatW
.SComment=Replace with UniStrftime
.LComment=Replace with UniStrftime. A locale object handle obtained from a previous
=call to UniCreateLocaleObject must be inserted for the first parameter.
=The format pictures from the original format string should be manually
=migrated to conform to the correct format options (%) used in the new
=format string. The new option specifiers that perform the same function
=as the pictures of the original format string can be determined with the
=mapping below:
=
= Format Picture (Win32) Format Specifier (OS/2)
= ---------------------- -----------------------
= h Not Supported
= hh %I
= H Not Supported
= HH %H, %T, or %R
= m Not Supported
= mm %M
= s Not Supported
= ss %S
= t Not Supported
= tt Not Supported
.Sample =Win32:
= GetTimeFormatW(lcid, flags, &Time, &Format, &TimeStr, StrSize);
=OS/2 for PowerPC:
= UniStrftime(locale_object, &TimeStr, StrSize, &Format, &Time);
.Prototyp=unsigned int UniStrftime(const localeObject locale_object, UniChar* ucs,
= unsigned int strsize, const UniChar* format,
= const struct tm* timeptr);
.Template=UniStrftime( , $P5, $P6, $P4, $P3)
.Command =SmMigrateKeyword($T1)
.Keyword =010 020 070 GetDateFormatW
.SComment=Replace with UniStrftime
.LComment=Replace with UniStrftime. A locale object handle obtained from a previous
=call to UniCreateLocaleObject must be inserted for the first parameter.
=The format pictures from the original format string should be manually
=migrated to conform to the correct format options (%) used in the new
=format string. The new option specifiers that perform the same function
=as the pictures of the original format string can be determined with the
=mapping below:
=
= Format Picture (Win32) Format Specifier (OS/2)
= ---------------------- -----------------------
= d Not Supported
= dd %d
= ddd %a
= dddd %A
= M Not Supported
= MM %m
= MMM %b or %h
= MMMM %B
= y Not Supported
= yy %y
= yyyy %Y
= gg Not Supported
.Sample =Win32:
= GetDateFormatW(lcid, flags, &Date, &Format, &DateStr, StrSize);
=OS/2 for PowerPC:
= UniStrftime(locale_object, &DateStr, StrSize, &Format, &Date);
.Prototyp=unsigned int UniStrftime(const localeObject locale_object, UniChar* ucs,
= unsigned int strsize, const UniChar* format,
= const struct tm* dateptr);
.Template=UniStrftime( , $P5, $P6, $P4, $P3)
.Command =SmMigrateKeyword($T1)
.Keyword =010 020 070 GetCurrencyFormatW
.SComment=Replace with UniStrfmon
.LComment=Replace with UniStrfmon. A locale object handle obtained from a previous
=call to UniCreateLocaleObject must be inserted for the first parameter.
=The CURRENCYFMT format structure and the flags from the original code should
=be manually migrated to conform to the correct format options (%) used in
=the new format string. Extract the values from the value string in the
=original code and insert them as arguments to the conversion specifiers in
=the new format string.
.Sample =Win32:
= GetCurrencyFormatW(lcid, flags, &Value, &Format, &CurrencyStr, StrSize);
=OS/2 for PowerPC:
= UniStrftime(locale_object, &CurrencyStr, StrSize, &Format);
.Prototyp=int UniStrftime(const localeObject locale_object, UniChar* ucs,
= unsigned int strsize, const UniChar* format);
.Template=UniStrftime( , $P5, $P6, $P4)
.Command =SmMigrateKeyword($T1)
.Keyword =010 020 070 IsCharAlphaNumeric
.SComment=Replace with UniQueryAlnum
.LComment=Replace with UniQueryAlnum. A locale object handle created with
=UniCreateLocaleObject must be supplied for the first parameter.
.Sample =Win32:
= ans = IsCharAlphaNumberic(ch);
=OS/2 for PowerPC:
= ans = UniQueryAlnum(locale_object, ch);
.Prototyp=int UniQueryAlnum(const LocaleObject locale_object, UniChar ch);
.Template=UniQueryAlnum( , $P1)
.Command =SmMigrateKeyword($T1)
.Keyword =010 020 070 IsCharAlpha
.SComment=Replace with UniQueryAlpha
.LComment=Replace with UniQueryAlpha. A locale object handle created with
=UniCreateLocaleObject must be supplied for the first parameter.
.Sample =Win32:
= ans = IsCharAlpha(ch);
=OS/2 for PowerPC:
= ans = UniQueryAlpha(locale_object, ch);
.Prototyp=int UniQueryAlpha(const LocaleObject locale_object, UniChar ch);
.Template=UniQueryAlpha( ,$P1)
.Command =SmMigrateKeyword($T1)
.Keyword =010 020 070 IsCharLower
.SComment=Replace with UniQueryLower.
.LComment=Replace with UniQueryLower. A locale object handle created with
=UniCreateLocaleObject must be supplied for the first parameter.
.Sample =Win32:
= ans = IsCharLower(ch);
=OS/2 for PowerPC:
= ans = UniQueryLower(locale_object, ch);
.Prototyp=int UniQueryLower(const LocaleObject locale_object, UniChar ch);
.Template=UniQueryLower( ,$P1)
.Command =SmMigrateKeyword($T1)
.Keyword =010 020 070 IsCharUpper
.SComment=Replace with UniQueryUpper.
.LComment=Replace with UniQueryUpper. A locale object handle created with
=UniCreateLocaleObject must be supplied for the first parameter.
.Sample =Win32:
= ans = IsCharUpper(ch);
=OS/2 for PowerPC:
= ans = UniQueryUpper(locale_object, ch);
.Prototyp=int UniQueryUpper(const LocaleObject locale_object, UniChar ch);
.Template=UniQueryUpper( ,$P1)
.Command =SmMigrateKeyword($T1)
.Keyword =010 010 070 lstrcat
.SComment=Replace with UniStrcat
.LComment=Replace with UniStrcat
.Sample =Win32:
= lstrcat(&str1, &str2);
=OS/2 for PowerPC:
= UniStrcat(&str1, &str2);
.Prototyp=UniChar UniStrcat(UniChar* str1, const UniChar* str2);
.Template=UniStrcat($P1, $P2)
.Command =SmMigrateKeyword($T1)
.Keyword =010 010 070 lstrcmp
.SComment=Replace with UniStrcmp
.LComment=Replace with UniStrcmp
.Sample =Win32:
= ans = lstrcmp(&str1, &str2);
=OS/2 for PowerPC:
= ans = UniStrcmp(&str1, &str2);
.Prototyp=int UniStrcmp(UniChar* str1, const UniChar* str2);
.Template=UniStrcmp($P1, $P2)
.Command =SmMigrateKeyword($T1)
.Keyword =010 010 070 lstrcpy
.SComment=Replace with UniStrcpy
.LComment=Replace with UniStrcpy
.Sample =Win32:
= lstrcpy(&str1, &str2);
=OS/2 for PowerPC:
= UniStrcpy(&str1, &str2);
.Prototyp=UniChar* UniStrcpy(UniChar* str1, const UniChar* str2);
.Template=UniStrcpy($P1, $P2)
.Command =SmMigrateKeyword($T1)
.Keyword =010 010 070 lstrlen
.SComment=Replace with UniStrlen
.LComment=Replace with UniStrlen
.Sample =Win32:
= lstrlen(&str);
=OS/2 for PowerPC:
= UniStrlen(&str);
.Prototyp=unsigned int UniStrlen(const UniChar* str);
.Template=UniStrlen($P1)
.Command =SmMigrateKeyword($T1)