ASN1C C/C++ Common Runtime  ASN1C v7.4.x
Functions

Functions

OSBOOL rtCopyBitStr64 (OSSIZE srcNumbits, const OSOCTET *pSrcData, OSSIZE *pDstNumbits, OSOCTET *pDstData, OSSIZE dstDataSize)
 
OSBOOL rtCopyBitStr (OSUINT32 srcNumbits, const OSOCTET *pSrcData, OSUINT32 *pDstNumbits, OSOCTET *pDstData)
 
OSBOOL rtCopyDynBitStr64 (OSCTXT *pctxt, const ASN1DynBitStr64 *pSrcData, ASN1DynBitStr64 *pDstData)
 
OSBOOL rtCopyDynBitStr (OSCTXT *pctxt, const ASN1DynBitStr *pSrcData, ASN1DynBitStr *pDstData)
 
OSBOOL rtCopyOctStr64 (OSSIZE srcNumocts, const OSOCTET *pSrcData, OSSIZE *pDstNumocts, OSOCTET *pDstData, OSSIZE dstDataSize)
 
OSBOOL rtCopyOctStr (OSUINT32 srcNumocts, const OSOCTET *pSrcData, OSUINT32 *pDstNumocts, OSOCTET *pDstData)
 
OSBOOL rtCopyDynOctStr64 (OSCTXT *pctxt, const OSDynOctStr64 *pSrcData, OSDynOctStr64 *pDstData)
 
OSBOOL rtCopyDynOctStr (OSCTXT *pctxt, const ASN1DynOctStr *pSrcData, ASN1DynOctStr *pDstData)
 
OSBOOL rtCopyCharStr (OSCTXT *pctxt, const char *srcStr, char **dstStr)
 
OSBOOL rtCopy16BitCharStr (OSCTXT *pctxt, const Asn116BitCharString *srcStr, Asn116BitCharString *dstStr)
 
OSBOOL rtCopy32BitCharStr (OSCTXT *pctxt, const Asn132BitCharString *srcStr, Asn132BitCharString *dstStr)
 
OSBOOL rtCopyOID (const ASN1OBJID *srcOID, ASN1OBJID *dstOID)
 
OSBOOL rtCopyOID64 (const ASN1OID64 *srcOID, ASN1OID64 *dstOID)
 
OSBOOL rtCopyOpenType (OSCTXT *pctxt, const ASN1OpenType *srcOT, ASN1OpenType *dstOT)
 
OSBOOL rtCopyOpenTypeExt (OSCTXT *pctxt, const OSRTDList *srcList, OSRTDList *dstList)
 

Detailed Description

This group of functions allows copying values of primitive ASN.1 types.

These functions are used in copy routines that are generated by the ASN.1 complier when -gencopy option is used. Some primitive types that are mapped onto C standard primitive types (such as BOOLEAN, INTEGER REAL) do not need copy functions. The standard assingment operator can be used to copy these types.

Function Documentation

◆ rtCopy16BitCharStr()

OSBOOL rtCopy16BitCharStr ( OSCTXT pctxt,
const Asn116BitCharString srcStr,
Asn116BitCharString dstStr 
)

The rtCopy16BitCharStr function copies one ASN.1 16-bit character string value to another (generally BMPString).

The return value is one of the TRUE (copied successfully) or FALSE (error has occurred).

Parameters
pctxtPointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
srcStrThe pointer to the source 16-bit character string structure to copy.
dstStrThe pointer to destination 16-bit character string structure to receive the copied string. The memory will be allocated dynamically via call to rtxMemAlloc function.
Returns
The copying result. TRUE, if success, otherwise FALSE.

◆ rtCopy32BitCharStr()

OSBOOL rtCopy32BitCharStr ( OSCTXT pctxt,
const Asn132BitCharString srcStr,
Asn132BitCharString dstStr 
)

The rtCopy32BitCharStr function copies one ASN.1 32-bit character string value to another (generally UniversalString).

The return value is one of the TRUE (copied successfully) or FALSE (error has occurred).

Parameters
pctxtPointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
srcStrThe pointer to the source 32-bit character string structure to copy.
dstStrThe pointer to destination 32-bit character string structure to receive the copied string. The memory will be allocated dynamically via call to rtxMemAlloc function.
Returns
The copying result. TRUE, if success, otherwise FALSE.

◆ rtCopyBitStr()

OSBOOL rtCopyBitStr ( OSUINT32  srcNumbits,
const OSOCTET *  pSrcData,
OSUINT32 *  pDstNumbits,
OSOCTET *  pDstData 
)

The rtCopyBitStr function copies one ASN.1 BIT STRING value to another.

The return value is one of the TRUE (copied successfully) or FALSE (error has occurred).

This function is deprecated and considered to be unsafe because the size of the destination buffer is not specified. It exists for backward compatibility with previous versions only.

