[Openvas-devel] [Openvas-commits] r6923 - in trunk/openvas-libraries: . misc

Matthew Mundell matthew.mundell at intevation.de
Mon Mar 8 16:51:38 CET 2010


> > > +#include "ldap_auth.h"
> > > +
> > > +#include <stdio.h>
> > > +
> > > +#include "glib.h"
> >
> > #include <stdio.h>
> > #include <glib.h>
> > ?
>
> See below.

I just meant the angled brackets.

> > > +ldap_auth_info_t
> > > +ldap_auth_info_new (const gchar* _auth_dn_before_user,
> > > +                    const gchar* _auth_dn_after_user,
> > > +                    const gchar* _ldap_host)
> > > +{
> >
> > Why the underscores suddenly, Felix?
>
> See below.

> > > +ldap_auth_info_t
> > > +ldap_auth_info_new (const gchar* _auth_dn_before_user,
> > > +                    const gchar* _auth_dn_after_user,
> > > +                    const gchar* _ldap_host);
> >
> > 	nvti_t *nvti_new (void);
> >
> > 	void nvti_free (nvti_t *);
> >
> > I think we should aim for more consistency in our interfaces.
>
> I dont have any problem with trying hard to comply to a given set of rules
> (remember, I put forward the "style" Change Request). I also agree on that we
> can make the rules quite strict (others dont, for good reasons as well).
>
> I personally like grouping of includes and named parameters in header files a
> lot. Although opposite to other conventions, I have no problem with
> the "underscored" parameter names. The "constructor" takes arguments because
> the ldap configuration should be opaque and immutable (in contrast to nvtis).
> I dislike page breaks.

I was wondering if there was a reason for the underscores.  Are they
arbitrary or is there some meaning attached to them?  They look so out of
place to me that I had to comment, especially given that only that function
uses the underscores.

I think constructors with arguments is fine and in many places convenient.
I was referring to the return value.  For NVT's we return a pointer whereas
for ldap_auth's we return a type that hides away the pointer.  Similarly
nvti_free takes a nvti_t*, whereas ldap_auth_info_free takes an
ldap_auth_info_t.  I'm pretty sure I've used both styles in the Manager.
Perhaps we could agree on one.  Like you say, I should propose a patch to
the style guide...
--
Intevation GmbH, Neuer Graben 17, 49074 Osnabrück | AG Osnabrück, HR B 18998
Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner


More information about the Openvas-devel mailing list