From 01d9317436cd824306b9856861408a40bf8da36a Mon Sep 17 00:00:00 2001 From: Nick Alcock Date: Tue, 2 Jun 2020 21:06:18 +0100 Subject: libctf: add ctf_type_name_raw We already have a function ctf_type_aname_raw, which returns the raw name of a type with no decoration for structures or arrays or anything like that: just the underlying name of whatever it is that's being ultimately pointed at. But this can be inconvenient to use, becauswe it always allocates new storage for the string and copies it in, so it can potentially fail. Add ctf_type_name_raw, which just returns the string directly out of libctf's guts: it will live until the ctf_file_t is closed (if we later gain the ability to remove types from writable dicts, it will live as long as the type lives). Reimplement ctf_type_aname_raw in terms of it. include/ * ctf-api.c (ctf_type_name_raw): New. libctf/ * ctf-types.c (ctf_type_name_raw): New. (ctf_type_aname_raw): Reimplement accordingly. --- libctf/libctf.ver | 1 + 1 file changed, 1 insertion(+) (limited to 'libctf/libctf.ver') diff --git a/libctf/libctf.ver b/libctf/libctf.ver index aad304b..30a0b08 100644 --- a/libctf/libctf.ver +++ b/libctf/libctf.ver @@ -57,6 +57,7 @@ LIBCTF_1.0 { ctf_type_resolve; ctf_type_lname; ctf_type_name; + ctf_type_name_raw; ctf_type_aname; ctf_type_aname_raw; ctf_type_size; -- cgit v1.1