help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] Re: Calling LDAP C API from Smalltalk


From: Stephen
Subject: Re: [Help-smalltalk] Re: Calling LDAP C API from Smalltalk
Date: Sat, 27 Sep 2008 23:00:23 +1200
User-agent: Thunderbird 2.0.0.17 (Macintosh/20080914)

Error is this now:-

stephenw$ ./ldapapi.st
started
... about to run the search.
... search completed
Found results with base DN: ou=Users,dc=example,dc=com
Found first attribute
Object: CString new: 1 "<0x103bb58>" error: Invalid argument CString(16r206130): must be a Boolean
SystemExceptions.MustBeBoolean(Exception)>>signal (AnsiExcept.st:216)
SystemExceptions.MustBeBoolean class(SystemExceptions.WrongClass class)>>signalOn:mustBe: (AnsiExcept.st:913)
SystemExceptions.MustBeBoolean class>>signalOn: (AnsiExcept.st:989)
CString(Object)>>mustBeBoolean (Object.st:1359)
UndefinedObject>>executeStatements (ldapapi.st:177)



The block of code handling attribute/values looks like this now:-
                [ aPtr isNil ] whileFalse: [
                        attr := String fromCData: aPtr.
                        aPtr free.

                        vals := ldap getValues: entry attribute: attr.
                        vals isNull ifTrue: [
                                val := vals.
                                attr printNl.
                                [ val value isNil ] whileFalse: [
                                        (attr->val value) printNl.
                                        val incr ].
                                "vals free. "
                        ].
                        aPtr := ldap nextAttribute: entry ber: ber.
                ]



The isNull method looks like this now:-
  CObject extend [
        "Will be in 3.1"
        isNull [ self address = 0 ]
  ]


Thank you
Stephen




reply via email to

[Prev in Thread] Current Thread [Next in Thread]