This is the mail archive of the gnats-devel@sources.redhat.com mailing list for the GNATS project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

New dbconfig keyword multi-enumerated-in-file


Hi,

We wanted to have fields of type Multi-Enum where
the allowed values are stored in an extra file like 
it is done with the Enumerated-in-File type.

I made a little patch to make this possible.

The patch built and seemed to give reasonable results with query-pr.

How to test: 
	Take a dbconfig file and replace enumerated-in-file with 
	multi-enumerated-in-file for a field "FIELD". 
	Now query-pr with the options
	  --field-type=FIELD      --valid-values=FIELD
	you will see tye MultiEnum and the values from the file.

Todo:
      Documentation not updated.
      not tested in full integration
-- 
     ______   ___        
    /  ___/__/  /                 Caldera (Deutschland) GmbH          
   /  /_/ _  / /__        Naegelsbachstr. 49c, 91052 Erlangen, Germany 
  /_____/_/ /____/                  http://www.caldera.de       
 ==== /____/ =====   Dipl. Inf. Johannes Poehlmann, mail: jhp@caldera.de
Caldera OpenLinux    phone: ++49 9131 7192 335, fax: ++49 9131 7192 399
diff -u -p -r1.32 fconfig.y
--- fconfig.y	2001/04/15 18:11:51	1.32
+++ fconfig.y	2001/07/16 10:05:18
@@ -43,6 +43,7 @@
 %token REQUIRECHANGEREASONTOK READONLYTOK BINARYINDEXTOK RAWTOK
 %token BADTOK AUXFLAGSTOK PRLISTTOK MAXPRSTOK EDITONLYTOK VIRTUALFORMATTOK
 %token CATPERMSTOK
+%token MULTI_ENUM_IN_FILE
 %type <sval> optChangeExpr
 %type <qstr> QSTRING
 %type <intval> INTVAL
@@ -201,6 +202,13 @@ enumType	: ENUM '{' enumcontents '}' {
 		}
 		| ENUM_IN_FILE '{' enumFileContents '}' {
 		    currField->datatype = Enum;
+		    currField->defaultSearchType = RegCmp;
+		    initAdmField (currField);
+		}
+
+		/* new: like ENUM_IN_FILE but use type MultiEnum */
+		| MULTI_ENUM_IN_FILE '{' enumFileContents '}' {
+		    currField->datatype = MultiEnum;
 		    currField->defaultSearchType = RegCmp;
 		    initAdmField (currField);
 		}
diff -u -p -r1.21 fconfigl.l
--- fconfigl.l	2001/04/15 18:11:51	1.21
+++ fconfigl.l	2001/07/16 10:05:18
@@ -168,6 +168,10 @@ enumerated-in-file {
   return ENUM_IN_FILE;
 }
 
+multi-enumerated-in-file {
+  return MULTI_ENUM_IN_FILE;
+}
+
 key {
   return KEYTOK;
 }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]