Back to index

lightning-sunbird  0.9+nobinonly
Functions
mac_strings.cpp File Reference
#include "mac_strings.h"
#include <string.h>
#include <Memory.h>
#include <new>

Go to the source code of this file.

Functions

StringPtr c2p_strcpy (StringPtr pstr, const char *cstr)
char * p2c_strcpy (char *cstr, const StringPtr pstr)
char * p2c_strdup (StringPtr pstr)

Function Documentation

StringPtr c2p_strcpy ( StringPtr  pstr,
const char *  cstr 
)

Definition at line 11 of file mac_strings.cpp.

{
       size_t len = ::strlen(cstr);
       if (len > 255) len = 255;
       BlockMoveData(cstr, pstr + 1, len);
       pstr[0] = len;
       return pstr;
}

Here is the caller graph for this function:

char* p2c_strcpy ( char *  cstr,
const StringPtr  pstr 
)

Definition at line 20 of file mac_strings.cpp.

{
       size_t len = pstr[0];
       BlockMoveData(pstr + 1, cstr, len);
       cstr[len] = '\0';
       return cstr;
}
char* p2c_strdup ( StringPtr  pstr)

Definition at line 28 of file mac_strings.cpp.

{
       size_t len = pstr[0];
       char* cstr = new char[1 + len];
       if (cstr != NULL) {
              BlockMoveData(pstr + 1, cstr, len);
              cstr[len] = '\0';
       }
       return cstr;
}

Here is the caller graph for this function: