% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tcc_ptr_utils.R
\name{tcc_read_cstring}
\alias{tcc_read_cstring}
\title{Read C-style string from pointer}
\usage{
tcc_read_cstring(
  ptr,
  max_bytes = NULL,
  null_action = c("na", "empty", "error")
)
}
\arguments{
\item{ptr}{External pointer to C string}

\item{max_bytes}{Optional maximum number of bytes to read (fixed-length read).}

\item{null_action}{Behavior when ptr is NULL: one of "na", "empty", "error".
Only effective when \code{max_bytes} is provided; without it a NULL pointer
returns \code{""}.}
}
\value{
Character string, or \code{NA}/\code{""} for NULL pointers depending on
\code{null_action}.
}
\description{
Convert a C-style null-terminated string pointer back to R character string.
Handles UTF-8 decoding automatically.
}