Parameters
srcNumbitsThe number of bits in the source value to copy.
pSrcDataThe pointer to data of the source value to copy.
pDstNumbitsThe pointer to destination number of bits. The srcNumbits argument will be copied into it.
pDstDataThe pointer to the destination buffer to receive the copied data. The buffer is assumed to be already allocated or static and should be enough to receive the copying data.
Returns
The copying result. TRUE, if success, otherwise FALSE.

◆ rtCopyBitStr64()

OSBOOL rtCopyBitStr64 ( OSSIZE  srcNumbits,
const OSOCTET *  pSrcData,
OSSIZE *  pDstNumbits,
OSOCTET *  pDstData,
OSSIZE  dstDataSize 
)

The rtCopyBitStr64 function copies one ASN.1 BIT STRING value to another. This function is safe fo use in 64-bit environments.

The return value is one of the TRUE (copied successfully) or FALSE (error has occurred).

Parameters
srcNumbitsThe number of bits in the source value to copy.
pSrcDataThe pointer to data of the source value to copy.
pDstNumbitsThe pointer to destination number of bits. The srcNumbits argument will be copied into it.
pDstDataThe pointer to the destination buffer to receive the copied data. The buffer is assumed to be already allocated or static and should be enough to receive the copying data.
dstDataSizeSize of destination data static buffer.
Returns
The copying result. TRUE, if success, otherwise FALSE.

◆ rtCopyCharStr()

OSBOOL rtCopyCharStr ( OSCTXT pctxt,
const char *  srcStr,
char **  dstStr 
)

The rtCopyCharStr function copies one ASN.1 8-bit character string value to another (including IA5String, VisibleString, PrintableString, NumericString, etc).

The return value is one of the TRUE (copied successfully) or FALSE (error has occurred).

Parameters
pctxtPointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
srcStrThe pointer to the source standard null-terminated string to copy.
dstStrThe pointer to pointer destination string to receive the copied string. The memory will be allocated dynamically via a call to rtxMemAlloc function.
Returns
The copying result. TRUE, if success, otherwise FALSE.

◆ rtCopyDynBitStr()

OSBOOL rtCopyDynBitStr ( OSCTXT pctxt,
const ASN1DynBitStr pSrcData,
ASN1DynBitStr pDstData 
)

The rtCopyDynBitStr function is similar to the rtCopyBitStr, but it copies a dynamic ASN.1 BIT STRING value.

The return vale is one of the TRUE (copied successfully) or FALSE (error has occurred).

Parameters
pctxtPointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
pSrcDataThe pointer to data of the source value to copy.
pDstDataThe pointer to the destination dynamic bit string structure to receive the copied data. The memory will be allocated dynamically via call to rtxMemAlloc function.
Returns
The copying result. TRUE, if success, otherwise FALSE.

◆ rtCopyDynBitStr64()

OSBOOL rtCopyDynBitStr64 ( OSCTXT pctxt,
const ASN1DynBitStr64 pSrcData,
ASN1DynBitStr64 pDstData 
)

The rtCopyDynBitStr64 function is similar to the rtCopyBitStr64, but it copies a dynamic ASN.1 BIT STRING value.

The return vale is one of the TRUE (copied successfully) or FALSE (error has occurred).

This function is safe for use in 64-bit environments.

Parameters
pctxtPointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
pSrcDataThe pointer to data of the source value to copy.
pDstDataThe pointer to the destination dynamic bit string structure to receive the copied data. The memory will be allocated dynamically via call to rtxMemAlloc function.
Returns
The copying result. TRUE, if success, otherwise FALSE.

◆ rtCopyDynOctStr()

OSBOOL rtCopyDynOctStr ( OSCTXT pctxt,
const ASN1DynOctStr pSrcData,
ASN1DynOctStr pDstData 
)

The rtCopyDynOctStr funtion is similar to rtCopyOctStr, but it copies a dynamic ASN.1 OCTET STRING value.

The return value is one of the TRUE (copied successfully) or FALSE (error has occurred).

Parameters
pctxtPointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
pSrcDataThe pointer to the source dynamic octet string structure to copy.
pDstDataThe point to destination dynamic octet string structure to receive the copied data. The memory will be allocated dynamically via a call to rtxMemAlloc function.
Returns
The copying result. TRUE, if success, otherwise FALSE.

◆ rtCopyDynOctStr64()

OSBOOL rtCopyDynOctStr64 ( OSCTXT pctxt,
const OSDynOctStr64 *  pSrcData,
OSDynOctStr64 *  pDstData 
)

The rtCopyDynOctStr funtion is similar to rtCopyOctStr, but it copies a dynamic ASN.1 OCTET STRING value.

The return value is one of the TRUE (copied successfully) or FALSE (error has occurred).

This function is safe for use in 64-bit environments.

