Github user zellerh commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/833#discussion_r87908951 --- Diff: core/sql/common/stringinfo.h --- @@ -0,0 +1,137 @@ +#ifndef STRINGINFO_H +#define STRINGINFO_H + +#include <sys/types.h> +#include <stdarg.h> + +#ifndef NULL +#define NULL ((void *) 0) +#endif + +/*------------------------- + * StringInfoData holds information about an extensible string. + * data is the current buffer for the string (allocated with palloc). + * len is the current string length. There is guaranteed to be + * a terminating '\0' at data[len], although this is not very + * useful when the string holds binary data rather than text. + * maxlen is the allocated size in bytes of 'data', i.e. the maximum + * string size (including the terminating '\0' char) that we can + * currently store in 'data' without having to reallocate + * more space. We must always have maxlen > len. + * cursor is initialized to zero by makeStringInfo or initStringInfo, + * but is not otherwise touched by the stringinfo.c routines. + * Some routines use it to scan through a StringInfo. + *------------------------- + */ +typedef struct StringInfoData +{ + char *data; + int len; + int maxlen; + int cursor; +} StringInfoData; + +typedef StringInfoData *StringInfo; --- End diff -- "StringInfo" is a very generic term and this struct is used for a very specialized purpose here. It would be good to rename it to make it more clear what it is for. For example: ComJSONStringInfo would make it more clear that this is part of the common directory and used for JSON strings. Also, it is not common in Trafodion to typedef a pointer to a regular name, and this will probably confuse people as well. Is it possible to use the Trafodion strings NAString or NAText instead? NAText is basically the same as std::string. Just a question, I realize that it may be too much work to do this.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---