Re: Using defines for protocol characters

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Using defines for protocol characters
Дата
Msg-id 20230803175940.vf3os5y37c7vrbwl@alvherre.pgsql
обсуждение исходный текст
Ответ на Using defines for protocol characters  (Dave Cramer <davecramer@gmail.com>)
Ответы Re: Using defines for protocol characters  (Dave Cramer <davecramer@gmail.com>)
Список pgsql-hackers
On 2023-Aug-03, Dave Cramer wrote:

> Greetings,
> 
> Attached is a patch which introduces a file protocol.h. Instead of using
> the actual characters everywhere in the code this patch names the
> characters and removes the comments beside each usage.

I saw this one last week.  I think it's a very idea (and I fact I had
thought of doing it when I last messed with libpq code).

I don't really like the name pattern you've chosen though; I think we
need to have a common prefix in the defines.  Maybe prepending PQMSG_ to
each name would be enough.  And maybe turn the _RESPONSE and _REQUEST
suffixes you added into prefixes as well, so instead of PARSE_REQUEST
you could make it PQMSG_REQ_PARSE, PQMSG_RESP_BIND_COMPLETE and so
on.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
<Schwern> It does it in a really, really complicated way
<crab> why does it need to be complicated?
<Schwern> Because it's MakeMaker.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Using defines for protocol characters
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: Using defines for protocol characters