Home | History | Annotate | Download | only in src

Lines Matching defs:pcdata

155  * frees the Memory of an allocated Pcdata memory object
158 * A Pointer to a PcData structure, which should be freed
484 * copy a string into a Pcdata structure
490 * A Pointer to a PcData structure
496 SmlPcdataPtr_t pcdata;
502 /* Allocate the PcData Structure */
503 pcdata = (SmlPcdataPtr_t)smlLibMalloc((MemSize_t)sizeof(SmlPcdata_t));
504 if (! pcdata)
506 smlLibMemset (pcdata, 0, (MemSize_t)sizeof(SmlPcdata_t));
508 /* Set the PcData Structure */
509 pcdata->contentType = SML_PCDATA_STRING;
510 pcdata->length = smlLibStrlen( str );
511 pcdata->content = (VoidPtr_t)smlLibStrdup(str);
513 return pcdata;
520 * copy a Pcdata structure into a string
523 * A Pointer to a PcData structure
528 SML_API String_t smlPcdata2String(SmlPcdataPtr_t pcdata)
534 if (! pcdata)
538 str = (String_t)smlLibMalloc((MemSize_t)(pcdata->length+1));
543 smlLibMemcpy((MemPtr_t)str, (MemPtr_t)pcdata->content, pcdata->length);
544 *(str + pcdata->length) = '\0';
553 * Duplicates a Pcdata memory object
556 * A Pointer to the original PcData structure
559 * A Pointer to the copy of the PcData structure
562 SML_API SmlPcdataPtr_t smlPcdataDup(SmlPcdataPtr_t pcdata)
568 if (! pcdata)
571 /* Allocate the new pcdata memory object */
577 /* Set the PcData Structure */
578 newPcdata->contentType = pcdata->contentType;
579 newPcdata->length = pcdata->length;
580 newPcdata->content =(VoidPtr_t)smlLibMalloc((MemSize_t)pcdata->length+1);
587 smlLibMemset(newPcdata->content, 0, (MemSize_t)((pcdata->length)+1));
588 smlLibMemcpy(newPcdata->content, pcdata->content, (MemSize_t)pcdata->length);