Parameters
pctxtPointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
pSrcDataThe pointer to the source dynamic octet string structure to copy.
pDstDataThe point to destination dynamic octet string structure to receive the copied data. The memory will be allocated dynamically via a call to rtxMemAlloc function.
Returns
The copying result. TRUE, if success, otherwise FALSE.

◆ rtCopyOctStr()

OSBOOL rtCopyOctStr ( OSUINT32  srcNumocts,
const OSOCTET *  pSrcData,
OSUINT32 *  pDstNumocts,
OSOCTET *  pDstData 
)

The rtCopyOctStr function copies one ASN.1 OCTET STRING value to another.

The return value is one of the TRUE (copied successfully) or FALSE (error has occurred).

This function is deprecated and considered to be unsafe because the size of the destination buffer is not specified. It exists for backward compatibility with previous versions only.

Parameters
srcNumoctsThe number of octets in the source value to copy.
pSrcDataThe pointer to data of the source value to copy.
pDstNumoctsThe pointer to the destination number of octets. The srcNumocts argument will be copied into it.
pDstDataThe pointer to the destination buffer to receive the copied data. The buffer is assumed to be already allocated or static and should be enough to receive the copying data.
Returns
The copying result. TRUE, if success, otherwise FALSE.

◆ rtCopyOctStr64()

OSBOOL rtCopyOctStr64 ( OSSIZE  srcNumocts,
const OSOCTET *  pSrcData,
OSSIZE *  pDstNumocts,
OSOCTET *  pDstData,
OSSIZE  dstDataSize 
)

The rtCopyOctStr function copies one ASN.1 OCTET STRING value to another. This function is safe fo use in 64-bit environments.

The return value is one of the TRUE (copied successfully) or FALSE (error has occurred).

Parameters
srcNumoctsThe number of octets in the source value to copy.
pSrcDataThe pointer to data of the source value to copy.
pDstNumoctsThe pointer to the destination number of octets. The srcNumocts argument will be copied into it.
pDstDataThe pointer to the destination buffer to receive the copied data. The buffer is assumed to be already allocated or static and should be enough to receive the copying data.
dstDataSizeSize of destination data static buffer.
Returns
The copying result. TRUE, if success, otherwise FALSE.

◆ rtCopyOID()

OSBOOL rtCopyOID ( const ASN1OBJID srcOID,
ASN1OBJID dstOID 
)

The rtCopyIOD function copies one ASN.1 OBJECT IDENTIFIER or RELATED-IOD value to another.

The return value is one of the TRUE (copied successfully) or FALSE (error has occurred).

Parameters
srcOIDThe pointer to the source object identifier structure to copy.
dstOIDThe pointer to destination structure t receive the copied string.
Returns
The copying result. TRUE, if success, otherwise FALSE.

◆ rtCopyOID64()

OSBOOL rtCopyOID64 ( const ASN1OID64 srcOID,
ASN1OID64 dstOID 
)

The rtCopyOID64 function copies one 64-bit ASN.1 OBJECT IDENTIFIER or RELATIVE-OID value to another.

The return value is one of the TRUE (copied successfully) or FALSE (error has occurred).

Parameters
srcOIDThe pointer to the source object identifier structure to copy.
dstOIDThe pointer to destination structure t receive the copied string.
Returns
The copying result. TRUE, if success, otherwise FALSE.

◆ rtCopyOpenType()

OSBOOL rtCopyOpenType ( OSCTXT pctxt,
const ASN1OpenType srcOT,
ASN1OpenType dstOT 
)

The rtCopyOpenType copies ASN.1 value of the old (pre- 1994) ASN.1 ANY type or other elements defined in the later standards to be Open Types (for example, a variable type declaration in a CLASS construct as defined in X.681).

The return value is one of the TRUE (copied successfully) or FALSE (error has occurred).

Parameters
pctxtPointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
srcOTThe pointer to the source Open Type structure to copy.
dstOTThe pointer to the destination Open Type structure to receive the copied data. The memory will be allocated dynamically via call to the rtxMemAlloc function.
Returns
The copying result. TRUE, if success, otherwise FALSE.

◆ rtCopyOpenTypeExt()

OSBOOL rtCopyOpenTypeExt ( OSCTXT pctxt,
const OSRTDList srcList,
OSRTDList dstList 
)

The rtCopyOpenTypeExt function copies an ASN.1 open type extension value.

The return value is one of the TRUE (copied successfully) or FALSE (error has occurred). An open type extension is defined as extensibility marker on a constructed type without any extension elements defined (for example, SEQUENCE { a INTEGER, ... }). The difference is that this is an implicit field that can span more elements whereas the standard Open Type is assumed to be a single tagged field.

Parameters
pctxtPointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
srcListThe pointer to the source linked list structure to copy. The list should consist of ASN1OpenType elements.
dstListThe pointer to destination linked list structure to receive the copied data. The memory for list nodes and data will be allocated dynamically via call to the rtxMemAlloc function. The list nodes will contain the data of ASN1OpenType type.