Re: [PATCH v14 03/13] utf8: add function to align a string into given strbuf
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Aug 29, 2015, 17:33 UTC
- Message-ID
- <CAOLa=ZRq4aJMYcRBaaLV9XFJ0LkeO27cZwaaJUmRMvCnHD1SAQ@mail.gmail.com>
- In-Reply-To
- <55E1E778.4030400@web.de>
On Sat, Aug 29, 2015 at 10:40 PM, Torsten Bögershausen <tboegi@web.de> wrote:
Show 16 quoted lines
> On 29.08.15 16:12, Karthik Nayak wrote:
>> diff --git a/utf8.h b/utf8.h
>> index 5a9e94b..7930b44 100644
>> --- a/utf8.h
>> +++ b/utf8.h
>> @@ -55,4 +55,19 @@ int mbs_chrlen(const char **text, size_t *remainder_p, const char *encoding);
>> */
>> int is_hfs_dotgit(const char *path);
>>
>> +typedef enum {
>> + ALIGN_LEFT,
>> + ALIGN_MIDDLE,
>> + ALIGN_RIGHT
>> +} align_type;
> should this be called strbuf_align_type ?
>align_type seemed descriptive and unique enough.
Show 5 quoted lines
> And is there a reason why the is in utf.c and not in stbuf.c ? > > (I know that there is a lot of strbuf in utf8.c, but I hadn't managed to send a patch > to move everything into strbuf.c and make utf8.c un-aware of all strbub-business) >
This was based on Eric's suggestions. http://article.gmane.org/gmane.comp.version-control.git/275456
It makes sense also, since rather than acting on a strbuf, this is more of just utilizing an strbuf to provide the result. whereas the real work is of alignment.
-- Regards, Karthik Nayak