.. an email that didn't get copied to the list (from Paolo to me)

-------- Original Message --------
Subject: Re: [Help-smalltalk] Re: Calling LDAP C API from Smalltalk
Date: Sun, 28 Sep 2008 13:56:08 +0200
From: Paolo Bonzini <[email protected]>
To: Stephen Woolerton <[email protected]>
References: <[email protected]> <[email protected]> <[email protected]> <[email protected]> <[email protected]> <[email protected]> <[email protected]> <[email protected]> <[email protected]> <[email protected]>


It is rather ironic that the reason I began this exercise was to work
with mail routing on an LDAP server! The very attribute that won't
display the value :-).

I don't understand, did the C program work? :-)

  CObject subclass: BER [
    " -----------------------
    LBER_F( void )
    ber_free LDAP_P((
        BerElement *ber,
        int freebuf ));
    ------------------------- "
      BER class >> free [
    <cCall: 'ber_free' returning: #void args: #(#self #int)>
    ]
]

Why is this a class method?  You should have done something like

   free: arg [
      <cCall: 'ber_free' returning: #void args: #(#self #int)>
   ]

   free [ self free: 0]

and likewise:

  CObject subclass: LDAPMessage [
      LDAPMessage class >> free [
    <cCall: 'ldap_msgfree' returning: #int args: #(#self)>
    ]
]

This should also use an instance-side method.

Now it would be a nice exercise to turn it into a more Smalltalk-like API.

Paolo



_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to