[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: Boolean Syntax not implemented (ITS#612)
I added an experiemental (ie: untested) booleanValidate and
booleanMatch routines without use of a normalizer...
A better approach would be to define booleanValidate as
numericStringValidate, add a normalizer which accepted
varients of true/false and normalized them to "TRUE"
and "FALSE", and add a prettier that stored the vaue
in normalized form.
At 01:44 PM 6/29/00 GMT, stephan.siano@suse.de wrote:
>Full_Name: Stephan Siano
>Version: 2.0-devel
>OS: Linux 2.2.14
>URL: ftp://ftp.openldap.org/incoming/
>Submission from: (NULL) (195.243.113.230)
>
>
>The boolean Syntax was not implemented. The patch below for schema_init
>implements
>the booleanValidate function (the content must be TRUE or FALSE) and maps the
>booleanNormalize to numericStringNormalize (which ist essentially the normalize
>Functions for Strings that do not contain whitespace characters in the middle
>of
>the string.
>
>
>/* $OpenLDAP: pkg/ldap/servers/slapd/schema_init.c,v 1.57 2000/06/28 03:29:09
>mrv Exp $ */
>
>24a25
>> #define booleanValidate NULL
>31,32c32
>< #define booleanNormalize
>numericStringNormalize
>
><
>---
>>
>34a35
>> #define booleanNormalize NULL
>301,323d301
>< }
><
>< static int
>< booleanValidate(
>< Syntax *syntax,
>< struct berval *in )
>< {
>< char *p;
><
>< if( (!in->bv_len) || (!in->bv_val) ) return LDAP_INVALID_SYNTAX;
>< p = in->bv_val;
><
>< /* Ignore initial whitespace */
>< while ( ASCII_SPACE( *p ) ) {
>< p++;
>< }
><
>< /* the value must be TRUE or FALSE */
>< if( !strncmp(p,"TRUE",5) || !strncmp(p,"FALSE",6) ) {
>< return LDAP_SUCCESS;
>< } else {
>< return LDAP_INVALID_SYNTAX;
>< }
>
>
>