[Home] [Prev] [Next] [Up]


cvtc2p
cvtp2c

Provide a way to convert from C to Pascal strings and back again.

Usage:

#include <XDataUtil.h>

unsigned char *cvtc2p(unsigned char *dest, const char *src);
char *cvtp2c(char *dest, const unsigned char *src);

Description

These utilities provide a safe way to convert from a C format string to a Pascal format string and back again. These accept a constant string as an argument, and does not modify the string's contents.

cvtc2p converts from a constant C string to a Pascal string, and returns a pointer to the Pascal string buffer provided in dest.

cvtp2c converts from a constant Pascal string to a C string, and returns a pointer to the C string buffer provided in dest.


[Home] [Prev] [Next] [Up]