Re: Function structure in formatting.c

From: "Brendan Jurd" <direvus(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Function structure in formatting.c
Date: 2007-08-09 02:43:06
Message-ID: 37ed240d0708081943w607a96e9y71f891de12f7c1e3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Just quick update on this. It turns out (as it always does) that I
want to refactor a bit more intensively than I first suggested.

The functions dch_global, dch_time and dch_date seem to be wholly
pointless, since dch_global is effectively a one-liner for the FX
flag, and the other two merely wrap around a giant switch statement.

My thought was to split DCH_processor into a to_char flavour and a
from_char flavour, and have those functions do all the work; loop
through each of the FormatNodes and run the giant switch statement.

This means there is no need to put pointers to "action functions" in
each of the KeyWords. It makes the code simpler, more readable -- and
considerably shorter.

A patch will be on the way shortly.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-08-09 03:23:13 Re: Unexpected VACUUM FULL failure
Previous Message Tom Lane 2007-08-09 01:24:24 Re: Unexpected VACUUM FULL failure

Browse pgsql-patches by date

  From Date Subject
Next Message Jaime Casanova 2007-08-09 04:51:39 Re: Function structure in formatting.c
Previous Message Tom Lane 2007-08-09 02:35:24 Re: Default location for docbook stylesheets in Gentoo