================ @@ -52,6 +54,12 @@ typedef struct { * to `std::string::c_str()`. */ CINDEX_LINKAGE const char *clang_getCString(CXString string); +/** + * This function behaves the same as clang_getCString, except that it also + * returns the size through the length parameter. The length parameter should be + * non-NULL. + */ +CINDEX_LINKAGE const char *clang_getCString2(CXString string, size_t *length); ---------------- erichkeane wrote:
It seems to me that this new interface (I like `CString2` only if it implies replacement) would be better off returning: `struct CStringInfo { const char*data, size_t length };` https://github.com/llvm/llvm-project/pull/134551 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits