X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Fctf%2Ftypes%2Fstring.c;fp=formats%2Fctf%2Ftypes%2Fstring.c;h=ac25e1adc4c5eb81bf5262110adf602e394bea67;hp=31b1d593a10eeac25698dd29224015611ff164bb;hb=46322b331aefc5739efd841df72d1928e35050e6;hpb=0337dd70c0f441db8c504ab7899dd89f6a22f89f diff --git a/formats/ctf/types/string.c b/formats/ctf/types/string.c index 31b1d593..ac25e1ad 100644 --- a/formats/ctf/types/string.c +++ b/formats/ctf/types/string.c @@ -20,53 +20,57 @@ #include /* C99 limits */ #include -void ctf_string_copy(struct stream_pos *dest, struct stream_pos *src, +void ctf_string_copy(struct stream_pos *pdest, struct stream_pos *psrc, const struct declaration_string *string_declaration) { + struct ctf_stream_pos *dest = ctf_pos(pdest); + struct ctf_stream_pos *src = ctf_pos(psrc); size_t len; char *destaddr, *srcaddr; - align_pos(src, string_declaration->p.alignment); - srcaddr = get_pos_addr(src); + ctf_align_pos(src, string_declaration->p.alignment); + srcaddr = ctf_get_pos_addr(src); len = strlen(srcaddr) + 1; if (dest->dummy) goto end; - align_pos(dest, string_declaration->p.alignment); - destaddr = get_pos_addr(dest); + ctf_align_pos(dest, string_declaration->p.alignment); + destaddr = ctf_get_pos_addr(dest); strcpy(destaddr, srcaddr); end: - move_pos(dest, len); - move_pos(src, len); + ctf_move_pos(dest, len); + ctf_move_pos(src, len); } -void ctf_string_read(char **dest, struct stream_pos *src, +void ctf_string_read(char **dest, struct stream_pos *psrc, const struct declaration_string *string_declaration) { + struct ctf_stream_pos *src = ctf_pos(psrc); size_t len; char *srcaddr; - align_pos(src, string_declaration->p.alignment); - srcaddr = get_pos_addr(src); + ctf_align_pos(src, string_declaration->p.alignment); + srcaddr = ctf_get_pos_addr(src); len = strlen(srcaddr) + 1; *dest = g_realloc(*dest, len); strcpy(*dest, srcaddr); - move_pos(src, len); + ctf_move_pos(src, len); } -void ctf_string_write(struct stream_pos *dest, const char *src, +void ctf_string_write(struct stream_pos *pdest, const char *src, const struct declaration_string *string_declaration) { + struct ctf_stream_pos *dest = ctf_pos(pdest); size_t len; char *destaddr; - align_pos(dest, string_declaration->p.alignment); + ctf_align_pos(dest, string_declaration->p.alignment); len = strlen(src) + 1; if (dest->dummy) goto end; - destaddr = get_pos_addr(dest); + destaddr = ctf_get_pos_addr(dest); strcpy(destaddr, src); end: - move_pos(dest, len); + ctf_move_pos(dest, len); } void ctf_string_free_temp(char *string)