| 1421 | // TSMLoc: pointers to MIMEFieldSDKHandle objects |
| 1422 | |
| 1423 | TSReturnCode |
| 1424 | TSMimeHdrCreate(TSMBuffer bufp, TSMLoc *locp) |
| 1425 | { |
| 1426 | // Allow to modify the buffer only |
| 1427 | // if bufp is modifiable. If bufp is not modifiable return |
| 1428 | // TS_ERROR. If not allowed, set *locp to TS_NULL_MLOC. |
| 1429 | sdk_assert(sdk_sanity_check_mbuffer(bufp) == TS_SUCCESS); |
| 1430 | sdk_assert(sdk_sanity_check_null_ptr((void *)locp) == TS_SUCCESS); |
| 1431 | |
| 1432 | if (!isWriteable(bufp)) { |
| 1433 | return TS_ERROR; |
| 1434 | } |
| 1435 | |
| 1436 | *locp = reinterpret_cast<TSMLoc>(mime_hdr_create((reinterpret_cast<HdrHeapSDKHandle *>(bufp))->m_heap)); |
| 1437 | return TS_SUCCESS; |
| 1438 | } |
| 1439 | |
| 1440 | TSReturnCode |
| 1441 | TSMimeHdrDestroy(TSMBuffer bufp, TSMLoc obj) |