Next: , Up: ascii zero   [Contents][Index]


7.2.1 Constructors for ASCII strings

Function: ccmem_asciiz_t ccmem_new_ascii (char * ptr, size_t len)

Build and return a new instance, initialised with the given operands. len must not include the terminating zero.

Function: ccmem_asciiz_t ccmem_new_asciiz_empty (void)

Build and return a new instance, representing an empty string. The pointer field references a statically allocated, zero terminated, empty string; the length field is set to zero.

Function: ccmem_asciiz_t ccmem_new_asciiz_null (void)

Build and return a new instance: the pointer field is set to NULL; the length field is set to zero.

Function: ccmem_asciiz_t ccmem_new_asciiz_from_str (char * str)

Build and return a new instance, initialised with the given pointer to an ASCIIZ string. The length of the string is determined with a call to strlen().

Function: ccmem_asciiz_t ccmem_new_asciiz_from_block (ccmem_block_t B)

Build and return a new instance initialised with the fields from the given block. The block is supposed to hold a valid ASCIIZ string, with no zero characters inside. This function assumes that the string in the block is zero–terminated and the terminating zero is an octet counted by the block’s length.


Next: , Up: ascii zero   [Contents][Index]

This document describes version 0.2.2-devel.3 of CCMemory.