Add custom code for CV_E* constants to convert-constants
authorIustin Pop <iustin@google.com>
Fri, 16 Nov 2012 13:24:20 +0000 (14:24 +0100)
committerIustin Pop <iustin@google.com>
Tue, 20 Nov 2012 09:25:37 +0000 (10:25 +0100)
commit9ba02574cefd8004e30d2f15b1eac0a7b395f681
tree7c821834f5e663464dd7a6c9f20dbd4e2bf184d2
parente1ebbfcf2de48b0cd7f6422cb772433688dc5f53
Add custom code for CV_E* constants to convert-constants

Currently, the cluster verify errors are defined as follows:

CV_ECLUSTER_FOO = (TCLUSTER, "ECLUSTER_FOO", "description")

This means there's no standalone name for the string "ECLUSTER_FOO",
which makes it hard to derive automatically a type for this union in
Haskell.

There are three possible fixes:

- manually separate the CV_ECLUSTER_FOO_STR = "ECLUSTER_FOO" in
  constants.py
- manually extract the strings in Haskell code
- change convert-constants to automatically export virtual constants
  for those

After discussion on IRC, I've taken the latter approach; even though a
bit hack-ish, it avoids manual work and potential errors.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
autotools/convert-constants