X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fldapd%2Fsyntax.c;h=955ce71734bd9df70ebea1148031d8772e80346e;hb=edd464ee8f98f566b94851d4d8463ae4e1a407eb;hp=8569478eebe994d4397769c9ab150604b4b36e59;hpb=42e0d83cb3a1a1c5b25183f1ab74ce7edbe25de7;p=openldap diff --git a/servers/ldapd/syntax.c b/servers/ldapd/syntax.c index 8569478eeb..955ce71734 100644 --- a/servers/ldapd/syntax.c +++ b/servers/ldapd/syntax.c @@ -10,18 +10,25 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include + +#include +#include +#include + #include #include #include #include #include #include -#include -#include +extern oid_table_attr *name2attr( char * ); +/*extern AttributeValue str_at2AttrV( char *, IF_AttributeType * );*/ + #include "lber.h" +#include "../../libraries/liblber/lber-int.h" /* get struct berelement */ #include "ldap.h" #include "common.h" @@ -52,9 +59,10 @@ short ldap_dLSubmitPermission_syntax; static void de_t61( char *s, int t61mark ); static int syntax_is_string( short syntax ); -static get_one_syntax( char *attrib, int required ) +static int +get_one_syntax( char *attrib, int required ) { - oid_table_attr *p, *name2attr(); + oid_table_attr *p; if ( (p = name2attr( attrib )) != (oid_table_attr *) 0 ) return( p->oa_syntax ); @@ -69,10 +77,8 @@ static get_one_syntax( char *attrib, int required ) } void -get_syntaxes() +get_syntaxes( void ) { - oid_table_attr *name2attr(); - Debug( LDAP_DEBUG_TRACE, "get_syntaxes\n", 0, 0, 0 ); ldap_photo_syntax = get_one_syntax( "photo", 0 ); @@ -129,7 +135,8 @@ get_syntaxes() * notation. (e.g., OID.2.6.53). * */ -static void attr_key_rfc1779 ( +static void +attr_key_rfc1779( AttributeType at, char *key /* return key, caller allocated */ ) @@ -176,7 +183,6 @@ dn_print_real( int firstrdn; char *value; PS rps; - void ldap_dn_print(); char key[512]; if ( dn == NULLDN ) @@ -332,7 +338,8 @@ encode_dn( return( rc ); } -static put_jpeg_value( BerElement *ber, AttributeValue av ) +static int +put_jpeg_value( BerElement *ber, AttributeValue av ) { PE pe; int len; @@ -375,7 +382,8 @@ static put_jpeg_value( BerElement *ber, AttributeValue av ) return( 0 ); } -static put_audio_value( BerElement *ber, AttributeValue av ) +static int +put_audio_value( BerElement *ber, AttributeValue av ) { struct qbuf *qb, *p; int rc, len; @@ -412,7 +420,8 @@ static put_audio_value( BerElement *ber, AttributeValue av ) return( rc ); } -static put_photo_value( BerElement *ber, AttributeValue av ) +static int +put_photo_value( BerElement *ber, AttributeValue av ) { PE pe; PS ps; @@ -474,7 +483,8 @@ static put_photo_value( BerElement *ber, AttributeValue av ) return( 0 ); } -static put_values( +static int +put_values( BerElement *ber, PS ps, short syntax, @@ -544,9 +554,6 @@ int encode_attrs( BerElement *ber, Attr_Sequence as ) { PS ps; -#ifdef COMPAT20 - extern int ldap_compat; -#endif Debug( LDAP_DEBUG_TRACE, "encode_attrs\n", 0, 0, 0 ); @@ -555,7 +562,7 @@ encode_attrs( BerElement *ber, Attr_Sequence as ) if ( str_setup( ps, NULLCP, 0, 0 ) == NOTOK ) return( -1 ); -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 if ( ber_printf( ber, "t{", ldap_compat == 20 ? OLD_LBER_SEQUENCE : LBER_SEQUENCE ) == -1 ) { #else @@ -570,7 +577,7 @@ encode_attrs( BerElement *ber, Attr_Sequence as ) AttrT_print( ps, as->attr_type, EDBOUT ); *ps->ps_ptr = '\0'; -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 if ( ber_printf( ber, "t{st[", ldap_compat == 20 ? OLD_LBER_SEQUENCE : LBER_SEQUENCE, ps->ps_base, ldap_compat == 20 ? OLD_LBER_SET : LBER_SET ) == -1 ) { @@ -613,7 +620,8 @@ trim_trailing_spaces( char *s ) } } -DN ldap_str2dn( char *str ) +DN +ldap_str2dn( char *str ) { DN dn, save; RDN rdn, newrdn, tmprdn; @@ -776,7 +784,8 @@ DN ldap_str2dn( char *str ) #define T61 "{T.61}" #define T61LEN 6 -static void de_t61( char *s, int t61mark ) +static void +de_t61( char *s, int t61mark ) { char *next = s; int c, hex; @@ -956,7 +965,6 @@ AttributeValue ldap_str_at2AttrV( char *str, AttributeType type ) { char *s, *res, *r; - AttributeValue str_at2AttrV(); Debug( LDAP_DEBUG_TRACE, "ldap_str_at2AttrV str (%s) type (%s)\n", str, type->oa_ot.ot_name, 0 );