OpenTP1 Version 7 TP1/Client User's Guide TP1/Client/W, TP1/Client/P
TP1/Client/W DLL or TP1/Client/P DLL
#include <dcvclt.h>
DCLONG dc_clt_code_convert(DCLONG request,
char CLTFAR *source, DCULONG CLTFAR *source_len,
char CLTFAR *dest, DCULONG CLTFAR *dest_len,
DCLONG flags)
(2) Purpose
- Converts the character strings consisting of JIS code or Shift JIS code into character strings of EBCDIC code, EBCDIK code, or KEIS code.
- Converts the character strings consisting of EBCDIC code, EBCDIK code, or KEIS code into character strings of JIS code or Shift JIS code.
(3) Arguments set by UAPs
- request
Specify the conversion method using the following request code.
- DCCLT_JISSJIS_TO_EBCKEIS
- Converts character strings consisting of JIS code or Shift JIS code into character strings of EBCDIC code, EBCDIK code, or KEIS code.
- DCCLT_EBCKEIS_TO_JISSJIS
- Converts character strings consisting of EBCDIC code, EBCDIK code, or KEIS code into character strings of JIS code or Shift JIS code.
- source
Specify the character string to be converted.
- source_len
Specify the length of the character string to be converted. 1 to DCRPC_MAX_MESSAGE_SIZE can be specified.
- dest
Specify the area that receives data after conversion.
- dest_len
Specify the length of the area that receives the converted character string. 1 to DCRPC_MAX_MESSAGE_SIZE can be specified.
- flags
Specify the conditions for conversion using the following format (OR of the specified values).
When 2., 3., 4., 5. or 6. comes first, omit | (stroke).
{DCNOFLAGS }
[1.][|2.][|3.][|4.][|5.][|6.]
1:{DCCLT_CNV_EBCDIC | DCCLT_CNV_EBCDIK}
2:{DCCLT_CNV_SPCHAN | DCCLT_CNV_SPCZEN}
3:{DCCLT_CNV_KEIS78 | DCCLT_CNV_KEIS83}
4:{DCCLT_CNV_INVSPC | DCCLT_CNV_INVERR}
5:{DCCLT_CNV_TAB | DCCLT_CNV_NOTAB}
6:{DCCLT_CNV_CNTL | DCCLT_CNV_NOCNTL}
Description of the specified values
- DCNOFLAGS
- The following defaults are used.
- EBCDIK code is used.
- Two-byte spaces remain the same.
- The 1983 version of the KEIS code is used.
- An error occurs if an invalid code is found.
- A tab code is not identified to be single-byte. No shift code is available even for just the preceding or succeeding two-byte code if any.
- A control code is not identified to be single-byte. No shift code is available even for just the preceding or succeeding two-byte code if any.
- DCCLT_CNV_EBCDIC
- EBCDIC code is used.
- DCCLT_CNV_EBCDIK
- EBCDIK code is used.
- DCCLT_CNV_KEIS78
- The 1978 version of the KEIS code is used.
- DCCLT_CNV_KEIS83
- The 1983 version of the KEIS code is used.
- DCCLT_CNV_INVSPC
- An invalid code is converted to a space.
- DCCLT_CNV_INVERR
- An error occurs if an invalid code is found.
- DCCLT_CNV_TAB
- Identifies a tab code to be single-byte. A shift code is given to just the preceding or succeeding two-byte code if any.
- DCCLT_CNV_NOTAB
- Does not identify a tab code to be single-byte. No shift code is provided for just the preceding or succeeding two-byte code if any.
- DCCLT_CNV_CNTL
- Identifies a control code to be single-byte. A shift code is given to just the preceding or succeeding two-byte code if any.
- DCCLT_CNV_NOCNTL
- Does not identify a control code to be single-byte. No shift code is provided for just the preceding or succeeding two-byte code if any.
(4) Arguments for which a value is returned
- dest
The converted character string is returned.
- dest_len
The length of the converted character string is returned.
(5) Return values
Return Value |
Value (decimal) |
Meaning |
DC_OK |
0 |
Normal termination |
DCCLTER_INVALID_ARGS |
-2501 |
Invalid argument |
DCCLTER_NO_BUFS |
-2504 |
Insufficient memory. The function returns this value also when the specified character length covers the first byte of a two-byte code that is contained in the character string to be converted. |
DCCLTER_INVALID_CODE |
-2550 |
An invalid code is found in the character string. |
DCCLTER_OVERFLOW |
-2551 |
The length of the converted character string exceeds the area prepared by the CUP. |
When you specify request to be DCCLT_EBCKEIS_TO_JISSJIS and flags to be DCCLT_CNV_TAB or DCCLT_CNV_CNTL, you need to prepare data that contains single-byte tab and control codes.
All Rights Reserved. Copyright (C) 2006, 2009, Hitachi, Ltd.