SYNOPSIS
#include <tcl.h>
Tcl_Obj * Tcl_NewByteArrayObj(bytes, length)
void Tcl_SetByteArrayObj(objPtr, bytes, length)
unsigned char * Tcl_GetByteArrayFromObj(objPtr, lengthPtr)
unsigned char * Tcl_SetByteArrayLength(objPtr, length)
ARGUMENTS
- unsigned char *bytes (in)
-
The array of bytes used to initialize or set a byte-array object.
- int length (in)
-
The length of the array of bytes. It must be >= 0.
- Tcl_Obj *objPtr (in/out)
-
For
Tcl_SetByteArrayObj() , this points to the object to be converted to byte-array type. ForTcl_GetByteArrayFromObj() andTcl_SetByteArrayLength() , this points to the object from which to get the byte-array value; if objPtr does not already point to a byte-array object, it will be converted to one. - int *lengthPtr (out)
-
If non-NULL, filled with the length of the array of bytes in the object.
DESCRIPTION
These procedures are used to create, modify, and read Tcl byte-array objects
from C code. Byte-array objects are typically used to hold the
results of binary IO operations or data structures created with the
binary command. In Tcl, an array of bytes is not
equivalent to a
string. Conceptually, a string is an array of Unicode characters, while a
byte-array is an array of 8-bit quantities with no implicit meaning.
Accesser functions are provided to get the string representation of a
byte-array or to convert an arbitrary object to a byte-array. Obtaining the
string representation of a byte-array object (by calling
PORTABILITY
Windows 8.1. Windows Server 2012 R2. Windows 10. Windows Server 2016. Windows Server 2019. Windows 11. Windows Server 2022.
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
- Functions:
Tcl_DecrRefCount() ,Tcl_GetStringFromObj() ,Tcl_IncrRefCount() ,Tcl_NewObj()
PTC MKS Toolkit 10.4 Documentation Build 39.