Re: [PATCH] hier_code ACL (port from 2.7)

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Fri, 21 Aug 2009 13:55:06 +1200

Henrik Nordstrom wrote:
> hnordstrom has voted approve.
> Status is now: Approved
> Comment:
> Looks fine.
>
> But the patch highlighted another minor issue.. we should get the hier
> strings autogenerated from the enum. Having lists like that in the
> source is quite errorprone.
>

Aye, spent some time looking for such in the code before discovering we
did not already do it.

Anyone have good ideas how to do that?

It looks from a short search like the best ways are to have a data file
and generate both enum and string array code at build-time from those.

Something that does a general:
   X.codes -> X_code.h + X_code.cc process.

creating a X_strings array in the .cc and X_code enum + extras in the .h.

Possibly automatically appending MAX_X at the end for safety and
iterator limit usage.

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE6 or 3.0.STABLE18
   Current Beta Squid 3.1.0.13
Received on Fri Aug 21 2009 - 01:55:15 MDT

This archive was generated by hypermail 2.2.0 : Fri Aug 21 2009 - 12:00:05 MDT