[an error occurred while processing this directive]
HP OpenVMS Systems Documentation |
HP OpenVMS/Hanzi RTL Chinese Processing (HSY$) Manual
$ LINK program, SYS$LIBRARY:HSYIMGLIB.OLB/LIBRARY
Chapter 2
|
+--+--+--+--+ |00|00|B0|A1| +--+--+--+--+ H L |
In a string argument: (VMS Usage - char_string)
--+--+--+- +--+ .... |A1|B0|....| | start of string --+--+--+- +--+ H L |
The read routines in HSYSHR read the buffer with character string format and return the character read in unsigned longword format. The write routines write the character in unsigned longword format to the buffer. The character written will be in character string format.
HSY$CH_MOVE moves a substring from a specified source buffer to a specified destination buffer.
HSY$CH_MOVE len,src,dst
len
VMS usage: longword_signed type: longword integer (signed) access: read only mechanism: by value
The length in bytes of the substring to be moved.src
VMS usage: longword_unsigned type: longword integer (unsigned) access: read only mechanism: by value
The address of the starting position of the source buffer.dst
VMS usage: longword_unsigned type: longword integer (unsigned) access: read only mechanism: by value
The address of the starting position of the destination buffer.
This routine is multi-byte insensitive. If len is not specifying the proper multi-byte character boundary, e.g. it indicates the second byte of a two-byte character, then only half of the multi-byte character is moved to the last character of the destination string.
HSY$DX_TRIM trims trailing one-byte and multi-byte spaces and TAB characters.
HSY$DX_TRIM dst,src,[len]
VMS usage: cond_value type: longword (unsigned) access: write only mechanism: by value
dst
VMS usage: char_string type: character string access: write only mechanism: by descriptor
The destination string to store the trimmed string.src
VMS usage: char_string type: character string access: read only mechanism: by descriptor
The source string that is to be converted.len
VMS usage: word_signed type: word integer (signed) access: write only mechanism: by reference
The length in bytes of the trimmed string. If this optional argument is not supplied, no length information of the trimmed string will be returned to the caller.
dst and src can contain one-byte and multi-byte characters.
LIB$_INVSTRDES Invalid string descriptor. A string descriptor has an invalid value in its DSC$B_CLASS field. LIB$_STRTRU Procedure successfully completed. String truncated. LIB$_FATERRLIB Fatal internal error. An internal consistency check has failed. LIB$_INSVIRMEM Insufficient virtual memory. SS$_NORMAL Procedure successfully completed.
HSY$DX_TRUNC truncates the input string to the specified length.
HSY$DX_TRUNC dst,src,offset,[len]
VMS usage: cond_value type: longword (unsigned) access: write only mechanism: by value
dst
VMS usage: char_string type: character string access: write only mechanism: by descriptor
The specified destination string to store the truncated string.src
VMS usage: char_string type: character string access: read only mechanism: by descriptor
The specified source string to be truncated.offset
VMS usage: word_signed type: word integer (signed) access: read only mechanism: by reference
The offset in bytes from the starting position of the source string which indicates the position of the first character just after the truncated string. Note that this offset may not be on the proper character boundary, e.g. it may point to the second byte of a two-byte character.len
VMS usage: word_signed type: word integer (signed) access: write only mechanism: by reference
The length in bytes of the truncated string. If this optional argument is not supplied, no length information of the truncated string will be returned to the caller.
The value returned in len may not necessarily be equal to the value specified in offset since offset may not be pointing at the first byte of a multi-byte character. In any case, the character indicated by offset will be treated as the first character that follows the truncated string.
LIB$_INVSTRDES Invalid string descriptor. A string descriptor has an invalid value in its DSC$B_CLASS field. LIB$_STRTRU Procedure successfully completed. Truncated string is further truncated due to insufficient space allocated in the destination string buffer. LIB$_FATERRLIB Fatal internal error. An internal consistency check has failed. LIB$_INSVIRMEM Insufficient virtual memory. SS$_NORMAL Procedure successfully completed.
HSY$TRIM trims trailing one-byte and multi-byte spaces and TAB characters.
HSY$TRIM str,len
VMS usage: longword_signed type: longword integer (signed) access: write only mechanism: by value The offset in bytes from the starting position of the input string which indicates the position of the terminating character of the trimmed string. If the terminating character is a multi-byte character, the returned offset will be pointing to the first byte of the multi-byte character.
str
VMS usage: longword_unsigned type: longword integer (unsigned) access: read only mechanism: by value
The address of the starting position of the input string to be trimmed.len
VMS usage: longword_signed type: longword integer (signed) access: read only mechanism: by value
The length in bytes of the input string.
str can contain one-byte and multi-byte characters.
HSY$TRUNC returns the position of the first character that follows the truncated string.
HSY$TRUNC str,len,offset
VMS usage: longword_signed type: longword integer (signed) access: write only mechanism: by value The offset in bytes which indicates the position of the first character just follows the truncated string. If this character is a multi-byte character, the offset will be pointing at the first byte of the multi-byte character.
str
VMS usage: longword_unsigned type: longword integer (unsigned) access: read only mechanism: by value
The address of the starting position of the input string.len
VMS usage: longword_signed type: longword integer (signed) access: read only mechanism: by value
The length in bytes of the input string.offset
VMS usage: longword_signed type: longword integer (signed) access: read only mechanism: by value
The offset in bytes of the character just follows the truncated string. It may not be on the proper character boundary, e.g. it can point to the second byte of a two-byte character.
str can contain one-byte and multi-byte characters. This routine helps you to position offset to the proper character boundary. Its function is similar to routine HSY$CH_CURR but with different parameter interface.
HSY$CH_GCHAR reads the current character.
HSY$CH_GCHAR cur,end
VMS usage: longword_unsigned type: longword integer (unsigned) access: write only mechanism: by value The current character.
cur
VMS usage: longword_unsigned type: longword integer (unsigned) access: read only mechanism: by value
The address of the current position of the specified current character. Note that this address must be on the proper character boundary, e.g. it should not point to the second byte of a two-byte character.end
VMS usage: longword_unsigned type: longword integer (unsigned) access: read only mechanism: by value
The address of the string terminating position plus one as illustrated below:
+---+---+---+---+ .. | | | | | +---+---+---+---+ string ^ end
This routine reads a character with end of buffer checking. FFFF (hex) will be returned when read past the end of buffer. If the current character is a one-byte 7-bit control character or one-byte 8-bit character (e.g. an 8-bit character followed by a 7-bit control character), the one-byte 7-bit or 8-bit character will be returned. No updating of current pointer is done since cur is passed by value.
HSY$CH_GNEXT reads the current character.
HSY$CH_GNEXT cur,end
VMS usage: longword_unsigned type: longword integer (unsigned) access: write only mechanism: by value The current character.
cur
VMS usage: longword_unsigned type: longword integer (unsigned) access: modify mechanism: by reference
The address of the current position of the specified current character. Note that this address must be on the proper character boundary, e.g. it should not point to the second byte of a two-byte character.end
VMS usage: longword_unsigned type: longword integer (unsigned) access: read only mechanism: by value
The address of the string terminating position plus one as illustrated below:
+---+---+---+---+ .. | | | | | +---+---+---+---+ string ^ end
This routine reads a character with end of buffer checking. FFFF (hex) will be returned when read past the end of buffer. If the current character is a one-byte 7-bit control character or one-byte 8-bit character (e.g. an 8-bit character followed by a 7-bit control character), the one-byte 7-bit or 8-bit character will be returned. Updating of the current pointer is done. After the read action, cur will be updated to the next character position pointing at the proper character boundary. This routine is useful for successive character reading.
HSY$CH_NEXTG reads the next character, skipping the current character.
HSY$CH_NEXTG cur,end
VMS usage: longword_unsigned type: longword integer (unsigned) access: write only mechanism: by value The next character.
cur
VMS usage: longword_unsigned type: longword integer (unsigned) access: modify mechanism: by reference
The address of the current position of the specified current character. Note that this address must be on the proper character boundary, e.g. it should not point to the second byte of a two-byte character.end
VMS usage: longword_unsigned type: longword integer (unsigned) access: read only mechanism: by value
The address of the string terminating position plus one as illustrated below:
+---+---+---+---+ .. | | | | | +---+---+---+---+ string ^ end
This routine reads the next character, skipping the current character. FFFF (hex) will be returned when read past the end of buffer. If the next character is a one-byte 7-bit control character or one-byte 8-bit character (e.g. an 8-bit character followed by a 7-bit control character), the one-byte 7-bit or 8-bit character will be returned. Updating of the current pointer is done. After the read action, cur will be updated to the next character position pointing at the proper character boundary.
Previous | Next | Contents |