[CalendarServer-changes] [165] PyOpenDirectory/branches/generalized-api-56

source_changes at macosforge.org source_changes at macosforge.org
Wed Sep 20 16:57:18 PDT 2006


Revision: 165
          http://trac.macosforge.org/projects/calendarserver/changeset/165
Author:   dreid at apple.com
Date:     2006-09-20 16:57:18 -0700 (Wed, 20 Sep 2006)

Log Message:
-----------
Reorganize, include some constants and an __init__ as well as the DirectoryService.c file so it can build without pyrex.  Nothing to placate linux users yet.  Fix setup.py to build the new module, and include pyxtest until I get a chance to/figure out how to write real unittests for this.

Modified Paths:
--------------
    PyOpenDirectory/branches/generalized-api-56/setup.py

Added Paths:
-----------
    PyOpenDirectory/branches/generalized-api-56/DirectoryServices/
    PyOpenDirectory/branches/generalized-api-56/DirectoryServices/Constants.py
    PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx
    PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx
    PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.c
    PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx
    PyOpenDirectory/branches/generalized-api-56/DirectoryServices/__init__.py
    PyOpenDirectory/branches/generalized-api-56/DirectoryServices/dsHeader.pyx
    PyOpenDirectory/branches/generalized-api-56/pyxtest.py

Removed Paths:
-------------
    PyOpenDirectory/branches/generalized-api-56/src/

Added: PyOpenDirectory/branches/generalized-api-56/DirectoryServices/Constants.py
===================================================================
--- PyOpenDirectory/branches/generalized-api-56/DirectoryServices/Constants.py	                        (rev 0)
+++ PyOpenDirectory/branches/generalized-api-56/DirectoryServices/Constants.py	2006-09-20 23:57:18 UTC (rev 165)
@@ -0,0 +1,349 @@
+# -
+# Meta Record Type Constants
+# -
+kDSRecordsAll = "dsRecordsAll"
+kDSRecordsStandardAll = "dsRecordsStandardAll"
+kDSRecordsNativeAll = "dsRecordsNativeAll"
+kDSStdRecordTypePrefix = "dsRecTypeStandard:"
+kDSNativeRecordTypePrefix = "dsRecTypeNative:"
+kDSStdRecordTypeAll = "dsRecTypeStandard:All"
+kDSStdUserNamesMeta = "dsRecTypeStandard:MetaUserNames"
+# -
+# Specific Record Type Constants
+# -
+kDSStdRecordTypeAccessControls = "dsRecTypeStandard:AccessControls"
+kDSStdRecordTypeAFPServer = "dsRecTypeStandard:AFPServer"
+kDSStdRecordTypeAFPUserAliases = "dsRecTypeStandard:AFPUserAliases"
+kDSStdRecordTypeAliases = "dsRecTypeStandard:Aliases"
+kDSStdRecordTypeAutoServerSetup = "dsRecTypeStandard:AutoServerSetup"
+kDSStdRecordTypeBootp = "dsRecTypeStandard:Bootp"
+kDSStdRecordTypeCertificateAuthorities = "dsRecTypeStandard:CertificateAuthorities"
+kDSStdRecordTypeComputerLists = "dsRecTypeStandard:ComputerLists"
+kDSStdRecordTypeComputers = "dsRecTypeStandard:Computers"
+kDSStdRecordTypeConfig = "dsRecTypeStandard:Config"
+kDSStdRecordTypeEthernets = "dsRecTypeStandard:Ethernets"
+kDSStdRecordTypeFileMakerServers = "dsRecTypeStandard:FileMakerServers"
+kDSStdRecordTypeFTPServer = "dsRecTypeStandard:FTPServer"
+kDSStdRecordTypeGroupAliases = "dsRecTypeStandard:GroupAliases"
+kDSStdRecordTypeGroups = "dsRecTypeStandard:Groups"
+kDSStdRecordTypeHostServices = "dsRecTypeStandard:HostServices"
+kDSStdRecordTypeHosts = "dsRecTypeStandard:Hosts"
+kDSStdRecordTypeLDAPServer = "dsRecTypeStandard:LDAPServer"
+kDSStdRecordTypeLocations = "dsRecTypeStandard:Locations"
+kDSStdRecordTypeMachines = "dsRecTypeStandard:Machines"
+kDSStdRecordTypeMeta = "dsRecTypeStandard:AppleMetaRecord"
+kDSStdRecordTypeMounts = "dsRecTypeStandard:Mounts"
+kDSStdRecordTypMounts = "dsRecTypeStandard:Mounts"
+kDSStdRecordTypeNeighborhoods = "dsRecTypeStandard:Neighborhoods"
+kDSStdRecordTypeNFS = "dsRecTypeStandard:NFS"
+kDSStdRecordTypeNetDomains = "dsRecTypeStandard:NetDomains"
+kDSStdRecordTypeNetGroups = "dsRecTypeStandard:NetGroups"
+kDSStdRecordTypeNetworks = "dsRecTypeStandard:Networks"
+kDSStdRecordTypePasswordServer = "dsRecTypeStandard:PasswordServer"
+kDSStdRecordTypePeople = "dsRecTypeStandard:People"
+kDSStdRecordTypePresetComputerLists = "dsRecTypeStandard:PresetComputerLists"
+kDSStdRecordTypePresetGroups = "dsRecTypeStandard:PresetGroups"
+kDSStdRecordTypePresetUsers = "dsRecTypeStandard:PresetUsers"
+kDSStdRecordTypePrintService = "dsRecTypeStandard:PrintService"
+kDSStdRecordTypePrintServiceUser = "dsRecTypeStandard:PrintServiceUser"
+kDSStdRecordTypePrinters = "dsRecTypeStandard:Printers"
+kDSStdRecordTypeProtocols = "dsRecTypeStandard:Protocols"
+kDSStdRecordTypProtocols = "dsRecTypeStandard:Protocols"
+kDSStdRecordTypeQTSServer = "dsRecTypeStandard:QTSServer"
+kDSStdRecordTypeRPC = "dsRecTypeStandard:RPC"
+kDSStdRecordTypRPC = "dsRecTypeStandard:RPC"
+kDSStdRecordTypeSMBServer = "dsRecTypeStandard:SMBServer"
+kDSStdRecordTypeServer = "dsRecTypeStandard:Server"
+kDSStdRecordTypeServices = "dsRecTypeStandard:Services"
+kDSStdRecordTypeSharePoints = "dsRecTypeStandard:SharePoints"
+kDSStdRecordTypeUserAliases = "dsRecTypeStandard:UserAliases"
+kDSStdRecordTypeUsers = "dsRecTypeStandard:Users"
+kDSStdRecordTypeWebServer = "dsRecTypeStandard:WebServer"
+# -
+# Meta Attribute Type Constants
+# -
+kDSAttributesAll = "dsAttributesAll"
+kDSAttributesStandardAll = "dsAttributesStandardAll"
+kDSAttributesNativeAll = "dsAttributesNativeAll"
+kDSStdAttrTypePrefix = "dsAttrTypeStandard:"
+kDSNativeAttrTypePrefix = "dsAttrTypeNative:"
+kDSAttrNone = "dsNone"
+# -
+# Specific Attribute Type Constants
+# -
+# -
+# Single Valued Specific Attribute Type Constants
+# -
+kDS1AttrAdminLimits = "dsAttrTypeStandard:AdminLimits"
+kDS1AttrAliasData = "dsAttrTypeStandard:AppleAliasData"
+kDS1AttrAlternateDatastoreLocation = "dsAttrTypeStandard:AlternateDatastoreLocation"
+kDS1AttrAuthenticationHint = "dsAttrTypeStandard:AuthenticationHint"
+kDS1AttrAuthorityRevocationList = "dsAttrTypeStandard:AuthorityRevocationList"
+kDS1AttrBootFile = "dsAttrTypeStandard:BootFile"
+kDS1AttrCACertificate = "dsAttrTypeStandard:CACertificate"
+kDS1AttrCapabilities = "dsAttrTypeStandard:Capabilities"
+kDS1AttrCategory = "dsAttrTypeStandard:Category"
+kDS1AttrCertificateRevocationList = "dsAttrTypeStandard:CertificateRevocationList"
+kDS1AttrChange = "dsAttrTypeStandard:Change"
+kDS1AttrComment = "dsAttrTypeStandard:Comment"
+kDS1AttrContactPerson = "dsAttrTypeStandard:ContactPerson"
+kDS1AttrCreationTimestamp = "dsAttrTypeStandard:CreationTimestamp"
+kDS1AttrCrossCertificatePair = "dsAttrTypeStandard:CrossCertificatePair"
+kDS1AttrDataStamp = "dsAttrTypeStandard:DataStamp"
+kDS1AttrDistinguishedName = "dsAttrTypeStandard:RealName"
+kDS1AttrDNSDomain = "dsAttrTypeStandard:DNSDomain"
+kDS1AttrDNSNameServer = "dsAttrTypeStandard:DNSNameServer"
+kDS1AttrENetAddress = "dsAttrTypeStandard:ENetAddress"
+kDS1AttrExpire = "dsAttrTypeStandard:Expire"
+kDS1AttrFirstName = "dsAttrTypeStandard:FirstName"
+kDS1AttrGeneratedUID = "dsAttrTypeStandard:GeneratedUID"
+kDS1AttrHomeDirectoryQuota = "dsAttrTypeStandard:HomeDirectoryQuota"
+kDS1AttrHomeDirectorySoftQuota = "dsAttrTypeStandard:HomeDirectorySoftQuota"
+kDS1AttrHomeLocOwner = "dsAttrTypeStandard:HomeLocOwner"
+kDS1StandardAttrHomeLocOwner = kDS1AttrHomeLocOwner
+kDS1AttrInternetAlias = "dsAttrTypeStandard:InetAlias"
+kDS1AttrKDCConfigData = "dsAttrTypeStandard:KDCConfigData"
+kDS1AttrLastName = "dsAttrTypeStandard:LastName"
+kDS1AttrLocation = "dsAttrTypeStandard:Location"
+kDS1AttrMCXFlags = "dsAttrTypeStandard:MCXFlags"
+kDS1AttrMCXSettings = "dsAttrTypeStandard:MCXSettings"
+kDS1AttrMailAttribute = "dsAttrTypeStandard:MailAttribute"
+kDS1AttrMiddleName = "dsAttrTypeStandard:MiddleName"
+kDS1AttrModificationTimestamp = "dsAttrTypeStandard:ModificationTimestamp"
+kDSNAttrNeighborhoodAlias = "dsAttrTypeStandard:NeighborhoodAlias"
+kDS1AttrNeighborhoodType = "dsAttrTypeStandard:NeighborhoodType"
+kDS1AttrNetworkView = "dsAttrTypeStandard:NetworkView"
+kDS1AttrNFSHomeDirectory = "dsAttrTypeStandard:NFSHomeDirectory"
+kDS1AttrNote = "dsAttrTypeStandard:Note"
+kDS1AttrOwner = "dsAttrTypeStandard:Owner"
+kDS1AttrPassword = "dsAttrTypeStandard:Password"
+kDS1AttrPasswordPlus = "dsAttrTypeStandard:PasswordPlus"
+kDS1AttrPasswordPolicyOptions = "dsAttrTypeStandard:PasswordPolicyOptions"
+kDS1AttrPasswordServerList = "dsAttrTypeStandard:PasswordServerList"
+kDS1AttrPasswordServerLocation = "dsAttrTypeStandard:PasswordServerLocation"
+kDS1AttrPicture = "dsAttrTypeStandard:Picture"
+kDS1AttrPort = "dsAttrTypeStandard:Port"
+kDS1AttrPresetUserIsAdmin = "dsAttrTypeStandard:PresetUserIsAdmin"
+kDS1AttrPrimaryGroupID = "dsAttrTypeStandard:PrimaryGroupID"
+kDS1AttrPrinter1284DeviceID = "dsAttrTypeStandard:Printer1284DeviceID"
+kDS1AttrPrinterLPRHost = "dsAttrTypeStandard:PrinterLPRHost"
+kDS1AttrPrinterLPRQueue = "dsAttrTypeStandard:PrinterLPRQueue"
+kDS1AttrPrinterMakeAndModel = "dsAttrTypeStandard:PrinterMakeAndModel"
+kDS1AttrPrinterType = "dsAttrTypeStandard:PrinterType"
+kDS1AttrPrinterURI = "dsAttrTypeStandard:PrinterURI"
+kDSNAttrPrinterXRISupported = "dsAttrTypeStandard:PrinterXRISupported"
+kDS1AttrPrintServiceInfoText = "dsAttrTypeStandard:PrintServiceInfoText"
+kDS1AttrPrintServiceInfoXML = "dsAttrTypeStandard:PrintServiceInfoXML"
+kDS1AttrPrintServiceUserData = "dsAttrTypeStandard:PrintServiceUserData"
+kDS1AttrRealUserID = "dsAttrTypeStandard:RealUserID"
+kDS1AttrRelativeDNPrefix = "dsAttrTypeStandard:RelativeDNPrefix"
+kDS1AttrSMBAcctFlags = "dsAttrTypeStandard:SMBAccountFlags"
+kDS1AttrSMBGroupRID = "dsAttrTypeStandard:SMBGroupRID"
+kDS1AttrSMBHome = "dsAttrTypeStandard:SMBHome"
+kDS1AttrSMBHomeDrive = "dsAttrTypeStandard:SMBHomeDrive"
+kDS1AttrSMBKickoffTime = "dsAttrTypeStandard:SMBKickoffTime"
+kDS1AttrSMBLogoffTime = "dsAttrTypeStandard:SMBLogoffTime"
+kDS1AttrSMBLogonTime = "dsAttrTypeStandard:SMBLogonTime"
+kDS1AttrSMBPrimaryGroupSID = "dsAttrTypeStandard:SMBPrimaryGroupSID"
+kDS1AttrSMBPWDLastSet = "dsAttrTypeStandard:SMBPasswordLastSet"
+kDS1AttrSMBProfilePath = "dsAttrTypeStandard:SMBProfilePath"
+kDS1AttrSMBRID = "dsAttrTypeStandard:SMBRID"
+kDS1AttrSMBScriptPath = "dsAttrTypeStandard:SMBScriptPath"
+kDS1AttrSMBSID = "dsAttrTypeStandard:SMBSID"
+kDS1AttrSMBUserWorkstations = "dsAttrTypeStandard:SMBUserWorkstations"
+kDS1AttrServiceType = "dsAttrTypeStandard:ServiceType"
+kDS1AttrSetupAdvertising = "dsAttrTypeStandard:SetupAssistantAdvertising"
+kDS1AttrSetupAutoRegister = "dsAttrTypeStandard:SetupAssistantAutoRegister"
+kDS1AttrSetupLocation = "dsAttrTypeStandard:SetupAssistantLocation"
+kDS1AttrSetupOccupation = "dsAttrTypeStandard:Occupation"
+kDS1AttrTimeToLive = "dsAttrTypeStandard:TimeToLive"
+kDS1AttrUniqueID = "dsAttrTypeStandard:UniqueID"
+kDS1AttrUserCertificate = "dsAttrTypeStandard:UserCertificate"
+kDS1AttrUserPKCS12Data = "dsAttrTypeStandard:UserPKCS12Data"
+kDS1AttrUserShell = "dsAttrTypeStandard:UserShell"
+kDS1AttrUserSMIMECertificate = "dsAttrTypeStandard:UserSMIMECertificate"
+kDS1AttrVFSDumpFreq = "dsAttrTypeStandard:VFSDumpFreq"
+kDS1AttrVFSLinkDir = "dsAttrTypeStandard:VFSLinkDir"
+kDS1AttrVFSPassNo = "dsAttrTypeStandard:VFSPassNo"
+kDS1AttrVFSType = "dsAttrTypeStandard:VFSType"
+kDS1AttrWeblogURI = "dsAttrTypeStandard:WeblogURI"
+kDS1AttrXMLPlist = "dsAttrTypeStandard:XMLPlist"
+# -
+# Multiple Valued Specific Attribute Type Constants
+# -
+kDSNAttrAccessControlEntry = "dsAttrTypeStandard:AccessControlEntry"
+kDSNAttrAddressLine1 = "dsAttrTypeStandard:AddressLine1"
+kDSNAttrAddressLine2 = "dsAttrTypeStandard:AddressLine2"
+kDSNAttrAddressLine3 = "dsAttrTypeStandard:AddressLine3"
+kDSNAttrAreaCode = "dsAttrTypeStandard:AreaCode"
+kDSNAttrAuthenticationAuthority = "dsAttrTypeStandard:AuthenticationAuthority"
+kDSNAttrBootParams = "dsAttrTypeStandard:BootParams"
+kDSNAttrBuilding = "dsAttrTypeStandard:Building"
+kDSNAttrCity = "dsAttrTypeStandard:City"
+kDSNAttrComputerAlias = "dsAttrTypeStandard:ComputerAlias"
+kDSNAttrComputers = "dsAttrTypeStandard:Computers"
+kDSNAttrCountry = "dsAttrTypeStandard:Country"
+kDSNAttrDepartment = "dsAttrTypeStandard:Department"
+kDSNAttrDNSName = "dsAttrTypeStandard:DNSName"
+kDSNAttrEMailAddress = "dsAttrTypeStandard:EMailAddress"
+kDSNAttrFaxNumber = "dsAttrTypeStandard:FAXNumber"
+kDSNAttrGroup = "dsAttrTypeStandard:Group"
+kDSNAttrGroupMembers = "dsAttrTypeStandard:GroupMembers"
+kDSNAttrGroupMembership = "dsAttrTypeStandard:GroupMembership"
+kDSNAttrHTML = "dsAttrTypeStandard:HTML"
+kDSNAttrHomeDirectory = "dsAttrTypeStandard:HomeDirectory"
+kDSNAttrIMHandle = "dsAttrTypeStandard:IMHandle"
+kDSNAttrIPAddress = "dsAttrTypeStandard:IPAddress"
+kDSNAttrJobTitle = "dsAttrTypeStandard:JobTitle"
+kDSNAttrKDCAuthKey = "dsAttrTypeStandard:KDCAuthKey"
+kDSNAttrKeywords = "dsAttrTypeStandard:Keywords"
+kDSNAttrLDAPReadReplicas = "dsAttrTypeStandard:LDAPReadReplicas"
+kDSNAttrLDAPWriteReplicas = "dsAttrTypeStandard:LDAPWriteReplicas"
+kDSNAttrMachineServes = "dsAttrTypeStandard:MachineServes"
+kDSNAttrMCXSettings = "dsAttrTypeStandard:MCXSettings"
+kDSNAttrMIME = "dsAttrTypeStandard:MIME"
+kDSNAttrMember = "dsAttrTypeStandard:Member"
+kDSNAttrMobileNumber = "dsAttrTypeStandard:MobileNumber"
+kDSNAttrNBPEntry = "dsAttrTypeStandard:NBPEntry"
+kDSNAttrNestedGroups = "dsAttrTypeStandard:NestedGroups"
+kDSNAttrNetGroups = "dsAttrTypeStandard:NetGroups"
+kDSNAttrNickName = "dsAttrTypeStandard:NickName"
+kDSNAttrNodePathXMLPlist = "dsAttrTypeStandard:NodePathXMLPlist"
+kDSNAttrOrganizationName = "dsAttrTypeStandard:OrganizationName"
+kDSNAttrPagerNumber = "dsAttrTypeStandard:PagerNumber"
+kDSNAttrPhoneNumber = "dsAttrTypeStandard:PhoneNumber"
+kDSNAttrPGPPublicKey = "dsAttrTypeStandard:PGPPublicKey"
+kDSNAttrPostalAddress = "dsAttrTypeStandard:PostalAddress"
+kDSNAttrPostalCode = "dsAttrTypeStandard:PostalCode"
+kDSNAttrNamePrefix = "dsAttrTypeStandard:NamePrefix"
+kDSNAttrProtocols = "dsAttrTypeStandard:Protocols"
+kDSNAttrRecordName = "dsAttrTypeStandard:RecordName"
+kDSNAttrState = "dsAttrTypeStandard:State"
+kDSNAttrStreet = "dsAttrTypeStandard:Street"
+kDSNAttrNameSuffix = "dsAttrTypeStandard:NameSuffix"
+kDSNAttrURL = "dsAttrTypeStandard:URL"
+kDSNAttrURLForNSL = "dsAttrTypeStandard:URLForNSL"
+kDSNAttrVFSOpts = "dsAttrTypeStandard:VFSOpts"
+# -
+# Other Attribute Type Constants
+# -
+kDS1AttrAdminStatus = "dsAttrTypeStandard:AdminStatus"
+kDS1AttrAlias = "dsAttrTypeStandard:Alias"
+kDS1AttrAuthCredential = "dsAttrTypeStandard:AuthCredential"
+kDS1AttrCopyTimestamp = "dsAttrTypeStandard:CopyTimestamp"
+#define     kDS1AttrDateRecordCreated = "dsAttrTypeStandard:DateRecordCreated"
+kDS1AttrKerberosRealm = "dsAttrTypeStandard:KerberosRealm"
+kDS1AttrNTDomainComputerAccount = "dsAttrTypeStandard:NTDomainComputerAccount"
+kDSNAttrOriginalHomeDirectory = "dsAttrTypeStandard:OriginalHomeDirectory"
+kDS1AttrOriginalNFSHomeDirectory = "dsAttrTypeStandard:OriginalNFSHomeDirectory"
+kDS1AttrOriginalNodeName = "dsAttrTypeStandard:OriginalNodeName"
+kDS1AttrPrimaryNTDomain = "dsAttrTypeStandard:PrimaryNTDomain"
+kDS1AttrPwdAgingPolicy = "dsAttrTypeStandard:PwdAgingPolicy"
+kDS1AttrRARA = "dsAttrTypeStandard:RARA"
+kDS1AttrReadOnlyNode = "dsAttrTypeStandard:ReadOnlyNode"
+kDS1AttrRecordImage = "dsAttrTypeStandard:RecordImage"
+#define kDS1AttrSMBGroupRID = "dsAttrTypeStandard:SMBGroupRID"
+kDS1AttrTimePackage = "dsAttrTypeStandard:TimePackage"
+kDS1AttrTotalSize = "dsAttrTypeStandard:TotalSize"
+kDSNAttrAllNames = "dsAttrTypeStandard:AllNames"
+kDSNAttrAuthMethod = "dsAttrTypeStandard:AuthMethod"
+kDSNAttrMetaNodeLocation = "dsAttrTypeStandard:AppleMetaNodeLocation"
+kDSNAttrNodePath = "dsAttrTypeStandard:NodePath"
+kDSNAttrPlugInInfo = "dsAttrTypeStandard:PlugInInfo"
+kDSNAttrRecordAlias = "dsAttrTypeStandard:RecordAlias"
+kDSNAttrRecordType = "dsAttrTypeStandard:RecordType"
+kDSNAttrSchema = "dsAttrTypeStandard:Scheama"
+kDSNAttrSetPasswdMethod = "dsAttrTypeStandard:SetPasswdMethod"
+kDSNAttrSubNodes = "dsAttrTypeStandard:SubNodes"
+kStandardSourceAlias = "dsAttrTypeStandard:AppleMetaAliasSource"
+kStandardTargetAlias = "dsAttrTypeStandard:AppleMetaAliasTarget"
+# -
+# Search Node attribute type Constants
+# -
+kDS1AttrSearchPath = "dsAttrTypeStandard:SearchPath"
+kDSNAttrSearchPath = "dsAttrTypeStandard:SearchPath"
+kDS1AttrSearchPolicy = "dsAttrTypeStandard:SearchPolicy"
+kDS1AttrNSPSearchPath = "dsAttrTypeStandard:NSPSearchPath"
+kDSNAttrNSPSearchPath = "dsAttrTypeStandard:NSPSearchPath"
+kDS1AttrLSPSearchPath = "dsAttrTypeStandard:LSPSearchPath"
+kDSNAttrLSPSearchPath = "dsAttrTypeStandard:LSPSearchPath"
+kDS1AttrCSPSearchPath = "dsAttrTypeStandard:CSPSearchPath"
+kDSNAttrCSPSearchPath = "dsAttrTypeStandard:CSPSearchPath"
+# -
+# Authentication Constants
+# -
+kDSStdAuthMethodPrefix = "dsAuthMethodStandard:"
+kDSNativeAuthMethodPrefix = "dsAuthMethodNative:"
+kDSSetPasswdBestOf = "dsSetPasswdBestOf"
+kDSValueAuthAuthorityBasic = ";basic;"
+kDSTagAuthAuthorityBasic = "basic"
+kDSValueAuthAuthorityDefault = kDSValueAuthAuthorityBasic
+kDSValueAuthAuthorityLocalWindowsHash = ";LocalWindowsHash;"
+kDSTagAuthAuthorityLocalWindowsHash = "LocalWindowsHash"
+kDSValueAuthAuthorityShadowHash = ";ShadowHash;"
+kDSTagAuthAuthorityShadowHash = "ShadowHash"
+kDSTagAuthAuthorityBetterHashOnly = "BetterHashOnly"
+kDSValueAuthAuthorityPasswordServerPrefix = ";ApplePasswordServer;"
+kDSTagAuthAuthorityPasswordServer = "ApplePasswordServer"
+kDSValueAuthAuthorityKerberosv5 = ";Kerberosv5;"
+kDSTagAuthAuthorityKerberosv5 = "Kerberosv5"
+kDSValueAuthAuthorityLocalCachedUser = ";LocalCachedUser;"
+kDSTagAuthAuthorityLocalCachedUser = "LocalCachedUser"
+kDSValueAuthAuthorityDisabledUser = ";DisabledUser;"
+kDSTagAuthAuthorityDisabledUser = "DisabledUser"
+kDSValueNonCryptPasswordMarker = "********"
+# -
+# Authentication Type Constants
+# -
+kDSStdAuth2WayRandom = "dsAuthMethodStandard:dsAuth2WayRandom"
+kDSStdAuth2WayRandomChangePasswd = "dsAuthMethodStandard:dsAuth2WayRandomChangePasswd"
+kDSStdAuthAPOP = "dsAuthMethodStandard:dsAuthAPOP"
+kDSStdAuthCHAP = "dsAuthMethodStandard:dsAuthCHAP"
+kDSStdAuthCRAM_MD5 = "dsAuthMethodStandard:dsAuthNodeCRAM-MD5"
+kDSStdAuthChangePasswd = "dsAuthMethodStandard:dsAuthChangePasswd"
+kDSStdAuthClearText = "dsAuthMethodStandard:dsAuthClearText"
+kDSStdAuthCrypt = "dsAuthMethodStandard:dsAuthCrypt"
+kDSStdAuthDIGEST_MD5 = "dsAuthMethodStandard:dsAuthNodeDIGEST-MD5"
+kDSStdAuthDeleteUser = "dsAuthMethodStandard:dsAuthDeleteUser"
+kDSStdAuthGetEffectivePolicy = "dsAuthMethodStandard:dsAuthGetEffectivePolicy"
+kDSStdAuthGetGlobalPolicy = "dsAuthMethodStandard:dsAuthGetGlobalPolicy"
+kDSStdAuthGetKerberosPrincipal = "dsAuthMethodStandard:dsAuthGetKerberosPrincipal"
+kDSStdAuthGetPolicy = "dsAuthMethodStandard:dsAuthGetPolicy"
+kDSStdAuthGetUserData = "dsAuthMethodStandard:dsAuthGetUserData"
+kDSStdAuthGetUserName = "dsAuthMethodStandard:dsAuthGetUserName"
+kDSStdAuthMASKE_A = "dsAuthMethodStandard:dsAuthMASKE-A"
+kDSStdAuthMASKE_B = "dsAuthMethodStandard:dsAuthMASKE-B"
+kDSStdAuthMPPEMasterKeys = "dsAuthMethodStandard:dsAuthMPPEMasterKeys"
+kDSStdAuthMSCHAP1 = "dsAuthMethodStandard:dsAuthMSCHAP1"
+kDSStdAuthMSCHAP2 = "dsAuthMethodStandard:dsAuthMSCHAP2"
+kDSStdAuthNTLMv2 = "dsAuthMethodStandard:dsAuthNodeNTLMv2"
+kDSStdAuthNewUser = "dsAuthMethodStandard:dsAuthNewUser"
+kDSStdAuthNewUserWithPolicy = "dsAuthMethodStandard:dsAuthNewUserWithPolicy"
+kDSStdAuthNodeNativeClearTextOK = "dsAuthMethodStandard:dsAuthNodeNativeCanUseClearText"
+kDSStdAuthNodeNativeNoClearText = "dsAuthMethodStandard:dsAuthNodeNativeCannotUseClearText"
+kDSStdAuthReadSecureHash = "dsAuthMethodStandard:dsAuthReadSecureHash"
+kDSStdAuthSMBNTv2UserSessionKey = "dsAuthMethodStandard:dsSMBNTv2UserSessionKey"
+kDSStdAuthSMBWorkstationCredentialSessionKey = "dsAuthMethodStandard:dsAuthSMBWorkstationCredentialSessionKey"
+kDSStdAuthSMB_LM_Key = "dsAuthMethodStandard:dsAuthSMBLMKey"
+kDSStdAuthSMB_NT_Key = "dsAuthMethodStandard:dsAuthSMBNTKey"
+kDSStdAuthSMB_NT_UserSessionKey = "dsAuthMethodStandard:dsAuthSMBNTUserSessionKey"
+kDSStdAuthSecureHash = "dsAuthMethodStandard:dsAuthSecureHash"
+kDSStdAuthSetGlobalPolicy = "dsAuthMethodStandard:dsAuthSetGlobalPolicy"
+kDSStdAuthSetLMHash = "dsAuthMethodStandard:dsAuthSetLMHash"
+kDSStdAuthSetNTHash = "dsAuthMethodStandard:dsAuthSetNTHash"
+kDSStdAuthSetPasswd = "dsAuthMethodStandard:dsAuthSetPasswd"
+kDSStdAuthSetPasswdAsRoot = "dsAuthMethodStandard:dsAuthSetPasswdAsRoot"
+kDSStdAuthSetPolicy = "dsAuthMethodStandard:dsAuthSetPolicy"
+kDSStdAuthSetPolicyAsRoot = "dsAuthMethodStandard:dsAuthSetPolicyAsRoot"
+kDSStdAuthSetUserData = "dsAuthMethodStandard:dsAuthSetUserData"
+kDSStdAuthSetUserName = "dsAuthMethodStandard:dsAuthSetUserName"
+kDSStdAuthSetWorkstationPasswd = "dsAuthMethodStandard:dsAuthSetWorkstationPasswd"
+kDSStdAuthWithAuthorizationRef = "dsAuthMethodStandard:dsAuthWithAuthorizationRef"
+kDSStdAuthWriteSecureHash = "dsAuthMethodStandard:dsAuthWriteSecureHash"
+# -
+# NSL Neighborhood Constants
+# -
+kDSValueNSLDynamicNeighborhoodType = "NSLDynamicNeighborhoodType"
+kDSValueNSLLocalNeighborhoodType = "NSLLocalNeighborhoodType"
+kDSValueNSLStaticNeighborhoodType = "NSLStaticNeighborhoodType"
+kDSValueNSLTopLevelNeighborhoodType = "NSLTopLevelNeighborhoodType"

Added: PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx
===================================================================
--- PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx	                        (rev 0)
+++ PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx	2006-09-20 23:57:18 UTC (rev 165)
@@ -0,0 +1,197 @@
+##
+# Copyright (c) 2006 Apple Computer, Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+##
+
+from DirectoryServices import Constants
+
+cdef nodeFromName(tDirReference directory,
+                  tDataListPtr nodeName):
+    """Make a new Node from the given nodeName (we have to use this
+    because PyRex doesn't support passing pointers to methods)
+    """
+
+    return DirectoryNode(directory,
+                         <unsigned long>nodeName)
+
+
+cdef convertDataList(tDirReference directory,
+                     object inList,
+                     tDataListPtr outList):
+    outList = dsDataListAllocate(directory)
+        
+    for item in inList:
+        raiseOnError(
+            dsAppendStringToListAlloc(directory, outList, item))
+
+
+cdef class DirectoryNode:
+    cdef tDirReference directory
+    cdef tDirNodeReference node
+    cdef tDataListPtr nodeName
+    cdef char * pPath
+
+    def __new__(object self,
+                tDirReference directory,
+                unsigned long nodeName):
+
+        self.directory = directory
+        self.nodeName = <tDataListPtr>nodeName
+
+    def __repr__(self):
+        return "<DirectoryNode: %s>" % (self.getPath())
+
+    def __dealloc__(self):
+        self.close()
+        raiseOnError(dsDataListDeallocate(self.directory, self.nodeName))
+
+    def open(self):
+        raiseOnError(dsOpenDirNode(self.directory,
+                                   self.nodeName, 
+                                   &self.node))
+
+    def close(self):
+        if self.node != 0:
+            raiseOnError(dsCloseDirNode(self.node))
+            self.node = 0
+
+    def getPath(self):
+        if self.pPath == NULL:
+            self.pPath = dsGetPathFromList(self.directory,
+                                           <tDataListPtr *>self.nodeName,
+                                           "/")
+
+        return str(self.pPath)
+
+    def hasRecord(self, recordType, recordName):
+        cdef tDataNodePtr recType        
+        cdef tDataNodePtr recName
+        cdef tRecordReference recRef
+
+        try:
+            
+            recName = dsDataNodeAllocateString(self.directory,
+                                               recordName)
+            if recName == NULL:
+                raise DirectoryServicesError(eDSBadDataNodeLength)
+            
+            recType = dsDataNodeAllocateString(self.directory,
+                                               recordType)
+            if recType == NULL:
+                raise DirectoryServicesError(eDSBadDataNodeLength)
+
+            dirStatus = dsOpenRecord(self.node, recType, recName, &recRef)
+            
+            if dirStatus == eDSNoErr:
+                result = true
+                dsCloseRecord(recRef)
+
+            elif dirStatus == eDSRecordNotFound:
+                result = false
+
+            else:
+                raiseOnError(dirStatus)
+
+        finally: 
+            if recName != NULL:
+                dsDataNodeDeAllocate(self.directory, recName)
+            if recType != NULL:
+                dsDataNodeDeAllocate(self.directory, recType)
+
+        return result
+
+    def listRecords(self, recordTypes=None, recordNames=None, 
+                    attributeTypes=None, matchType=None):
+        cdef tDataListPtr recTypes
+        cdef tDataListPtr recNames
+        cdef tDataListPtr attrTypes
+        cdef tDataBufferPtr records
+        cdef tContextData context
+        context = NULL
+        cdef tDirPatternMatch cMatchType
+        cdef unsigned long recordCount
+
+        recordList = None
+
+        try:
+            if not recordNames:
+                recordNames = [Constants.kDSRecordsAll]
+                
+            if not recordTypes:
+                recordTypes = [Constants.kDSStdRecordTypeAll]
+                    
+            if not attributeTypes:
+                attributeTypes = [Constants.kDSAttributesAll]
+
+            if not matchType:
+                matchType = eDSExact
+
+            cMatchType = matchType
+            
+            recNames = dsDataListAllocate(self.directory)
+            raiseIfNull(recNames)
+            for item in recordNames:
+                raiseOnError(
+                    dsAppendStringToListAlloc(self.directory, recNames, 
+                                              item))
+
+            assert (len(recordNames) == 
+                    dsDataListGetNodeCount(recNames))
+
+            recTypes = dsDataListAllocate(self.directory)
+            raiseIfNull(recTypes)
+            for item in recordTypes:
+                raiseOnError(
+                    dsAppendStringToListAlloc(self.directory, recTypes, 
+                                              item))
+
+            assert (len(recordTypes) == 
+                    dsDataListGetNodeCount(recTypes))
+
+            attrTypes = dsDataListAllocate(self.directory)
+            raiseIfNull(attrTypes)
+            for item in attributeTypes:
+                raiseOnError(
+                    dsAppendStringToListAlloc(self.directory, attrTypes, 
+                                              item))
+
+            assert (len(attributeTypes) == 
+                    dsDataListGetNodeCount(attrTypes))
+
+            records = dsDataBufferAllocate(self.directory, 128 * 1024)
+            raiseIfNull(records)
+
+            dirStatus = dsGetRecordList(self.node, records, recNames, 
+                                        cMatchType, recTypes,
+                                        attrTypes, False,
+                                        &recordCount, &context)
+            raiseOnError(dirStatus)
+            
+            recordList = DirectoryRecordList(self.directory,
+                                             self.node,
+                                             <unsigned long>records,
+                                             <unsigned long>context,
+                                             recordCount)
+
+        finally:
+            pass
+# #             if recNames != NULL:
+# #                 dsDataListDeallocate(self.directory, recNames)
+# #             if recTypes != NULL:
+# #                 dsDataListDeallocate(self.directory, recTypes)
+# #             if attrTypes != NULL:
+# #                 dsDataListDeallocate(self.directory, attrTypes)
+
+        return recordList

Added: PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx
===================================================================
--- PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx	                        (rev 0)
+++ PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx	2006-09-20 23:57:18 UTC (rev 165)
@@ -0,0 +1,104 @@
+##
+# Copyright (c) 2006 Apple Computer, Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+##
+
+class DirectoryRecordListIter:
+    def __init__(self, dr):
+        self.dr = dr
+
+    def next(self):
+        return self.dr.next()
+
+cdef class DirectoryRecordList:
+    cdef tDirReference directory
+    cdef tDirNodeReference node
+    cdef tDataBufferPtr records
+    cdef tDataListPtr recordTypes
+    cdef tDataListPtr recordNames
+    cdef tDataListPtr attributeTypes
+    cdef tContextData context
+    cdef unsigned long recordCount
+    cdef unsigned long recordIndex    
+
+    def __new__(self, tDirReference directory, 
+                tDirNodeReference node, unsigned long recordList, 
+                unsigned long context, unsigned long recordCount):
+        self.directory = directory
+        self.node = node
+
+        self.records = <tDataBufferPtr>recordList
+        raiseIfNull(self.records)
+
+        self.context = <tContextData>context
+
+        self.recordCount = recordCount
+        self.recordIndex = 1
+
+    def __dealloc__(self):
+        dsReleaseContinueData(self.directory, self.context)
+
+    def __len__(self):
+        return self.recordCount
+
+    def _getRecord(self, index):
+        cdef tAttributeListRef attrListRef
+        cdef tRecordEntryPtr pRecEntry
+
+        raiseOnError(
+            dsGetRecordEntry(self.node, self.records, index, 
+                             &attrListRef, &pRecEntry))
+
+        record = DirectoryRecord(attrListRef, <unsigned long>pRecEntry)
+        
+        dsCloseAttributeList(attrListRef)
+        dsDeallocRecordEntry(self.directory, pRecEntry)
+
+        return record
+
+    def __getitem__(self, unsigned long index):
+        self._getRecord(index)
+
+    def __iter__(self):
+        return DirectoryRecordListIter(self)
+
+    def next(self):
+        if self.context == NULL:
+            raise StopIteration
+
+        rec = self._getRecord(self.recordIndex)
+        self.recordIndex = self.recordIndex + 1
+
+        return rec
+
+
+cdef class DirectoryRecord:
+    def __new__(self, tAttributeListRef attrListRef, unsigned long pRecEntry):
+        pass
+
+    def __dealloc__(self):
+        pass
+
+    def __getitem__(self, key):
+        pass
+
+    def __setitem__(self, key, value):
+        pass
+
+    def flush(self):
+        pass
+
+    
+

Added: PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.c
===================================================================
--- PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.c	                        (rev 0)
+++ PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.c	2006-09-20 23:57:18 UTC (rev 165)
@@ -0,0 +1,2924 @@
+/* Generated by Pyrex 0.9.4.1 on Wed Sep 20 16:18:08 2006 */
+
+#include "Python.h"
+#include "structmember.h"
+#ifndef PY_LONG_LONG
+  #define PY_LONG_LONG LONG_LONG
+#endif
+#ifdef __cplusplus
+#define __PYX_EXTERN_C extern "C"
+#else
+#define __PYX_EXTERN_C extern
+#endif
+__PYX_EXTERN_C double pow(double, double);
+#include "sys/types.h"
+#include "stdio.h"
+#include "DirectoryService/DirectoryService.h"
+
+
+typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
+typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
+static PyObject *__Pyx_UnpackItem(PyObject *, int); /*proto*/
+static int __Pyx_EndUnpack(PyObject *, int); /*proto*/
+static int __Pyx_PrintItem(PyObject *); /*proto*/
+static int __Pyx_PrintNewline(void); /*proto*/
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+static void __Pyx_ReRaise(void); /*proto*/
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
+static PyObject *__Pyx_GetExcValue(void); /*proto*/
+static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/
+static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
+static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/
+static void __Pyx_WriteUnraisable(char *name); /*proto*/
+static void __Pyx_AddTraceback(char *funcname); /*proto*/
+static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size);  /*proto*/
+static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
+static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/
+static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/
+static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
+static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
+
+static PyObject *__pyx_m;
+static PyObject *__pyx_b;
+static int __pyx_lineno;
+static char *__pyx_filename;
+static char **__pyx_f;
+
+/* Declarations from DirectoryService */
+
+
+struct __pyx_obj_16DirectoryService_DirectoryNode {
+  PyObject_HEAD
+  tDirReference directory;
+  tDirNodeReference node;
+  tDataListPtr nodeName;
+  char (*pPath);
+};
+
+
+struct __pyx_obj_16DirectoryService_DirectoryRecordList {
+  PyObject_HEAD
+  tDirReference directory;
+  tDirNodeReference node;
+  tDataBufferPtr records;
+  tDataListPtr recordTypes;
+  tDataListPtr recordNames;
+  tDataListPtr attributeTypes;
+  tContextData context;
+  unsigned long recordCount;
+  unsigned long recordIndex;
+};
+
+
+struct __pyx_obj_16DirectoryService_DirectoryRecord {
+  PyObject_HEAD
+};
+
+
+struct __pyx_obj_16DirectoryService_DirectoryService {
+  PyObject_HEAD
+  tDirReference gDirRef;
+};
+
+static PyTypeObject *__pyx_ptype_16DirectoryService_DirectoryNode = 0;
+static PyTypeObject *__pyx_ptype_16DirectoryService_DirectoryRecordList = 0;
+static PyTypeObject *__pyx_ptype_16DirectoryService_DirectoryRecord = 0;
+static PyTypeObject *__pyx_ptype_16DirectoryService_DirectoryService = 0;
+static PyObject *__pyx_k3;
+static PyObject *__pyx_k4;
+static PyObject *__pyx_k5;
+static PyObject *__pyx_k6;
+static PyObject *(__pyx_f_16DirectoryService_nodeFromName(tDirReference ,tDataListPtr )); /*proto*/
+static PyObject *(__pyx_f_16DirectoryService_convertDataList(tDirReference ,PyObject *,tDataListPtr )); /*proto*/
+static PyObject *(__pyx_f_16DirectoryService_raiseIfNull(void (*))); /*proto*/
+
+/* Implementation of DirectoryService */
+
+
+static PyObject *__pyx_n_Constants;
+static PyObject *__pyx_n_DirectoryRecordListIter;
+static PyObject *__pyx_n_DirectoryServicesError;
+static PyObject *__pyx_n_raiseOnError;
+static PyObject *__pyx_n_DirectoryServices;
+static PyObject *__pyx_n___init__;
+static PyObject *__pyx_n_next;
+static PyObject *__pyx_n_Exception;
+static PyObject *__pyx_n___str__;
+static PyObject *__pyx_n___repr__;
+
+static char (__pyx_k9[]) = "Make a new Node from the given nodeName (we have to use this\n    because PyRex doesn\'t support passing pointers to methods)\n    ";
+
+static PyObject *__pyx_f_16DirectoryService_nodeFromName(tDirReference __pyx_v_directory,tDataListPtr __pyx_v_nodeName) {
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":5 */
+  __pyx_k9;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":9 */
+  __pyx_1 = PyLong_FromUnsignedLong(__pyx_v_directory); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; goto __pyx_L1;}
+  __pyx_2 = PyLong_FromUnsignedLong(((unsigned long )__pyx_v_nodeName)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; goto __pyx_L1;}
+  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; goto __pyx_L1;}
+  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
+  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);
+  __pyx_1 = 0;
+  __pyx_2 = 0;
+  __pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_16DirectoryService_DirectoryNode), __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; goto __pyx_L1;}
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+  __pyx_r = __pyx_1;
+  __pyx_1 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  __Pyx_AddTraceback("DirectoryService.nodeFromName");
+  __pyx_r = 0;
+  __pyx_L0:;
+  return __pyx_r;
+}
+
+static PyObject *__pyx_f_16DirectoryService_convertDataList(tDirReference __pyx_v_directory,PyObject *__pyx_v_inList,tDataListPtr __pyx_v_outList) {
+  PyObject *__pyx_v_item;
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  char (*__pyx_3);
+  PyObject *__pyx_4 = 0;
+  PyObject *__pyx_5 = 0;
+  Py_INCREF(__pyx_v_inList);
+  __pyx_v_item = Py_None; Py_INCREF(Py_None);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":16 */
+  __pyx_v_outList = dsDataListAllocate(__pyx_v_directory);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":18 */
+  __pyx_1 = PyObject_GetIter(__pyx_v_inList); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;}
+  for (;;) {
+    __pyx_L2:;
+    __pyx_2 = PyIter_Next(__pyx_1);
+    if (!__pyx_2) {
+      if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;}
+      break;
+    }
+    Py_DECREF(__pyx_v_item);
+    __pyx_v_item = __pyx_2;
+    __pyx_2 = 0;
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":19 */
+    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_raiseOnError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}
+    __pyx_3 = PyString_AsString(__pyx_v_item); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}
+    __pyx_4 = PyInt_FromLong(dsAppendStringToListAlloc(__pyx_v_directory,__pyx_v_outList,__pyx_3)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}
+    __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}
+    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_4);
+    __pyx_4 = 0;
+    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}
+    Py_DECREF(__pyx_2); __pyx_2 = 0;
+    Py_DECREF(__pyx_5); __pyx_5 = 0;
+    Py_DECREF(__pyx_4); __pyx_4 = 0;
+  }
+  __pyx_L3:;
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_4);
+  Py_XDECREF(__pyx_5);
+  __Pyx_AddTraceback("DirectoryService.convertDataList");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_item);
+  Py_DECREF(__pyx_v_inList);
+  return __pyx_r;
+}
+
+static int __pyx_f_16DirectoryService_13DirectoryNode___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_f_16DirectoryService_13DirectoryNode___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  unsigned long __pyx_v_directory;
+  unsigned long __pyx_v_nodeName;
+  int __pyx_r;
+  static char *__pyx_argnames[] = {"directory","nodeName",0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "kk", __pyx_argnames, &__pyx_v_directory, &__pyx_v_nodeName)) return -1;
+  Py_INCREF(__pyx_v_self);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":33 */
+  ((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->directory = __pyx_v_directory;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":34 */
+  ((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->nodeName = ((void (*))__pyx_v_nodeName);
+
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1:;
+  __Pyx_AddTraceback("DirectoryService.DirectoryNode.__new__");
+  __pyx_r = -1;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_self);
+  return __pyx_r;
+}
+
+static PyObject *__pyx_n_getPath;
+
+static PyObject *__pyx_k10p;
+
+static char (__pyx_k10[]) = "<DirectoryNode: %s>";
+
+static PyObject *__pyx_f_16DirectoryService_13DirectoryNode___repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_f_16DirectoryService_13DirectoryNode___repr__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+  Py_INCREF(__pyx_v_self);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":37 */
+  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_getPath); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; goto __pyx_L1;}
+  __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; goto __pyx_L1;}
+  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  __pyx_1 = PyNumber_Remainder(__pyx_k10p, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; goto __pyx_L1;}
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+  __pyx_r = __pyx_1;
+  __pyx_1 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  __Pyx_AddTraceback("DirectoryService.DirectoryNode.__repr__");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_self);
+  return __pyx_r;
+}
+
+static PyObject *__pyx_n_close;
+
+static void __pyx_f_16DirectoryService_13DirectoryNode___dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_f_16DirectoryService_13DirectoryNode___dealloc__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+  Py_INCREF(__pyx_v_self);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":40 */
+  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_close); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; goto __pyx_L1;}
+  __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; goto __pyx_L1;}
+  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":41 */
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_raiseOnError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; goto __pyx_L1;}
+  __pyx_2 = PyInt_FromLong(dsDataListDeallocate(((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->directory,((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->nodeName)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; goto __pyx_L1;}
+  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; goto __pyx_L1;}
+  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
+  __pyx_2 = 0;
+  __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  __Pyx_AddTraceback("DirectoryService.DirectoryNode.__dealloc__");
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_self);
+}
+
+static PyObject *__pyx_f_16DirectoryService_13DirectoryNode_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_16DirectoryService_13DirectoryNode_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+  static char *__pyx_argnames[] = {0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
+  Py_INCREF(__pyx_v_self);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":44 */
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_raiseOnError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;}
+  __pyx_2 = PyInt_FromLong(dsOpenDirNode(((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->directory,((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->nodeName,(&((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->node))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;}
+  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;}
+  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
+  __pyx_2 = 0;
+  __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  __Pyx_AddTraceback("DirectoryService.DirectoryNode.open");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_self);
+  return __pyx_r;
+}
+
+static PyObject *__pyx_f_16DirectoryService_13DirectoryNode_close(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_16DirectoryService_13DirectoryNode_close(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_r;
+  int __pyx_1;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+  PyObject *__pyx_4 = 0;
+  static char *__pyx_argnames[] = {0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
+  Py_INCREF(__pyx_v_self);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":49 */
+  __pyx_1 = (((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->node != 0);
+  if (__pyx_1) {
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":50 */
+    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_raiseOnError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
+    __pyx_3 = PyInt_FromLong(dsCloseDirNode(((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->node)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
+    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
+    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
+    __pyx_3 = 0;
+    __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
+    Py_DECREF(__pyx_2); __pyx_2 = 0;
+    Py_DECREF(__pyx_4); __pyx_4 = 0;
+    Py_DECREF(__pyx_3); __pyx_3 = 0;
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":51 */
+    ((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->node = 0;
+    goto __pyx_L2;
+  }
+  __pyx_L2:;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  Py_XDECREF(__pyx_4);
+  __Pyx_AddTraceback("DirectoryService.DirectoryNode.close");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_self);
+  return __pyx_r;
+}
+
+static PyObject *__pyx_n_str;
+
+static char (__pyx_k11[]) = "/";
+
+static PyObject *__pyx_f_16DirectoryService_13DirectoryNode_getPath(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_16DirectoryService_13DirectoryNode_getPath(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_r;
+  int __pyx_1;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+  PyObject *__pyx_4 = 0;
+  static char *__pyx_argnames[] = {0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
+  Py_INCREF(__pyx_v_self);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":54 */
+  __pyx_1 = (((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->pPath == 0);
+  if (__pyx_1) {
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":55 */
+    ((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->pPath = dsGetPathFromList(((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->directory,((tDataListPtr (*))((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->nodeName),__pyx_k11);
+    goto __pyx_L2;
+  }
+  __pyx_L2:;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":59 */
+  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
+  __pyx_3 = PyString_FromString(((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->pPath); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
+  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
+  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
+  __pyx_3 = 0;
+  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  Py_DECREF(__pyx_4); __pyx_4 = 0;
+  __pyx_r = __pyx_3;
+  __pyx_3 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  Py_XDECREF(__pyx_4);
+  __Pyx_AddTraceback("DirectoryService.DirectoryNode.getPath");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_self);
+  return __pyx_r;
+}
+
+static PyObject *__pyx_n_true;
+static PyObject *__pyx_n_false;
+
+static PyObject *__pyx_f_16DirectoryService_13DirectoryNode_hasRecord(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_16DirectoryService_13DirectoryNode_hasRecord(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_recordType = 0;
+  PyObject *__pyx_v_recordName = 0;
+  tDataNodePtr __pyx_v_recType;
+  tDataNodePtr __pyx_v_recName;
+  tRecordReference __pyx_v_recRef;
+  PyObject *__pyx_v_dirStatus;
+  PyObject *__pyx_v_result;
+  PyObject *__pyx_r;
+  char (*__pyx_1);
+  int __pyx_2;
+  PyObject *__pyx_3 = 0;
+  PyObject *__pyx_4 = 0;
+  PyObject *__pyx_5 = 0;
+  int __pyx_6;
+  static char *__pyx_argnames[] = {"recordType","recordName",0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_recordType, &__pyx_v_recordName)) return 0;
+  Py_INCREF(__pyx_v_self);
+  Py_INCREF(__pyx_v_recordType);
+  Py_INCREF(__pyx_v_recordName);
+  __pyx_v_dirStatus = Py_None; Py_INCREF(Py_None);
+  __pyx_v_result = Py_None; Py_INCREF(Py_None);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":66 */
+  /*try:*/ {
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":68 */
+    __pyx_1 = PyString_AsString(__pyx_v_recordName); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L3;}
+    __pyx_v_recName = dsDataNodeAllocateString(((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->directory,__pyx_1);
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":70 */
+    __pyx_2 = (__pyx_v_recName == 0);
+    if (__pyx_2) {
+
+      /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":71 */
+      __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_DirectoryServicesError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; goto __pyx_L3;}
+      __pyx_4 = PyInt_FromLong(eDSBadDataNodeLength); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; goto __pyx_L3;}
+      __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; goto __pyx_L3;}
+      PyTuple_SET_ITEM(__pyx_5, 0, __pyx_4);
+      __pyx_4 = 0;
+      __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; goto __pyx_L3;}
+      Py_DECREF(__pyx_3); __pyx_3 = 0;
+      Py_DECREF(__pyx_5); __pyx_5 = 0;
+      __Pyx_Raise(__pyx_4, 0, 0);
+      Py_DECREF(__pyx_4); __pyx_4 = 0;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; goto __pyx_L3;}
+      goto __pyx_L5;
+    }
+    __pyx_L5:;
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":73 */
+    __pyx_1 = PyString_AsString(__pyx_v_recordType); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; goto __pyx_L3;}
+    __pyx_v_recType = dsDataNodeAllocateString(((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->directory,__pyx_1);
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":75 */
+    __pyx_2 = (__pyx_v_recType == 0);
+    if (__pyx_2) {
+
+      /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":76 */
+      __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_DirectoryServicesError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L3;}
+      __pyx_5 = PyInt_FromLong(eDSBadDataNodeLength); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L3;}
+      __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L3;}
+      PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
+      __pyx_5 = 0;
+      __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L3;}
+      Py_DECREF(__pyx_3); __pyx_3 = 0;
+      Py_DECREF(__pyx_4); __pyx_4 = 0;
+      __Pyx_Raise(__pyx_5, 0, 0);
+      Py_DECREF(__pyx_5); __pyx_5 = 0;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L3;}
+      goto __pyx_L6;
+    }
+    __pyx_L6:;
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":78 */
+    __pyx_3 = PyInt_FromLong(dsOpenRecord(((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->node,__pyx_v_recType,__pyx_v_recName,(&__pyx_v_recRef))); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; goto __pyx_L3;}
+    Py_DECREF(__pyx_v_dirStatus);
+    __pyx_v_dirStatus = __pyx_3;
+    __pyx_3 = 0;
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":80 */
+    __pyx_4 = PyInt_FromLong(eDSNoErr); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L3;}
+    if (PyObject_Cmp(__pyx_v_dirStatus, __pyx_4, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L3;}
+    __pyx_2 = __pyx_2 == 0;
+    Py_DECREF(__pyx_4); __pyx_4 = 0;
+    if (__pyx_2) {
+
+      /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":81 */
+      __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_true); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L3;}
+      Py_DECREF(__pyx_v_result);
+      __pyx_v_result = __pyx_5;
+      __pyx_5 = 0;
+
+      /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":82 */
+      dsCloseRecord(__pyx_v_recRef);
+      goto __pyx_L7;
+    }
+    __pyx_3 = PyInt_FromLong(eDSRecordNotFound); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; goto __pyx_L3;}
+    if (PyObject_Cmp(__pyx_v_dirStatus, __pyx_3, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; goto __pyx_L3;}
+    __pyx_2 = __pyx_2 == 0;
+    Py_DECREF(__pyx_3); __pyx_3 = 0;
+    if (__pyx_2) {
+
+      /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":85 */
+      __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_false); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L3;}
+      Py_DECREF(__pyx_v_result);
+      __pyx_v_result = __pyx_4;
+      __pyx_4 = 0;
+      goto __pyx_L7;
+    }
+    /*else*/ {
+
+      /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":88 */
+      __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_raiseOnError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L3;}
+      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L3;}
+      Py_INCREF(__pyx_v_dirStatus);
+      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_dirStatus);
+      __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L3;}
+      Py_DECREF(__pyx_5); __pyx_5 = 0;
+      Py_DECREF(__pyx_3); __pyx_3 = 0;
+      Py_DECREF(__pyx_4); __pyx_4 = 0;
+    }
+    __pyx_L7:;
+  }
+  /*finally:*/ {
+    int __pyx_why;
+    __pyx_why = 0; goto __pyx_L4;
+    __pyx_L2: __pyx_why = 3; goto __pyx_L4;
+    __pyx_L3: {
+      __pyx_why = 4;
+      Py_XDECREF(__pyx_5); __pyx_5 = 0;
+      Py_XDECREF(__pyx_3); __pyx_3 = 0;
+      Py_XDECREF(__pyx_4); __pyx_4 = 0;
+      PyErr_Fetch(&__pyx_5, &__pyx_3, &__pyx_4);
+      __pyx_2 = __pyx_lineno;
+      goto __pyx_L4;
+    }
+    __pyx_L4:;
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":91 */
+    __pyx_6 = (__pyx_v_recName != 0);
+    if (__pyx_6) {
+
+      /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":92 */
+      dsDataNodeDeAllocate(((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->directory,__pyx_v_recName);
+      goto __pyx_L8;
+    }
+    __pyx_L8:;
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":93 */
+    __pyx_6 = (__pyx_v_recType != 0);
+    if (__pyx_6) {
+
+      /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":94 */
+      dsDataNodeDeAllocate(((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->directory,__pyx_v_recType);
+      goto __pyx_L9;
+    }
+    __pyx_L9:;
+    switch (__pyx_why) {
+      case 3: goto __pyx_L0;
+      case 4: {
+        PyErr_Restore(__pyx_5, __pyx_3, __pyx_4);
+        __pyx_lineno = __pyx_2;
+        __pyx_5 = 0;
+        __pyx_3 = 0;
+        __pyx_4 = 0;
+        goto __pyx_L1;
+      }
+    }
+  }
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":96 */
+  Py_INCREF(__pyx_v_result);
+  __pyx_r = __pyx_v_result;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_3);
+  Py_XDECREF(__pyx_4);
+  Py_XDECREF(__pyx_5);
+  __Pyx_AddTraceback("DirectoryService.DirectoryNode.hasRecord");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_dirStatus);
+  Py_DECREF(__pyx_v_result);
+  Py_DECREF(__pyx_v_self);
+  Py_DECREF(__pyx_v_recordType);
+  Py_DECREF(__pyx_v_recordName);
+  return __pyx_r;
+}
+
+static PyObject *__pyx_n_kDSRecordsAll;
+static PyObject *__pyx_n_kDSStdRecordTypeAll;
+static PyObject *__pyx_n_kDSAttributesAll;
+static PyObject *__pyx_n_len;
+static PyObject *__pyx_n_False;
+
+static PyObject *__pyx_f_16DirectoryService_13DirectoryNode_listRecords(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_16DirectoryService_13DirectoryNode_listRecords(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_recordTypes = 0;
+  PyObject *__pyx_v_recordNames = 0;
+  PyObject *__pyx_v_attributeTypes = 0;
+  PyObject *__pyx_v_matchType = 0;
+  tDataListPtr __pyx_v_recTypes;
+  tDataListPtr __pyx_v_recNames;
+  tDataListPtr __pyx_v_attrTypes;
+  tDataBufferPtr __pyx_v_records;
+  tContextData __pyx_v_context;
+  tDirPatternMatch __pyx_v_cMatchType;
+  unsigned long __pyx_v_recordCount;
+  PyObject *__pyx_v_recordList;
+  PyObject *__pyx_v_item;
+  PyObject *__pyx_v_dirStatus;
+  PyObject *__pyx_r;
+  int __pyx_1;
+  int __pyx_2;
+  PyObject *__pyx_3 = 0;
+  PyObject *__pyx_4 = 0;
+  tDirPatternMatch __pyx_5;
+  char (*__pyx_6);
+  PyObject *__pyx_7 = 0;
+  PyObject *__pyx_8 = 0;
+  dsBool __pyx_9;
+  PyObject *__pyx_10 = 0;
+  PyObject *__pyx_11 = 0;
+  static char *__pyx_argnames[] = {"recordTypes","recordNames","attributeTypes","matchType",0};
+  __pyx_v_recordTypes = __pyx_k3;
+  __pyx_v_recordNames = __pyx_k4;
+  __pyx_v_attributeTypes = __pyx_k5;
+  __pyx_v_matchType = __pyx_k6;
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOOO", __pyx_argnames, &__pyx_v_recordTypes, &__pyx_v_recordNames, &__pyx_v_attributeTypes, &__pyx_v_matchType)) return 0;
+  Py_INCREF(__pyx_v_self);
+  Py_INCREF(__pyx_v_recordTypes);
+  Py_INCREF(__pyx_v_recordNames);
+  Py_INCREF(__pyx_v_attributeTypes);
+  Py_INCREF(__pyx_v_matchType);
+  __pyx_v_recordList = Py_None; Py_INCREF(Py_None);
+  __pyx_v_item = Py_None; Py_INCREF(Py_None);
+  __pyx_v_dirStatus = Py_None; Py_INCREF(Py_None);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":105 */
+  __pyx_v_context = 0;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":109 */
+  Py_INCREF(Py_None);
+  Py_DECREF(__pyx_v_recordList);
+  __pyx_v_recordList = Py_None;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":111 */
+  /*try:*/ {
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":112 */
+    __pyx_1 = PyObject_IsTrue(__pyx_v_recordNames); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L3;}
+    __pyx_2 = (!__pyx_1);
+    if (__pyx_2) {
+
+      /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":113 */
+      __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_Constants); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; goto __pyx_L3;}
+      __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_kDSRecordsAll); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; goto __pyx_L3;}
+      Py_DECREF(__pyx_3); __pyx_3 = 0;
+      __pyx_3 = PyList_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; goto __pyx_L3;}
+      PyList_SET_ITEM(__pyx_3, 0, __pyx_4);
+      __pyx_4 = 0;
+      Py_DECREF(__pyx_v_recordNames);
+      __pyx_v_recordNames = __pyx_3;
+      __pyx_3 = 0;
+      goto __pyx_L5;
+    }
+    __pyx_L5:;
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":115 */
+    __pyx_1 = PyObject_IsTrue(__pyx_v_recordTypes); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L3;}
+    __pyx_2 = (!__pyx_1);
+    if (__pyx_2) {
+
+      /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":116 */
+      __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_Constants); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L3;}
+      __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_kDSStdRecordTypeAll); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L3;}
+      Py_DECREF(__pyx_4); __pyx_4 = 0;
+      __pyx_4 = PyList_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L3;}
+      PyList_SET_ITEM(__pyx_4, 0, __pyx_3);
+      __pyx_3 = 0;
+      Py_DECREF(__pyx_v_recordTypes);
+      __pyx_v_recordTypes = __pyx_4;
+      __pyx_4 = 0;
+      goto __pyx_L6;
+    }
+    __pyx_L6:;
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":118 */
+    __pyx_1 = PyObject_IsTrue(__pyx_v_attributeTypes); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; goto __pyx_L3;}
+    __pyx_2 = (!__pyx_1);
+    if (__pyx_2) {
+
+      /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":119 */
+      __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_Constants); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L3;}
+      __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_kDSAttributesAll); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L3;}
+      Py_DECREF(__pyx_3); __pyx_3 = 0;
+      __pyx_3 = PyList_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L3;}
+      PyList_SET_ITEM(__pyx_3, 0, __pyx_4);
+      __pyx_4 = 0;
+      Py_DECREF(__pyx_v_attributeTypes);
+      __pyx_v_attributeTypes = __pyx_3;
+      __pyx_3 = 0;
+      goto __pyx_L7;
+    }
+    __pyx_L7:;
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":121 */
+    __pyx_1 = PyObject_IsTrue(__pyx_v_matchType); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L3;}
+    __pyx_2 = (!__pyx_1);
+    if (__pyx_2) {
+
+      /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":122 */
+      __pyx_4 = PyInt_FromLong(eDSExact); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L3;}
+      Py_DECREF(__pyx_v_matchType);
+      __pyx_v_matchType = __pyx_4;
+      __pyx_4 = 0;
+      goto __pyx_L8;
+    }
+    __pyx_L8:;
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":124 */
+    __pyx_5 = PyInt_AsLong(__pyx_v_matchType); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; goto __pyx_L3;}
+    __pyx_v_cMatchType = __pyx_5;
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":126 */
+    __pyx_v_recNames = dsDataListAllocate(((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->directory);
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":127 */
+    __pyx_3 = __pyx_f_16DirectoryService_raiseIfNull(__pyx_v_recNames); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L3;}
+    Py_DECREF(__pyx_3); __pyx_3 = 0;
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":128 */
+    __pyx_4 = PyObject_GetIter(__pyx_v_recordNames); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; goto __pyx_L3;}
+    for (;;) {
+      __pyx_L9:;
+      __pyx_3 = PyIter_Next(__pyx_4);
+      if (!__pyx_3) {
+        if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; goto __pyx_L3;}
+        break;
+      }
+      Py_DECREF(__pyx_v_item);
+      __pyx_v_item = __pyx_3;
+      __pyx_3 = 0;
+
+      /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":129 */
+      __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_raiseOnError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L3;}
+      __pyx_6 = PyString_AsString(__pyx_v_item); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L3;}
+      __pyx_7 = PyInt_FromLong(dsAppendStringToListAlloc(((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->directory,__pyx_v_recNames,__pyx_6)); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; goto __pyx_L3;}
+      __pyx_8 = PyTuple_New(1); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L3;}
+      PyTuple_SET_ITEM(__pyx_8, 0, __pyx_7);
+      __pyx_7 = 0;
+      __pyx_7 = PyObject_CallObject(__pyx_3, __pyx_8); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L3;}
+      Py_DECREF(__pyx_3); __pyx_3 = 0;
+      Py_DECREF(__pyx_8); __pyx_8 = 0;
+      Py_DECREF(__pyx_7); __pyx_7 = 0;
+    }
+    __pyx_L10:;
+    Py_DECREF(__pyx_4); __pyx_4 = 0;
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":133 */
+    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L3;}
+    __pyx_8 = PyTuple_New(1); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L3;}
+    Py_INCREF(__pyx_v_recordNames);
+    PyTuple_SET_ITEM(__pyx_8, 0, __pyx_v_recordNames);
+    __pyx_7 = PyObject_CallObject(__pyx_3, __pyx_8); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L3;}
+    Py_DECREF(__pyx_3); __pyx_3 = 0;
+    Py_DECREF(__pyx_8); __pyx_8 = 0;
+    __pyx_4 = PyLong_FromUnsignedLong(dsDataListGetNodeCount(__pyx_v_recNames)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L3;}
+    if (PyObject_Cmp(__pyx_7, __pyx_4, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L3;}
+    __pyx_1 = __pyx_1 == 0;
+    Py_DECREF(__pyx_7); __pyx_7 = 0;
+    Py_DECREF(__pyx_4); __pyx_4 = 0;
+    if (!__pyx_1) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L3;}
+    }
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":136 */
+    __pyx_v_recTypes = dsDataListAllocate(((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->directory);
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":137 */
+    __pyx_3 = __pyx_f_16DirectoryService_raiseIfNull(__pyx_v_recTypes); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; goto __pyx_L3;}
+    Py_DECREF(__pyx_3); __pyx_3 = 0;
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":138 */
+    __pyx_8 = PyObject_GetIter(__pyx_v_recordTypes); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; goto __pyx_L3;}
+    for (;;) {
+      __pyx_L11:;
+      __pyx_7 = PyIter_Next(__pyx_8);
+      if (!__pyx_7) {
+        if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; goto __pyx_L3;}
+        break;
+      }
+      Py_DECREF(__pyx_v_item);
+      __pyx_v_item = __pyx_7;
+      __pyx_7 = 0;
+
+      /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":139 */
+      __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_raiseOnError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; goto __pyx_L3;}
+      __pyx_6 = PyString_AsString(__pyx_v_item); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; goto __pyx_L3;}
+      __pyx_3 = PyInt_FromLong(dsAppendStringToListAlloc(((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->directory,__pyx_v_recTypes,__pyx_6)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; goto __pyx_L3;}
+      __pyx_7 = PyTuple_New(1); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; goto __pyx_L3;}
+      PyTuple_SET_ITEM(__pyx_7, 0, __pyx_3);
+      __pyx_3 = 0;
+      __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_7); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; goto __pyx_L3;}
+      Py_DECREF(__pyx_4); __pyx_4 = 0;
+      Py_DECREF(__pyx_7); __pyx_7 = 0;
+      Py_DECREF(__pyx_3); __pyx_3 = 0;
+    }
+    __pyx_L12:;
+    Py_DECREF(__pyx_8); __pyx_8 = 0;
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":143 */
+    __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L3;}
+    __pyx_7 = PyTuple_New(1); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L3;}
+    Py_INCREF(__pyx_v_recordTypes);
+    PyTuple_SET_ITEM(__pyx_7, 0, __pyx_v_recordTypes);
+    __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_7); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L3;}
+    Py_DECREF(__pyx_4); __pyx_4 = 0;
+    Py_DECREF(__pyx_7); __pyx_7 = 0;
+    __pyx_8 = PyLong_FromUnsignedLong(dsDataListGetNodeCount(__pyx_v_recTypes)); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; goto __pyx_L3;}
+    if (PyObject_Cmp(__pyx_3, __pyx_8, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L3;}
+    __pyx_2 = __pyx_2 == 0;
+    Py_DECREF(__pyx_3); __pyx_3 = 0;
+    Py_DECREF(__pyx_8); __pyx_8 = 0;
+    if (!__pyx_2) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L3;}
+    }
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":146 */
+    __pyx_v_attrTypes = dsDataListAllocate(((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->directory);
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":147 */
+    __pyx_4 = __pyx_f_16DirectoryService_raiseIfNull(__pyx_v_attrTypes); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L3;}
+    Py_DECREF(__pyx_4); __pyx_4 = 0;
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":148 */
+    __pyx_7 = PyObject_GetIter(__pyx_v_attributeTypes); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; goto __pyx_L3;}
+    for (;;) {
+      __pyx_L13:;
+      __pyx_3 = PyIter_Next(__pyx_7);
+      if (!__pyx_3) {
+        if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; goto __pyx_L3;}
+        break;
+      }
+      Py_DECREF(__pyx_v_item);
+      __pyx_v_item = __pyx_3;
+      __pyx_3 = 0;
+
+      /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":149 */
+      __pyx_8 = __Pyx_GetName(__pyx_m, __pyx_n_raiseOnError); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L3;}
+      __pyx_6 = PyString_AsString(__pyx_v_item); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L3;}
+      __pyx_4 = PyInt_FromLong(dsAppendStringToListAlloc(((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->directory,__pyx_v_attrTypes,__pyx_6)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L3;}
+      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L3;}
+      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4);
+      __pyx_4 = 0;
+      __pyx_4 = PyObject_CallObject(__pyx_8, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L3;}
+      Py_DECREF(__pyx_8); __pyx_8 = 0;
+      Py_DECREF(__pyx_3); __pyx_3 = 0;
+      Py_DECREF(__pyx_4); __pyx_4 = 0;
+    }
+    __pyx_L14:;
+    Py_DECREF(__pyx_7); __pyx_7 = 0;
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":153 */
+    __pyx_8 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L3;}
+    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L3;}
+    Py_INCREF(__pyx_v_attributeTypes);
+    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_attributeTypes);
+    __pyx_4 = PyObject_CallObject(__pyx_8, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L3;}
+    Py_DECREF(__pyx_8); __pyx_8 = 0;
+    Py_DECREF(__pyx_3); __pyx_3 = 0;
+    __pyx_7 = PyLong_FromUnsignedLong(dsDataListGetNodeCount(__pyx_v_attrTypes)); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; goto __pyx_L3;}
+    if (PyObject_Cmp(__pyx_4, __pyx_7, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L3;}
+    __pyx_1 = __pyx_1 == 0;
+    Py_DECREF(__pyx_4); __pyx_4 = 0;
+    Py_DECREF(__pyx_7); __pyx_7 = 0;
+    if (!__pyx_1) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L3;}
+    }
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":156 */
+    __pyx_v_records = dsDataBufferAllocate(((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->directory,(128 * 1024));
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":157 */
+    __pyx_8 = __pyx_f_16DirectoryService_raiseIfNull(__pyx_v_records); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; goto __pyx_L3;}
+    Py_DECREF(__pyx_8); __pyx_8 = 0;
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":159 */
+    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; goto __pyx_L3;}
+    __pyx_9 = PyInt_AsUnsignedLongMask(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; goto __pyx_L3;}
+    Py_DECREF(__pyx_3); __pyx_3 = 0;
+    __pyx_4 = PyInt_FromLong(dsGetRecordList(((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->node,__pyx_v_records,__pyx_v_recNames,__pyx_v_cMatchType,__pyx_v_recTypes,__pyx_v_attrTypes,__pyx_9,(&__pyx_v_recordCount),(&__pyx_v_context))); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; goto __pyx_L3;}
+    Py_DECREF(__pyx_v_dirStatus);
+    __pyx_v_dirStatus = __pyx_4;
+    __pyx_4 = 0;
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":163 */
+    __pyx_7 = __Pyx_GetName(__pyx_m, __pyx_n_raiseOnError); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; goto __pyx_L3;}
+    __pyx_8 = PyTuple_New(1); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; goto __pyx_L3;}
+    Py_INCREF(__pyx_v_dirStatus);
+    PyTuple_SET_ITEM(__pyx_8, 0, __pyx_v_dirStatus);
+    __pyx_3 = PyObject_CallObject(__pyx_7, __pyx_8); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; goto __pyx_L3;}
+    Py_DECREF(__pyx_7); __pyx_7 = 0;
+    Py_DECREF(__pyx_8); __pyx_8 = 0;
+    Py_DECREF(__pyx_3); __pyx_3 = 0;
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":165 */
+    __pyx_4 = PyLong_FromUnsignedLong(((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->directory); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L3;}
+    __pyx_7 = PyLong_FromUnsignedLong(((struct __pyx_obj_16DirectoryService_DirectoryNode *)__pyx_v_self)->node); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L3;}
+    __pyx_8 = PyLong_FromUnsignedLong(((unsigned long )__pyx_v_records)); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; goto __pyx_L3;}
+    __pyx_3 = PyLong_FromUnsignedLong(((unsigned long )__pyx_v_context)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; goto __pyx_L3;}
+    __pyx_10 = PyLong_FromUnsignedLong(__pyx_v_recordCount); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L3;}
+    __pyx_11 = PyTuple_New(5); if (!__pyx_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L3;}
+    PyTuple_SET_ITEM(__pyx_11, 0, __pyx_4);
+    PyTuple_SET_ITEM(__pyx_11, 1, __pyx_7);
+    PyTuple_SET_ITEM(__pyx_11, 2, __pyx_8);
+    PyTuple_SET_ITEM(__pyx_11, 3, __pyx_3);
+    PyTuple_SET_ITEM(__pyx_11, 4, __pyx_10);
+    __pyx_4 = 0;
+    __pyx_7 = 0;
+    __pyx_8 = 0;
+    __pyx_3 = 0;
+    __pyx_10 = 0;
+    __pyx_4 = PyObject_CallObject(((PyObject*)__pyx_ptype_16DirectoryService_DirectoryRecordList), __pyx_11); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L3;}
+    Py_DECREF(__pyx_11); __pyx_11 = 0;
+    Py_DECREF(__pyx_v_recordList);
+    __pyx_v_recordList = __pyx_4;
+    __pyx_4 = 0;
+  }
+  /*finally:*/ {
+    int __pyx_why;
+    __pyx_why = 0; goto __pyx_L4;
+    __pyx_L2: __pyx_why = 3; goto __pyx_L4;
+    __pyx_L3: {
+      __pyx_why = 4;
+      Py_XDECREF(__pyx_7); __pyx_7 = 0;
+      Py_XDECREF(__pyx_8); __pyx_8 = 0;
+      Py_XDECREF(__pyx_3); __pyx_3 = 0;
+      Py_XDECREF(__pyx_10); __pyx_10 = 0;
+      Py_XDECREF(__pyx_11); __pyx_11 = 0;
+      Py_XDECREF(__pyx_4); __pyx_4 = 0;
+      PyErr_Fetch(&__pyx_7, &__pyx_8, &__pyx_3);
+      __pyx_2 = __pyx_lineno;
+      goto __pyx_L4;
+    }
+    __pyx_L4:;
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":172 */
+    switch (__pyx_why) {
+      case 3: goto __pyx_L0;
+      case 4: {
+        PyErr_Restore(__pyx_7, __pyx_8, __pyx_3);
+        __pyx_lineno = __pyx_2;
+        __pyx_7 = 0;
+        __pyx_8 = 0;
+        __pyx_3 = 0;
+        goto __pyx_L1;
+      }
+    }
+  }
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":180 */
+  Py_INCREF(__pyx_v_recordList);
+  __pyx_r = __pyx_v_recordList;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_3);
+  Py_XDECREF(__pyx_4);
+  Py_XDECREF(__pyx_7);
+  Py_XDECREF(__pyx_8);
+  Py_XDECREF(__pyx_10);
+  Py_XDECREF(__pyx_11);
+  __Pyx_AddTraceback("DirectoryService.DirectoryNode.listRecords");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_recordList);
+  Py_DECREF(__pyx_v_item);
+  Py_DECREF(__pyx_v_dirStatus);
+  Py_DECREF(__pyx_v_self);
+  Py_DECREF(__pyx_v_recordTypes);
+  Py_DECREF(__pyx_v_recordNames);
+  Py_DECREF(__pyx_v_attributeTypes);
+  Py_DECREF(__pyx_v_matchType);
+  return __pyx_r;
+}
+
+static PyObject *__pyx_n_dr;
+
+static PyObject *__pyx_f_16DirectoryService_23DirectoryRecordListIter___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_16DirectoryService_23DirectoryRecordListIter___init__ = {"__init__", (PyCFunction)__pyx_f_16DirectoryService_23DirectoryRecordListIter___init__, METH_VARARGS|METH_KEYWORDS, 0};
+static PyObject *__pyx_f_16DirectoryService_23DirectoryRecordListIter___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_self = 0;
+  PyObject *__pyx_v_dr = 0;
+  PyObject *__pyx_r;
+  static char *__pyx_argnames[] = {"self","dr",0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_self, &__pyx_v_dr)) return 0;
+  Py_INCREF(__pyx_v_self);
+  Py_INCREF(__pyx_v_dr);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":3 */
+  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_dr, __pyx_v_dr) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 3; goto __pyx_L1;}
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  __Pyx_AddTraceback("DirectoryService.DirectoryRecordListIter.__init__");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_self);
+  Py_DECREF(__pyx_v_dr);
+  return __pyx_r;
+}
+
+static PyObject *__pyx_f_16DirectoryService_23DirectoryRecordListIter_next(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_16DirectoryService_23DirectoryRecordListIter_next = {"next", (PyCFunction)__pyx_f_16DirectoryService_23DirectoryRecordListIter_next, METH_VARARGS|METH_KEYWORDS, 0};
+static PyObject *__pyx_f_16DirectoryService_23DirectoryRecordListIter_next(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_self = 0;
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+  static char *__pyx_argnames[] = {"self",0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_self)) return 0;
+  Py_INCREF(__pyx_v_self);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":6 */
+  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_dr); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; goto __pyx_L1;}
+  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_next); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; goto __pyx_L1;}
+  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; goto __pyx_L1;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  __pyx_r = __pyx_3;
+  __pyx_3 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  __Pyx_AddTraceback("DirectoryService.DirectoryRecordListIter.next");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_self);
+  return __pyx_r;
+}
+
+static int __pyx_f_16DirectoryService_19DirectoryRecordList___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_f_16DirectoryService_19DirectoryRecordList___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  unsigned long __pyx_v_directory;
+  unsigned long __pyx_v_node;
+  unsigned long __pyx_v_recordList;
+  unsigned long __pyx_v_context;
+  unsigned long __pyx_v_recordCount;
+  int __pyx_r;
+  PyObject *__pyx_1 = 0;
+  static char *__pyx_argnames[] = {"directory","node","recordList","context","recordCount",0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "kkkkk", __pyx_argnames, &__pyx_v_directory, &__pyx_v_node, &__pyx_v_recordList, &__pyx_v_context, &__pyx_v_recordCount)) return -1;
+  Py_INCREF(__pyx_v_self);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":22 */
+  ((struct __pyx_obj_16DirectoryService_DirectoryRecordList *)__pyx_v_self)->directory = __pyx_v_directory;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":23 */
+  ((struct __pyx_obj_16DirectoryService_DirectoryRecordList *)__pyx_v_self)->node = __pyx_v_node;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":25 */
+  ((struct __pyx_obj_16DirectoryService_DirectoryRecordList *)__pyx_v_self)->records = ((void (*))__pyx_v_recordList);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":26 */
+  __pyx_1 = __pyx_f_16DirectoryService_raiseIfNull(((struct __pyx_obj_16DirectoryService_DirectoryRecordList *)__pyx_v_self)->records); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":28 */
+  ((struct __pyx_obj_16DirectoryService_DirectoryRecordList *)__pyx_v_self)->context = ((void (*))__pyx_v_context);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":30 */
+  ((struct __pyx_obj_16DirectoryService_DirectoryRecordList *)__pyx_v_self)->recordCount = __pyx_v_recordCount;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":31 */
+  ((struct __pyx_obj_16DirectoryService_DirectoryRecordList *)__pyx_v_self)->recordIndex = 1;
+
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  __Pyx_AddTraceback("DirectoryService.DirectoryRecordList.__new__");
+  __pyx_r = -1;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_self);
+  return __pyx_r;
+}
+
+static void __pyx_f_16DirectoryService_19DirectoryRecordList___dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_f_16DirectoryService_19DirectoryRecordList___dealloc__(PyObject *__pyx_v_self) {
+  Py_INCREF(__pyx_v_self);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":34 */
+  dsReleaseContinueData(((struct __pyx_obj_16DirectoryService_DirectoryRecordList *)__pyx_v_self)->directory,((struct __pyx_obj_16DirectoryService_DirectoryRecordList *)__pyx_v_self)->context);
+
+  goto __pyx_L0;
+  __pyx_L1:;
+  __Pyx_AddTraceback("DirectoryService.DirectoryRecordList.__dealloc__");
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_self);
+}
+
+static int __pyx_f_16DirectoryService_19DirectoryRecordList___len__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_f_16DirectoryService_19DirectoryRecordList___len__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  Py_INCREF(__pyx_v_self);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":37 */
+  __pyx_r = ((struct __pyx_obj_16DirectoryService_DirectoryRecordList *)__pyx_v_self)->recordCount;
+  goto __pyx_L0;
+
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1:;
+  __Pyx_AddTraceback("DirectoryService.DirectoryRecordList.__len__");
+  __pyx_r = -1;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_self);
+  return __pyx_r;
+}
+
+static PyObject *__pyx_f_16DirectoryService_19DirectoryRecordList__getRecord(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_16DirectoryService_19DirectoryRecordList__getRecord(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_index = 0;
+  tAttributeListRef __pyx_v_attrListRef;
+  tRecordEntryPtr __pyx_v_pRecEntry;
+  PyObject *__pyx_v_record;
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  unsigned long __pyx_2;
+  PyObject *__pyx_3 = 0;
+  PyObject *__pyx_4 = 0;
+  static char *__pyx_argnames[] = {"index",0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_index)) return 0;
+  Py_INCREF(__pyx_v_self);
+  Py_INCREF(__pyx_v_index);
+  __pyx_v_record = Py_None; Py_INCREF(Py_None);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":43 */
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_raiseOnError); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; goto __pyx_L1;}
+  __pyx_2 = PyInt_AsUnsignedLongMask(__pyx_v_index); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; goto __pyx_L1;}
+  __pyx_3 = PyInt_FromLong(dsGetRecordEntry(((struct __pyx_obj_16DirectoryService_DirectoryRecordList *)__pyx_v_self)->node,((struct __pyx_obj_16DirectoryService_DirectoryRecordList *)__pyx_v_self)->records,__pyx_2,(&__pyx_v_attrListRef),(&__pyx_v_pRecEntry))); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; goto __pyx_L1;}
+  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; goto __pyx_L1;}
+  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
+  __pyx_3 = 0;
+  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_4); __pyx_4 = 0;
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":47 */
+  __pyx_1 = PyLong_FromUnsignedLong(__pyx_v_attrListRef); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 47; goto __pyx_L1;}
+  __pyx_4 = PyLong_FromUnsignedLong(((unsigned long )__pyx_v_pRecEntry)); if (!__pyx_4) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 47; goto __pyx_L1;}
+  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 47; goto __pyx_L1;}
+  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
+  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);
+  __pyx_1 = 0;
+  __pyx_4 = 0;
+  __pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_16DirectoryService_DirectoryRecord), __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 47; goto __pyx_L1;}
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+  Py_DECREF(__pyx_v_record);
+  __pyx_v_record = __pyx_1;
+  __pyx_1 = 0;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":49 */
+  dsCloseAttributeList(__pyx_v_attrListRef);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":50 */
+  dsDeallocRecordEntry(((struct __pyx_obj_16DirectoryService_DirectoryRecordList *)__pyx_v_self)->directory,__pyx_v_pRecEntry);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":52 */
+  Py_INCREF(__pyx_v_record);
+  __pyx_r = __pyx_v_record;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_3);
+  Py_XDECREF(__pyx_4);
+  __Pyx_AddTraceback("DirectoryService.DirectoryRecordList._getRecord");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_record);
+  Py_DECREF(__pyx_v_self);
+  Py_DECREF(__pyx_v_index);
+  return __pyx_r;
+}
+
+static PyObject *__pyx_n__getRecord;
+
+static PyObject *__pyx_f_16DirectoryService_19DirectoryRecordList___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/
+static PyObject *__pyx_f_16DirectoryService_19DirectoryRecordList___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_index) {
+  unsigned long __pyx_v_index;
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+  Py_INCREF(__pyx_v_self);
+  __pyx_v_index = PyInt_AsUnsignedLongMask(__pyx_arg_index); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 54; goto __pyx_L1;}
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":55 */
+  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n__getRecord); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 55; goto __pyx_L1;}
+  __pyx_2 = PyLong_FromUnsignedLong(__pyx_v_index); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 55; goto __pyx_L1;}
+  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 55; goto __pyx_L1;}
+  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
+  __pyx_2 = 0;
+  __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 55; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  __Pyx_AddTraceback("DirectoryService.DirectoryRecordList.__getitem__");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_self);
+  return __pyx_r;
+}
+
+static PyObject *__pyx_f_16DirectoryService_19DirectoryRecordList___iter__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_f_16DirectoryService_19DirectoryRecordList___iter__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+  Py_INCREF(__pyx_v_self);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":58 */
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_DirectoryRecordListIter); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; goto __pyx_L1;}
+  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; goto __pyx_L1;}
+  Py_INCREF(__pyx_v_self);
+  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
+  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  __pyx_r = __pyx_3;
+  __pyx_3 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  __Pyx_AddTraceback("DirectoryService.DirectoryRecordList.__iter__");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_self);
+  return __pyx_r;
+}
+
+static PyObject *__pyx_n_StopIteration;
+
+static PyObject *__pyx_f_16DirectoryService_19DirectoryRecordList_next(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_16DirectoryService_19DirectoryRecordList_next(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_rec;
+  PyObject *__pyx_r;
+  int __pyx_1;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+  PyObject *__pyx_4 = 0;
+  static char *__pyx_argnames[] = {0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
+  Py_INCREF(__pyx_v_self);
+  __pyx_v_rec = Py_None; Py_INCREF(Py_None);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":61 */
+  __pyx_1 = (((struct __pyx_obj_16DirectoryService_DirectoryRecordList *)__pyx_v_self)->context == 0);
+  if (__pyx_1) {
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":62 */
+    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_StopIteration); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 62; goto __pyx_L1;}
+    __Pyx_Raise(__pyx_2, 0, 0);
+    Py_DECREF(__pyx_2); __pyx_2 = 0;
+    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 62; goto __pyx_L1;}
+    goto __pyx_L2;
+  }
+  __pyx_L2:;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":64 */
+  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n__getRecord); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 64; goto __pyx_L1;}
+  __pyx_3 = PyLong_FromUnsignedLong(((struct __pyx_obj_16DirectoryService_DirectoryRecordList *)__pyx_v_self)->recordIndex); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 64; goto __pyx_L1;}
+  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 64; goto __pyx_L1;}
+  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
+  __pyx_3 = 0;
+  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 64; goto __pyx_L1;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  Py_DECREF(__pyx_4); __pyx_4 = 0;
+  Py_DECREF(__pyx_v_rec);
+  __pyx_v_rec = __pyx_3;
+  __pyx_3 = 0;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":65 */
+  ((struct __pyx_obj_16DirectoryService_DirectoryRecordList *)__pyx_v_self)->recordIndex = (((struct __pyx_obj_16DirectoryService_DirectoryRecordList *)__pyx_v_self)->recordIndex + 1);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":67 */
+  Py_INCREF(__pyx_v_rec);
+  __pyx_r = __pyx_v_rec;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  Py_XDECREF(__pyx_4);
+  __Pyx_AddTraceback("DirectoryService.DirectoryRecordList.next");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_rec);
+  Py_DECREF(__pyx_v_self);
+  return __pyx_r;
+}
+
+static int __pyx_f_16DirectoryService_15DirectoryRecord___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_f_16DirectoryService_15DirectoryRecord___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  unsigned long __pyx_v_attrListRef;
+  unsigned long __pyx_v_pRecEntry;
+  int __pyx_r;
+  static char *__pyx_argnames[] = {"attrListRef","pRecEntry",0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "kk", __pyx_argnames, &__pyx_v_attrListRef, &__pyx_v_pRecEntry)) return -1;
+  Py_INCREF(__pyx_v_self);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":72 */
+
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1:;
+  __Pyx_AddTraceback("DirectoryService.DirectoryRecord.__new__");
+  __pyx_r = -1;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_self);
+  return __pyx_r;
+}
+
+static PyObject *__pyx_n_errno;
+
+static PyObject *__pyx_f_16DirectoryService_22DirectoryServicesError___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_16DirectoryService_22DirectoryServicesError___init__ = {"__init__", (PyCFunction)__pyx_f_16DirectoryService_22DirectoryServicesError___init__, METH_VARARGS|METH_KEYWORDS, 0};
+static PyObject *__pyx_f_16DirectoryService_22DirectoryServicesError___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_self = 0;
+  PyObject *__pyx_v_errno = 0;
+  PyObject *__pyx_r;
+  static char *__pyx_argnames[] = {"self","errno",0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_self, &__pyx_v_errno)) return 0;
+  Py_INCREF(__pyx_v_self);
+  Py_INCREF(__pyx_v_errno);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":7 */
+  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_errno, __pyx_v_errno) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; goto __pyx_L1;}
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  __Pyx_AddTraceback("DirectoryService.DirectoryServicesError.__init__");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_self);
+  Py_DECREF(__pyx_v_errno);
+  return __pyx_r;
+}
+
+static PyObject *__pyx_k12p;
+
+static char (__pyx_k12[]) = "<DirectoryServicesError: %d>";
+
+static PyObject *__pyx_f_16DirectoryService_22DirectoryServicesError___str__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_16DirectoryService_22DirectoryServicesError___str__ = {"__str__", (PyCFunction)__pyx_f_16DirectoryService_22DirectoryServicesError___str__, METH_VARARGS|METH_KEYWORDS, 0};
+static PyObject *__pyx_f_16DirectoryService_22DirectoryServicesError___str__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_self = 0;
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  static char *__pyx_argnames[] = {"self",0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_self)) return 0;
+  Py_INCREF(__pyx_v_self);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":10 */
+  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_errno); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; goto __pyx_L1;}
+  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; goto __pyx_L1;}
+  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
+  __pyx_1 = 0;
+  __pyx_1 = PyNumber_Remainder(__pyx_k12p, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; goto __pyx_L1;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  __pyx_r = __pyx_1;
+  __pyx_1 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  __Pyx_AddTraceback("DirectoryService.DirectoryServicesError.__str__");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_self);
+  return __pyx_r;
+}
+
+static PyObject *__pyx_f_16DirectoryService_22DirectoryServicesError___repr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_16DirectoryService_22DirectoryServicesError___repr__ = {"__repr__", (PyCFunction)__pyx_f_16DirectoryService_22DirectoryServicesError___repr__, METH_VARARGS|METH_KEYWORDS, 0};
+static PyObject *__pyx_f_16DirectoryService_22DirectoryServicesError___repr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_self = 0;
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+  static char *__pyx_argnames[] = {"self",0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_self)) return 0;
+  Py_INCREF(__pyx_v_self);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":13 */
+  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___str__); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 13; goto __pyx_L1;}
+  __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 13; goto __pyx_L1;}
+  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 13; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  __pyx_r = __pyx_3;
+  __pyx_3 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  __Pyx_AddTraceback("DirectoryService.DirectoryServicesError.__repr__");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_self);
+  return __pyx_r;
+}
+
+static PyObject *__pyx_n_ValueError;
+
+static PyObject *__pyx_k13p;
+
+static char (__pyx_k13[]) = "Null pointer";
+
+static PyObject *__pyx_f_16DirectoryService_raiseIfNull(void (*__pyx_v_ptr)) {
+  PyObject *__pyx_r;
+  int __pyx_1;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+  PyObject *__pyx_4 = 0;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":17 */
+  __pyx_1 = (__pyx_v_ptr == 0);
+  if (__pyx_1) {
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":18 */
+    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; goto __pyx_L1;}
+    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; goto __pyx_L1;}
+    Py_INCREF(__pyx_k13p);
+    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k13p);
+    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; goto __pyx_L1;}
+    Py_DECREF(__pyx_2); __pyx_2 = 0;
+    Py_DECREF(__pyx_3); __pyx_3 = 0;
+    __Pyx_Raise(__pyx_4, 0, 0);
+    Py_DECREF(__pyx_4); __pyx_4 = 0;
+    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; goto __pyx_L1;}
+    goto __pyx_L2;
+  }
+  __pyx_L2:;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  Py_XDECREF(__pyx_4);
+  __Pyx_AddTraceback("DirectoryService.raiseIfNull");
+  __pyx_r = 0;
+  __pyx_L0:;
+  return __pyx_r;
+}
+
+static PyObject *__pyx_f_16DirectoryService_raiseOnError(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_16DirectoryService_raiseOnError(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_dirStatus = 0;
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  int __pyx_2;
+  PyObject *__pyx_3 = 0;
+  PyObject *__pyx_4 = 0;
+  static char *__pyx_argnames[] = {"dirStatus",0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_dirStatus)) return 0;
+  Py_INCREF(__pyx_v_dirStatus);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":22 */
+  __pyx_1 = PyInt_FromLong(eDSNoErr); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 22; goto __pyx_L1;}
+  if (PyObject_Cmp(__pyx_v_dirStatus, __pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 22; goto __pyx_L1;}
+  __pyx_2 = __pyx_2 != 0;
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  if (__pyx_2) {
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":23 */
+    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_DirectoryServicesError); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; goto __pyx_L1;}
+    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; goto __pyx_L1;}
+    Py_INCREF(__pyx_v_dirStatus);
+    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_dirStatus);
+    __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; goto __pyx_L1;}
+    Py_DECREF(__pyx_1); __pyx_1 = 0;
+    Py_DECREF(__pyx_3); __pyx_3 = 0;
+    __Pyx_Raise(__pyx_4, 0, 0);
+    Py_DECREF(__pyx_4); __pyx_4 = 0;
+    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; goto __pyx_L1;}
+    goto __pyx_L2;
+  }
+  __pyx_L2:;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_3);
+  Py_XDECREF(__pyx_4);
+  __Pyx_AddTraceback("DirectoryService.raiseOnError");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_dirStatus);
+  return __pyx_r;
+}
+
+static int __pyx_f_16DirectoryService_16DirectoryService___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_f_16DirectoryService_16DirectoryService___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_r;
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+  static char *__pyx_argnames[] = {0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1;
+  Py_INCREF(__pyx_v_self);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":30 */
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_raiseOnError); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 30; goto __pyx_L1;}
+  __pyx_2 = PyInt_FromLong(dsOpenDirService((&((struct __pyx_obj_16DirectoryService_DirectoryService *)__pyx_v_self)->gDirRef))); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 30; goto __pyx_L1;}
+  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 30; goto __pyx_L1;}
+  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
+  __pyx_2 = 0;
+  __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 30; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  __Pyx_AddTraceback("DirectoryService.DirectoryService.__new__");
+  __pyx_r = -1;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_self);
+  return __pyx_r;
+}
+
+static void __pyx_f_16DirectoryService_16DirectoryService___dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_f_16DirectoryService_16DirectoryService___dealloc__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+  Py_INCREF(__pyx_v_self);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":33 */
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_raiseOnError); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 33; goto __pyx_L1;}
+  __pyx_2 = PyInt_FromLong(dsCloseDirService(((struct __pyx_obj_16DirectoryService_DirectoryService *)__pyx_v_self)->gDirRef)); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 33; goto __pyx_L1;}
+  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 33; goto __pyx_L1;}
+  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
+  __pyx_2 = 0;
+  __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 33; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  __Pyx_AddTraceback("DirectoryService.DirectoryService.__dealloc__");
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_self);
+}
+
+static PyObject *__pyx_f_16DirectoryService_16DirectoryService_getNodeCount(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_16DirectoryService_16DirectoryService_getNodeCount(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  unsigned long __pyx_v_nodeCount;
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+  static char *__pyx_argnames[] = {0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
+  Py_INCREF(__pyx_v_self);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":37 */
+  __pyx_v_nodeCount = 0;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":39 */
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_raiseOnError); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 39; goto __pyx_L1;}
+  __pyx_2 = PyInt_FromLong(dsGetDirNodeCount(((struct __pyx_obj_16DirectoryService_DirectoryService *)__pyx_v_self)->gDirRef,(&__pyx_v_nodeCount))); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 39; goto __pyx_L1;}
+  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 39; goto __pyx_L1;}
+  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
+  __pyx_2 = 0;
+  __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 39; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":41 */
+  __pyx_1 = PyLong_FromUnsignedLong(__pyx_v_nodeCount); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; goto __pyx_L1;}
+  __pyx_r = __pyx_1;
+  __pyx_1 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  __Pyx_AddTraceback("DirectoryService.DirectoryService.getNodeCount");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_self);
+  return __pyx_r;
+}
+
+static PyObject *__pyx_n_append;
+
+static PyObject *__pyx_f_16DirectoryService_16DirectoryService_getNodeList(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_16DirectoryService_16DirectoryService_getNodeList(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  tDataBufferPtr __pyx_v_dataBuffer;
+  unsigned long __pyx_v_bufferCount;
+  tContextData __pyx_v_context;
+  tDataListPtr __pyx_v_nodeName;
+  unsigned long __pyx_v_index;
+  PyObject *__pyx_v_done;
+  PyObject *__pyx_v_nodes;
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  int __pyx_2;
+  PyObject *__pyx_3 = 0;
+  PyObject *__pyx_4 = 0;
+  int __pyx_5;
+  PyObject *__pyx_6 = 0;
+  PyObject *__pyx_7 = 0;
+  PyObject *__pyx_8 = 0;
+  static char *__pyx_argnames[] = {0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
+  Py_INCREF(__pyx_v_self);
+  __pyx_v_done = Py_None; Py_INCREF(Py_None);
+  __pyx_v_nodes = Py_None; Py_INCREF(Py_None);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":50 */
+  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; goto __pyx_L1;}
+  Py_DECREF(__pyx_v_done);
+  __pyx_v_done = __pyx_1;
+  __pyx_1 = 0;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":52 */
+  __pyx_v_dataBuffer = dsDataBufferAllocate(((struct __pyx_obj_16DirectoryService_DirectoryService *)__pyx_v_self)->gDirRef,(32 * 1024));
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":54 */
+  __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; goto __pyx_L1;}
+  Py_DECREF(__pyx_v_nodes);
+  __pyx_v_nodes = __pyx_1;
+  __pyx_1 = 0;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":55 */
+  /*try:*/ {
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":56 */
+    __pyx_2 = (__pyx_v_dataBuffer != 0);
+    if (__pyx_2) {
+
+      /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":57 */
+      while (1) {
+        __pyx_L6:;
+        __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 57; goto __pyx_L3;}
+        if (PyObject_Cmp(__pyx_v_done, __pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 57; goto __pyx_L3;}
+        __pyx_2 = __pyx_2 == 0;
+        Py_DECREF(__pyx_1); __pyx_1 = 0;
+        if (!__pyx_2) break;
+
+        /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":58 */
+        __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_raiseOnError); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 58; goto __pyx_L3;}
+        __pyx_3 = PyInt_FromLong(dsGetDirNodeList(((struct __pyx_obj_16DirectoryService_DirectoryService *)__pyx_v_self)->gDirRef,__pyx_v_dataBuffer,(&__pyx_v_bufferCount),(&__pyx_v_context))); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; goto __pyx_L3;}
+        __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 58; goto __pyx_L3;}
+        PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
+        __pyx_3 = 0;
+        __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 58; goto __pyx_L3;}
+        Py_DECREF(__pyx_1); __pyx_1 = 0;
+        Py_DECREF(__pyx_4); __pyx_4 = 0;
+        Py_DECREF(__pyx_3); __pyx_3 = 0;
+
+        /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":62 */
+        for (__pyx_v_index = 1; __pyx_v_index < __pyx_v_bufferCount; ++__pyx_v_index) {
+
+          /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":63 */
+          __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_raiseOnError); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 63; goto __pyx_L3;}
+          __pyx_4 = PyInt_FromLong(dsGetDirNodeName(((struct __pyx_obj_16DirectoryService_DirectoryService *)__pyx_v_self)->gDirRef,__pyx_v_dataBuffer,__pyx_v_index,(&__pyx_v_nodeName))); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; goto __pyx_L3;}
+          __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 63; goto __pyx_L3;}
+          PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4);
+          __pyx_4 = 0;
+          __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 63; goto __pyx_L3;}
+          Py_DECREF(__pyx_1); __pyx_1 = 0;
+          Py_DECREF(__pyx_3); __pyx_3 = 0;
+          Py_DECREF(__pyx_4); __pyx_4 = 0;
+
+          /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":69 */
+          __pyx_1 = PyObject_GetAttr(__pyx_v_nodes, __pyx_n_append); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; goto __pyx_L3;}
+          __pyx_3 = __pyx_f_16DirectoryService_nodeFromName(((struct __pyx_obj_16DirectoryService_DirectoryService *)__pyx_v_self)->gDirRef,__pyx_v_nodeName); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; goto __pyx_L3;}
+          __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; goto __pyx_L3;}
+          PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
+          __pyx_3 = 0;
+          __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; goto __pyx_L3;}
+          Py_DECREF(__pyx_1); __pyx_1 = 0;
+          Py_DECREF(__pyx_4); __pyx_4 = 0;
+          Py_DECREF(__pyx_3); __pyx_3 = 0;
+          __pyx_L8:;
+        }
+        __pyx_L9:;
+
+        /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":71 */
+        __pyx_1 = PyInt_FromLong((__pyx_v_context == 0)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; goto __pyx_L3;}
+        Py_DECREF(__pyx_v_done);
+        __pyx_v_done = __pyx_1;
+        __pyx_1 = 0;
+      }
+      __pyx_L7:;
+      goto __pyx_L5;
+    }
+    __pyx_L5:;
+  }
+  /*finally:*/ {
+    int __pyx_why;
+    __pyx_why = 0; goto __pyx_L4;
+    __pyx_L2: __pyx_why = 3; goto __pyx_L4;
+    __pyx_L3: {
+      __pyx_why = 4;
+      Py_XDECREF(__pyx_4); __pyx_4 = 0;
+      Py_XDECREF(__pyx_3); __pyx_3 = 0;
+      Py_XDECREF(__pyx_1); __pyx_1 = 0;
+      PyErr_Fetch(&__pyx_4, &__pyx_3, &__pyx_1);
+      __pyx_2 = __pyx_lineno;
+      goto __pyx_L4;
+    }
+    __pyx_L4:;
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":73 */
+    __pyx_5 = (__pyx_v_context != 0);
+    if (__pyx_5) {
+
+      /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":74 */
+      __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_raiseOnError); if (!__pyx_6) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; goto __pyx_L1;}
+      __pyx_7 = PyInt_FromLong(dsReleaseContinueData(((struct __pyx_obj_16DirectoryService_DirectoryService *)__pyx_v_self)->gDirRef,__pyx_v_context)); if (!__pyx_7) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 75; goto __pyx_L1;}
+      __pyx_8 = PyTuple_New(1); if (!__pyx_8) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; goto __pyx_L1;}
+      PyTuple_SET_ITEM(__pyx_8, 0, __pyx_7);
+      __pyx_7 = 0;
+      __pyx_7 = PyObject_CallObject(__pyx_6, __pyx_8); if (!__pyx_7) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; goto __pyx_L1;}
+      Py_DECREF(__pyx_6); __pyx_6 = 0;
+      Py_DECREF(__pyx_8); __pyx_8 = 0;
+      Py_DECREF(__pyx_7); __pyx_7 = 0;
+      goto __pyx_L10;
+    }
+    __pyx_L10:;
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":77 */
+    __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_raiseOnError); if (!__pyx_6) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; goto __pyx_L1;}
+    __pyx_8 = PyInt_FromLong(dsDataBufferDeAllocate(((struct __pyx_obj_16DirectoryService_DirectoryService *)__pyx_v_self)->gDirRef,__pyx_v_dataBuffer)); if (!__pyx_8) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; goto __pyx_L1;}
+    __pyx_7 = PyTuple_New(1); if (!__pyx_7) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; goto __pyx_L1;}
+    PyTuple_SET_ITEM(__pyx_7, 0, __pyx_8);
+    __pyx_8 = 0;
+    __pyx_8 = PyObject_CallObject(__pyx_6, __pyx_7); if (!__pyx_8) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; goto __pyx_L1;}
+    Py_DECREF(__pyx_6); __pyx_6 = 0;
+    Py_DECREF(__pyx_7); __pyx_7 = 0;
+    Py_DECREF(__pyx_8); __pyx_8 = 0;
+
+    /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":79 */
+    __pyx_v_dataBuffer = 0;
+    switch (__pyx_why) {
+      case 3: goto __pyx_L0;
+      case 4: {
+        PyErr_Restore(__pyx_4, __pyx_3, __pyx_1);
+        __pyx_lineno = __pyx_2;
+        __pyx_4 = 0;
+        __pyx_3 = 0;
+        __pyx_1 = 0;
+        goto __pyx_L1;
+      }
+    }
+  }
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":81 */
+  Py_INCREF(__pyx_v_nodes);
+  __pyx_r = __pyx_v_nodes;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_3);
+  Py_XDECREF(__pyx_4);
+  Py_XDECREF(__pyx_6);
+  Py_XDECREF(__pyx_7);
+  Py_XDECREF(__pyx_8);
+  __Pyx_AddTraceback("DirectoryService.DirectoryService.getNodeList");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_done);
+  Py_DECREF(__pyx_v_nodes);
+  Py_DECREF(__pyx_v_self);
+  return __pyx_r;
+}
+
+static char (__pyx_k14[]) = "/";
+
+static PyObject *__pyx_f_16DirectoryService_16DirectoryService_getNode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_16DirectoryService_16DirectoryService_getNode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  char (*__pyx_v_nodePath);
+  tDataListPtr __pyx_v_nodeName;
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+  static char *__pyx_argnames[] = {"nodePath",0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "s", __pyx_argnames, &__pyx_v_nodePath)) return 0;
+  Py_INCREF(__pyx_v_self);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":86 */
+  __pyx_v_nodeName = dsDataListAllocate(((struct __pyx_obj_16DirectoryService_DirectoryService *)__pyx_v_self)->gDirRef);
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":87 */
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_raiseOnError); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 87; goto __pyx_L1;}
+  __pyx_2 = PyInt_FromLong(dsBuildListFromPathAlloc(((struct __pyx_obj_16DirectoryService_DirectoryService *)__pyx_v_self)->gDirRef,__pyx_v_nodeName,((char (*))__pyx_v_nodePath),((char (*))__pyx_k14))); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 87; goto __pyx_L1;}
+  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 87; goto __pyx_L1;}
+  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
+  __pyx_2 = 0;
+  __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 87; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":92 */
+  __pyx_1 = __pyx_f_16DirectoryService_nodeFromName(((struct __pyx_obj_16DirectoryService_DirectoryService *)__pyx_v_self)->gDirRef,__pyx_v_nodeName); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 92; goto __pyx_L1;}
+  __pyx_r = __pyx_1;
+  __pyx_1 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  __Pyx_AddTraceback("DirectoryService.DirectoryService.getNode");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_self);
+  return __pyx_r;
+}
+
+static __Pyx_InternTabEntry __pyx_intern_tab[] = {
+  {&__pyx_n_Constants, "Constants"},
+  {&__pyx_n_DirectoryRecordListIter, "DirectoryRecordListIter"},
+  {&__pyx_n_DirectoryServices, "DirectoryServices"},
+  {&__pyx_n_DirectoryServicesError, "DirectoryServicesError"},
+  {&__pyx_n_Exception, "Exception"},
+  {&__pyx_n_False, "False"},
+  {&__pyx_n_StopIteration, "StopIteration"},
+  {&__pyx_n_ValueError, "ValueError"},
+  {&__pyx_n___init__, "__init__"},
+  {&__pyx_n___repr__, "__repr__"},
+  {&__pyx_n___str__, "__str__"},
+  {&__pyx_n__getRecord, "_getRecord"},
+  {&__pyx_n_append, "append"},
+  {&__pyx_n_close, "close"},
+  {&__pyx_n_dr, "dr"},
+  {&__pyx_n_errno, "errno"},
+  {&__pyx_n_false, "false"},
+  {&__pyx_n_getPath, "getPath"},
+  {&__pyx_n_kDSAttributesAll, "kDSAttributesAll"},
+  {&__pyx_n_kDSRecordsAll, "kDSRecordsAll"},
+  {&__pyx_n_kDSStdRecordTypeAll, "kDSStdRecordTypeAll"},
+  {&__pyx_n_len, "len"},
+  {&__pyx_n_next, "next"},
+  {&__pyx_n_raiseOnError, "raiseOnError"},
+  {&__pyx_n_str, "str"},
+  {&__pyx_n_true, "true"},
+  {0, 0}
+};
+
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+  {&__pyx_k10p, __pyx_k10, sizeof(__pyx_k10)},
+  {&__pyx_k12p, __pyx_k12, sizeof(__pyx_k12)},
+  {&__pyx_k13p, __pyx_k13, sizeof(__pyx_k13)},
+  {0, 0, 0}
+};
+
+static PyObject *__pyx_tp_new_16DirectoryService_DirectoryNode(PyTypeObject *t, PyObject *a, PyObject *k) {
+  PyObject *o = (*t->tp_alloc)(t, 0);
+  struct __pyx_obj_16DirectoryService_DirectoryNode *p = (struct __pyx_obj_16DirectoryService_DirectoryNode *)o;
+  if (__pyx_f_16DirectoryService_13DirectoryNode___new__(o, a, k) < 0) {
+    Py_DECREF(o); o = 0;
+  }
+  return o;
+}
+
+static void __pyx_tp_dealloc_16DirectoryService_DirectoryNode(PyObject *o) {
+  struct __pyx_obj_16DirectoryService_DirectoryNode *p = (struct __pyx_obj_16DirectoryService_DirectoryNode *)o;
+  {
+    PyObject *etype, *eval, *etb;
+    PyErr_Fetch(&etype, &eval, &etb);
+    ++o->ob_refcnt;
+    __pyx_f_16DirectoryService_13DirectoryNode___dealloc__(o);
+    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
+    --o->ob_refcnt;
+    PyErr_Restore(etype, eval, etb);
+  }
+  (*o->ob_type->tp_free)(o);
+}
+
+static int __pyx_tp_traverse_16DirectoryService_DirectoryNode(PyObject *o, visitproc v, void *a) {
+  int e;
+  struct __pyx_obj_16DirectoryService_DirectoryNode *p = (struct __pyx_obj_16DirectoryService_DirectoryNode *)o;
+  return 0;
+}
+
+static int __pyx_tp_clear_16DirectoryService_DirectoryNode(PyObject *o) {
+  struct __pyx_obj_16DirectoryService_DirectoryNode *p = (struct __pyx_obj_16DirectoryService_DirectoryNode *)o;
+  return 0;
+}
+
+static struct PyMethodDef __pyx_methods_16DirectoryService_DirectoryNode[] = {
+  {"open", (PyCFunction)__pyx_f_16DirectoryService_13DirectoryNode_open, METH_VARARGS|METH_KEYWORDS, 0},
+  {"close", (PyCFunction)__pyx_f_16DirectoryService_13DirectoryNode_close, METH_VARARGS|METH_KEYWORDS, 0},
+  {"getPath", (PyCFunction)__pyx_f_16DirectoryService_13DirectoryNode_getPath, METH_VARARGS|METH_KEYWORDS, 0},
+  {"hasRecord", (PyCFunction)__pyx_f_16DirectoryService_13DirectoryNode_hasRecord, METH_VARARGS|METH_KEYWORDS, 0},
+  {"listRecords", (PyCFunction)__pyx_f_16DirectoryService_13DirectoryNode_listRecords, METH_VARARGS|METH_KEYWORDS, 0},
+  {0, 0, 0, 0}
+};
+
+static PyNumberMethods __pyx_tp_as_number_DirectoryNode = {
+  0, /*nb_add*/
+  0, /*nb_subtract*/
+  0, /*nb_multiply*/
+  0, /*nb_divide*/
+  0, /*nb_remainder*/
+  0, /*nb_divmod*/
+  0, /*nb_power*/
+  0, /*nb_negative*/
+  0, /*nb_positive*/
+  0, /*nb_absolute*/
+  0, /*nb_nonzero*/
+  0, /*nb_invert*/
+  0, /*nb_lshift*/
+  0, /*nb_rshift*/
+  0, /*nb_and*/
+  0, /*nb_xor*/
+  0, /*nb_or*/
+  0, /*nb_coerce*/
+  0, /*nb_int*/
+  0, /*nb_long*/
+  0, /*nb_float*/
+  0, /*nb_oct*/
+  0, /*nb_hex*/
+  0, /*nb_inplace_add*/
+  0, /*nb_inplace_subtract*/
+  0, /*nb_inplace_multiply*/
+  0, /*nb_inplace_divide*/
+  0, /*nb_inplace_remainder*/
+  0, /*nb_inplace_power*/
+  0, /*nb_inplace_lshift*/
+  0, /*nb_inplace_rshift*/
+  0, /*nb_inplace_and*/
+  0, /*nb_inplace_xor*/
+  0, /*nb_inplace_or*/
+  0, /*nb_floor_divide*/
+  0, /*nb_true_divide*/
+  0, /*nb_inplace_floor_divide*/
+  0, /*nb_inplace_true_divide*/
+};
+
+static PySequenceMethods __pyx_tp_as_sequence_DirectoryNode = {
+  0, /*sq_length*/
+  0, /*sq_concat*/
+  0, /*sq_repeat*/
+  0, /*sq_item*/
+  0, /*sq_slice*/
+  0, /*sq_ass_item*/
+  0, /*sq_ass_slice*/
+  0, /*sq_contains*/
+  0, /*sq_inplace_concat*/
+  0, /*sq_inplace_repeat*/
+};
+
+static PyMappingMethods __pyx_tp_as_mapping_DirectoryNode = {
+  0, /*mp_length*/
+  0, /*mp_subscript*/
+  0, /*mp_ass_subscript*/
+};
+
+static PyBufferProcs __pyx_tp_as_buffer_DirectoryNode = {
+  0, /*bf_getreadbuffer*/
+  0, /*bf_getwritebuffer*/
+  0, /*bf_getsegcount*/
+  0, /*bf_getcharbuffer*/
+};
+
+PyTypeObject __pyx_type_16DirectoryService_DirectoryNode = {
+  PyObject_HEAD_INIT(0)
+  0, /*ob_size*/
+  "DirectoryService.DirectoryNode", /*tp_name*/
+  sizeof(struct __pyx_obj_16DirectoryService_DirectoryNode), /*tp_basicsize*/
+  0, /*tp_itemsize*/
+  __pyx_tp_dealloc_16DirectoryService_DirectoryNode, /*tp_dealloc*/
+  0, /*tp_print*/
+  0, /*tp_getattr*/
+  0, /*tp_setattr*/
+  0, /*tp_compare*/
+  __pyx_f_16DirectoryService_13DirectoryNode___repr__, /*tp_repr*/
+  &__pyx_tp_as_number_DirectoryNode, /*tp_as_number*/
+  &__pyx_tp_as_sequence_DirectoryNode, /*tp_as_sequence*/
+  &__pyx_tp_as_mapping_DirectoryNode, /*tp_as_mapping*/
+  0, /*tp_hash*/
+  0, /*tp_call*/
+  0, /*tp_str*/
+  0, /*tp_getattro*/
+  0, /*tp_setattro*/
+  &__pyx_tp_as_buffer_DirectoryNode, /*tp_as_buffer*/
+  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+  0, /*tp_doc*/
+  __pyx_tp_traverse_16DirectoryService_DirectoryNode, /*tp_traverse*/
+  __pyx_tp_clear_16DirectoryService_DirectoryNode, /*tp_clear*/
+  0, /*tp_richcompare*/
+  0, /*tp_weaklistoffset*/
+  0, /*tp_iter*/
+  0, /*tp_iternext*/
+  __pyx_methods_16DirectoryService_DirectoryNode, /*tp_methods*/
+  0, /*tp_members*/
+  0, /*tp_getset*/
+  0, /*tp_base*/
+  0, /*tp_dict*/
+  0, /*tp_descr_get*/
+  0, /*tp_descr_set*/
+  0, /*tp_dictoffset*/
+  0, /*tp_init*/
+  0, /*tp_alloc*/
+  __pyx_tp_new_16DirectoryService_DirectoryNode, /*tp_new*/
+  0, /*tp_free*/
+  0, /*tp_is_gc*/
+  0, /*tp_bases*/
+  0, /*tp_mro*/
+  0, /*tp_cache*/
+  0, /*tp_subclasses*/
+  0, /*tp_weaklist*/
+};
+
+static PyObject *__pyx_tp_new_16DirectoryService_DirectoryRecordList(PyTypeObject *t, PyObject *a, PyObject *k) {
+  PyObject *o = (*t->tp_alloc)(t, 0);
+  struct __pyx_obj_16DirectoryService_DirectoryRecordList *p = (struct __pyx_obj_16DirectoryService_DirectoryRecordList *)o;
+  if (__pyx_f_16DirectoryService_19DirectoryRecordList___new__(o, a, k) < 0) {
+    Py_DECREF(o); o = 0;
+  }
+  return o;
+}
+
+static void __pyx_tp_dealloc_16DirectoryService_DirectoryRecordList(PyObject *o) {
+  struct __pyx_obj_16DirectoryService_DirectoryRecordList *p = (struct __pyx_obj_16DirectoryService_DirectoryRecordList *)o;
+  {
+    PyObject *etype, *eval, *etb;
+    PyErr_Fetch(&etype, &eval, &etb);
+    ++o->ob_refcnt;
+    __pyx_f_16DirectoryService_19DirectoryRecordList___dealloc__(o);
+    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
+    --o->ob_refcnt;
+    PyErr_Restore(etype, eval, etb);
+  }
+  (*o->ob_type->tp_free)(o);
+}
+
+static int __pyx_tp_traverse_16DirectoryService_DirectoryRecordList(PyObject *o, visitproc v, void *a) {
+  int e;
+  struct __pyx_obj_16DirectoryService_DirectoryRecordList *p = (struct __pyx_obj_16DirectoryService_DirectoryRecordList *)o;
+  return 0;
+}
+
+static int __pyx_tp_clear_16DirectoryService_DirectoryRecordList(PyObject *o) {
+  struct __pyx_obj_16DirectoryService_DirectoryRecordList *p = (struct __pyx_obj_16DirectoryService_DirectoryRecordList *)o;
+  return 0;
+}
+static PyObject *__pyx_sq_item_16DirectoryService_DirectoryRecordList(PyObject *o, int i) {
+  PyObject *r;
+  PyObject *x = PyInt_FromLong(i); if(!x) return 0;
+  r = o->ob_type->tp_as_mapping->mp_subscript(o, x);
+  Py_DECREF(x);
+  return r;
+}
+
+static struct PyMethodDef __pyx_methods_16DirectoryService_DirectoryRecordList[] = {
+  {"_getRecord", (PyCFunction)__pyx_f_16DirectoryService_19DirectoryRecordList__getRecord, METH_VARARGS|METH_KEYWORDS, 0},
+  {"next", (PyCFunction)__pyx_f_16DirectoryService_19DirectoryRecordList_next, METH_VARARGS|METH_KEYWORDS, 0},
+  {0, 0, 0, 0}
+};
+
+static PyNumberMethods __pyx_tp_as_number_DirectoryRecordList = {
+  0, /*nb_add*/
+  0, /*nb_subtract*/
+  0, /*nb_multiply*/
+  0, /*nb_divide*/
+  0, /*nb_remainder*/
+  0, /*nb_divmod*/
+  0, /*nb_power*/
+  0, /*nb_negative*/
+  0, /*nb_positive*/
+  0, /*nb_absolute*/
+  0, /*nb_nonzero*/
+  0, /*nb_invert*/
+  0, /*nb_lshift*/
+  0, /*nb_rshift*/
+  0, /*nb_and*/
+  0, /*nb_xor*/
+  0, /*nb_or*/
+  0, /*nb_coerce*/
+  0, /*nb_int*/
+  0, /*nb_long*/
+  0, /*nb_float*/
+  0, /*nb_oct*/
+  0, /*nb_hex*/
+  0, /*nb_inplace_add*/
+  0, /*nb_inplace_subtract*/
+  0, /*nb_inplace_multiply*/
+  0, /*nb_inplace_divide*/
+  0, /*nb_inplace_remainder*/
+  0, /*nb_inplace_power*/
+  0, /*nb_inplace_lshift*/
+  0, /*nb_inplace_rshift*/
+  0, /*nb_inplace_and*/
+  0, /*nb_inplace_xor*/
+  0, /*nb_inplace_or*/
+  0, /*nb_floor_divide*/
+  0, /*nb_true_divide*/
+  0, /*nb_inplace_floor_divide*/
+  0, /*nb_inplace_true_divide*/
+};
+
+static PySequenceMethods __pyx_tp_as_sequence_DirectoryRecordList = {
+  __pyx_f_16DirectoryService_19DirectoryRecordList___len__, /*sq_length*/
+  0, /*sq_concat*/
+  0, /*sq_repeat*/
+  __pyx_sq_item_16DirectoryService_DirectoryRecordList, /*sq_item*/
+  0, /*sq_slice*/
+  0, /*sq_ass_item*/
+  0, /*sq_ass_slice*/
+  0, /*sq_contains*/
+  0, /*sq_inplace_concat*/
+  0, /*sq_inplace_repeat*/
+};
+
+static PyMappingMethods __pyx_tp_as_mapping_DirectoryRecordList = {
+  __pyx_f_16DirectoryService_19DirectoryRecordList___len__, /*mp_length*/
+  __pyx_f_16DirectoryService_19DirectoryRecordList___getitem__, /*mp_subscript*/
+  0, /*mp_ass_subscript*/
+};
+
+static PyBufferProcs __pyx_tp_as_buffer_DirectoryRecordList = {
+  0, /*bf_getreadbuffer*/
+  0, /*bf_getwritebuffer*/
+  0, /*bf_getsegcount*/
+  0, /*bf_getcharbuffer*/
+};
+
+PyTypeObject __pyx_type_16DirectoryService_DirectoryRecordList = {
+  PyObject_HEAD_INIT(0)
+  0, /*ob_size*/
+  "DirectoryService.DirectoryRecordList", /*tp_name*/
+  sizeof(struct __pyx_obj_16DirectoryService_DirectoryRecordList), /*tp_basicsize*/
+  0, /*tp_itemsize*/
+  __pyx_tp_dealloc_16DirectoryService_DirectoryRecordList, /*tp_dealloc*/
+  0, /*tp_print*/
+  0, /*tp_getattr*/
+  0, /*tp_setattr*/
+  0, /*tp_compare*/
+  0, /*tp_repr*/
+  &__pyx_tp_as_number_DirectoryRecordList, /*tp_as_number*/
+  &__pyx_tp_as_sequence_DirectoryRecordList, /*tp_as_sequence*/
+  &__pyx_tp_as_mapping_DirectoryRecordList, /*tp_as_mapping*/
+  0, /*tp_hash*/
+  0, /*tp_call*/
+  0, /*tp_str*/
+  0, /*tp_getattro*/
+  0, /*tp_setattro*/
+  &__pyx_tp_as_buffer_DirectoryRecordList, /*tp_as_buffer*/
+  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+  0, /*tp_doc*/
+  __pyx_tp_traverse_16DirectoryService_DirectoryRecordList, /*tp_traverse*/
+  __pyx_tp_clear_16DirectoryService_DirectoryRecordList, /*tp_clear*/
+  0, /*tp_richcompare*/
+  0, /*tp_weaklistoffset*/
+  __pyx_f_16DirectoryService_19DirectoryRecordList___iter__, /*tp_iter*/
+  0, /*tp_iternext*/
+  __pyx_methods_16DirectoryService_DirectoryRecordList, /*tp_methods*/
+  0, /*tp_members*/
+  0, /*tp_getset*/
+  0, /*tp_base*/
+  0, /*tp_dict*/
+  0, /*tp_descr_get*/
+  0, /*tp_descr_set*/
+  0, /*tp_dictoffset*/
+  0, /*tp_init*/
+  0, /*tp_alloc*/
+  __pyx_tp_new_16DirectoryService_DirectoryRecordList, /*tp_new*/
+  0, /*tp_free*/
+  0, /*tp_is_gc*/
+  0, /*tp_bases*/
+  0, /*tp_mro*/
+  0, /*tp_cache*/
+  0, /*tp_subclasses*/
+  0, /*tp_weaklist*/
+};
+
+static PyObject *__pyx_tp_new_16DirectoryService_DirectoryRecord(PyTypeObject *t, PyObject *a, PyObject *k) {
+  PyObject *o = (*t->tp_alloc)(t, 0);
+  struct __pyx_obj_16DirectoryService_DirectoryRecord *p = (struct __pyx_obj_16DirectoryService_DirectoryRecord *)o;
+  if (__pyx_f_16DirectoryService_15DirectoryRecord___new__(o, a, k) < 0) {
+    Py_DECREF(o); o = 0;
+  }
+  return o;
+}
+
+static void __pyx_tp_dealloc_16DirectoryService_DirectoryRecord(PyObject *o) {
+  struct __pyx_obj_16DirectoryService_DirectoryRecord *p = (struct __pyx_obj_16DirectoryService_DirectoryRecord *)o;
+  (*o->ob_type->tp_free)(o);
+}
+
+static int __pyx_tp_traverse_16DirectoryService_DirectoryRecord(PyObject *o, visitproc v, void *a) {
+  int e;
+  struct __pyx_obj_16DirectoryService_DirectoryRecord *p = (struct __pyx_obj_16DirectoryService_DirectoryRecord *)o;
+  return 0;
+}
+
+static int __pyx_tp_clear_16DirectoryService_DirectoryRecord(PyObject *o) {
+  struct __pyx_obj_16DirectoryService_DirectoryRecord *p = (struct __pyx_obj_16DirectoryService_DirectoryRecord *)o;
+  return 0;
+}
+
+static struct PyMethodDef __pyx_methods_16DirectoryService_DirectoryRecord[] = {
+  {0, 0, 0, 0}
+};
+
+static PyNumberMethods __pyx_tp_as_number_DirectoryRecord = {
+  0, /*nb_add*/
+  0, /*nb_subtract*/
+  0, /*nb_multiply*/
+  0, /*nb_divide*/
+  0, /*nb_remainder*/
+  0, /*nb_divmod*/
+  0, /*nb_power*/
+  0, /*nb_negative*/
+  0, /*nb_positive*/
+  0, /*nb_absolute*/
+  0, /*nb_nonzero*/
+  0, /*nb_invert*/
+  0, /*nb_lshift*/
+  0, /*nb_rshift*/
+  0, /*nb_and*/
+  0, /*nb_xor*/
+  0, /*nb_or*/
+  0, /*nb_coerce*/
+  0, /*nb_int*/
+  0, /*nb_long*/
+  0, /*nb_float*/
+  0, /*nb_oct*/
+  0, /*nb_hex*/
+  0, /*nb_inplace_add*/
+  0, /*nb_inplace_subtract*/
+  0, /*nb_inplace_multiply*/
+  0, /*nb_inplace_divide*/
+  0, /*nb_inplace_remainder*/
+  0, /*nb_inplace_power*/
+  0, /*nb_inplace_lshift*/
+  0, /*nb_inplace_rshift*/
+  0, /*nb_inplace_and*/
+  0, /*nb_inplace_xor*/
+  0, /*nb_inplace_or*/
+  0, /*nb_floor_divide*/
+  0, /*nb_true_divide*/
+  0, /*nb_inplace_floor_divide*/
+  0, /*nb_inplace_true_divide*/
+};
+
+static PySequenceMethods __pyx_tp_as_sequence_DirectoryRecord = {
+  0, /*sq_length*/
+  0, /*sq_concat*/
+  0, /*sq_repeat*/
+  0, /*sq_item*/
+  0, /*sq_slice*/
+  0, /*sq_ass_item*/
+  0, /*sq_ass_slice*/
+  0, /*sq_contains*/
+  0, /*sq_inplace_concat*/
+  0, /*sq_inplace_repeat*/
+};
+
+static PyMappingMethods __pyx_tp_as_mapping_DirectoryRecord = {
+  0, /*mp_length*/
+  0, /*mp_subscript*/
+  0, /*mp_ass_subscript*/
+};
+
+static PyBufferProcs __pyx_tp_as_buffer_DirectoryRecord = {
+  0, /*bf_getreadbuffer*/
+  0, /*bf_getwritebuffer*/
+  0, /*bf_getsegcount*/
+  0, /*bf_getcharbuffer*/
+};
+
+PyTypeObject __pyx_type_16DirectoryService_DirectoryRecord = {
+  PyObject_HEAD_INIT(0)
+  0, /*ob_size*/
+  "DirectoryService.DirectoryRecord", /*tp_name*/
+  sizeof(struct __pyx_obj_16DirectoryService_DirectoryRecord), /*tp_basicsize*/
+  0, /*tp_itemsize*/
+  __pyx_tp_dealloc_16DirectoryService_DirectoryRecord, /*tp_dealloc*/
+  0, /*tp_print*/
+  0, /*tp_getattr*/
+  0, /*tp_setattr*/
+  0, /*tp_compare*/
+  0, /*tp_repr*/
+  &__pyx_tp_as_number_DirectoryRecord, /*tp_as_number*/
+  &__pyx_tp_as_sequence_DirectoryRecord, /*tp_as_sequence*/
+  &__pyx_tp_as_mapping_DirectoryRecord, /*tp_as_mapping*/
+  0, /*tp_hash*/
+  0, /*tp_call*/
+  0, /*tp_str*/
+  0, /*tp_getattro*/
+  0, /*tp_setattro*/
+  &__pyx_tp_as_buffer_DirectoryRecord, /*tp_as_buffer*/
+  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+  0, /*tp_doc*/
+  __pyx_tp_traverse_16DirectoryService_DirectoryRecord, /*tp_traverse*/
+  __pyx_tp_clear_16DirectoryService_DirectoryRecord, /*tp_clear*/
+  0, /*tp_richcompare*/
+  0, /*tp_weaklistoffset*/
+  0, /*tp_iter*/
+  0, /*tp_iternext*/
+  __pyx_methods_16DirectoryService_DirectoryRecord, /*tp_methods*/
+  0, /*tp_members*/
+  0, /*tp_getset*/
+  0, /*tp_base*/
+  0, /*tp_dict*/
+  0, /*tp_descr_get*/
+  0, /*tp_descr_set*/
+  0, /*tp_dictoffset*/
+  0, /*tp_init*/
+  0, /*tp_alloc*/
+  __pyx_tp_new_16DirectoryService_DirectoryRecord, /*tp_new*/
+  0, /*tp_free*/
+  0, /*tp_is_gc*/
+  0, /*tp_bases*/
+  0, /*tp_mro*/
+  0, /*tp_cache*/
+  0, /*tp_subclasses*/
+  0, /*tp_weaklist*/
+};
+
+static PyObject *__pyx_tp_new_16DirectoryService_DirectoryService(PyTypeObject *t, PyObject *a, PyObject *k) {
+  PyObject *o = (*t->tp_alloc)(t, 0);
+  struct __pyx_obj_16DirectoryService_DirectoryService *p = (struct __pyx_obj_16DirectoryService_DirectoryService *)o;
+  if (__pyx_f_16DirectoryService_16DirectoryService___new__(o, a, k) < 0) {
+    Py_DECREF(o); o = 0;
+  }
+  return o;
+}
+
+static void __pyx_tp_dealloc_16DirectoryService_DirectoryService(PyObject *o) {
+  struct __pyx_obj_16DirectoryService_DirectoryService *p = (struct __pyx_obj_16DirectoryService_DirectoryService *)o;
+  {
+    PyObject *etype, *eval, *etb;
+    PyErr_Fetch(&etype, &eval, &etb);
+    ++o->ob_refcnt;
+    __pyx_f_16DirectoryService_16DirectoryService___dealloc__(o);
+    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
+    --o->ob_refcnt;
+    PyErr_Restore(etype, eval, etb);
+  }
+  (*o->ob_type->tp_free)(o);
+}
+
+static int __pyx_tp_traverse_16DirectoryService_DirectoryService(PyObject *o, visitproc v, void *a) {
+  int e;
+  struct __pyx_obj_16DirectoryService_DirectoryService *p = (struct __pyx_obj_16DirectoryService_DirectoryService *)o;
+  return 0;
+}
+
+static int __pyx_tp_clear_16DirectoryService_DirectoryService(PyObject *o) {
+  struct __pyx_obj_16DirectoryService_DirectoryService *p = (struct __pyx_obj_16DirectoryService_DirectoryService *)o;
+  return 0;
+}
+
+static struct PyMethodDef __pyx_methods_16DirectoryService_DirectoryService[] = {
+  {"getNodeCount", (PyCFunction)__pyx_f_16DirectoryService_16DirectoryService_getNodeCount, METH_VARARGS|METH_KEYWORDS, 0},
+  {"getNodeList", (PyCFunction)__pyx_f_16DirectoryService_16DirectoryService_getNodeList, METH_VARARGS|METH_KEYWORDS, 0},
+  {"getNode", (PyCFunction)__pyx_f_16DirectoryService_16DirectoryService_getNode, METH_VARARGS|METH_KEYWORDS, 0},
+  {0, 0, 0, 0}
+};
+
+static PyNumberMethods __pyx_tp_as_number_DirectoryService = {
+  0, /*nb_add*/
+  0, /*nb_subtract*/
+  0, /*nb_multiply*/
+  0, /*nb_divide*/
+  0, /*nb_remainder*/
+  0, /*nb_divmod*/
+  0, /*nb_power*/
+  0, /*nb_negative*/
+  0, /*nb_positive*/
+  0, /*nb_absolute*/
+  0, /*nb_nonzero*/
+  0, /*nb_invert*/
+  0, /*nb_lshift*/
+  0, /*nb_rshift*/
+  0, /*nb_and*/
+  0, /*nb_xor*/
+  0, /*nb_or*/
+  0, /*nb_coerce*/
+  0, /*nb_int*/
+  0, /*nb_long*/
+  0, /*nb_float*/
+  0, /*nb_oct*/
+  0, /*nb_hex*/
+  0, /*nb_inplace_add*/
+  0, /*nb_inplace_subtract*/
+  0, /*nb_inplace_multiply*/
+  0, /*nb_inplace_divide*/
+  0, /*nb_inplace_remainder*/
+  0, /*nb_inplace_power*/
+  0, /*nb_inplace_lshift*/
+  0, /*nb_inplace_rshift*/
+  0, /*nb_inplace_and*/
+  0, /*nb_inplace_xor*/
+  0, /*nb_inplace_or*/
+  0, /*nb_floor_divide*/
+  0, /*nb_true_divide*/
+  0, /*nb_inplace_floor_divide*/
+  0, /*nb_inplace_true_divide*/
+};
+
+static PySequenceMethods __pyx_tp_as_sequence_DirectoryService = {
+  0, /*sq_length*/
+  0, /*sq_concat*/
+  0, /*sq_repeat*/
+  0, /*sq_item*/
+  0, /*sq_slice*/
+  0, /*sq_ass_item*/
+  0, /*sq_ass_slice*/
+  0, /*sq_contains*/
+  0, /*sq_inplace_concat*/
+  0, /*sq_inplace_repeat*/
+};
+
+static PyMappingMethods __pyx_tp_as_mapping_DirectoryService = {
+  0, /*mp_length*/
+  0, /*mp_subscript*/
+  0, /*mp_ass_subscript*/
+};
+
+static PyBufferProcs __pyx_tp_as_buffer_DirectoryService = {
+  0, /*bf_getreadbuffer*/
+  0, /*bf_getwritebuffer*/
+  0, /*bf_getsegcount*/
+  0, /*bf_getcharbuffer*/
+};
+
+PyTypeObject __pyx_type_16DirectoryService_DirectoryService = {
+  PyObject_HEAD_INIT(0)
+  0, /*ob_size*/
+  "DirectoryService.DirectoryService", /*tp_name*/
+  sizeof(struct __pyx_obj_16DirectoryService_DirectoryService), /*tp_basicsize*/
+  0, /*tp_itemsize*/
+  __pyx_tp_dealloc_16DirectoryService_DirectoryService, /*tp_dealloc*/
+  0, /*tp_print*/
+  0, /*tp_getattr*/
+  0, /*tp_setattr*/
+  0, /*tp_compare*/
+  0, /*tp_repr*/
+  &__pyx_tp_as_number_DirectoryService, /*tp_as_number*/
+  &__pyx_tp_as_sequence_DirectoryService, /*tp_as_sequence*/
+  &__pyx_tp_as_mapping_DirectoryService, /*tp_as_mapping*/
+  0, /*tp_hash*/
+  0, /*tp_call*/
+  0, /*tp_str*/
+  0, /*tp_getattro*/
+  0, /*tp_setattro*/
+  &__pyx_tp_as_buffer_DirectoryService, /*tp_as_buffer*/
+  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+  0, /*tp_doc*/
+  __pyx_tp_traverse_16DirectoryService_DirectoryService, /*tp_traverse*/
+  __pyx_tp_clear_16DirectoryService_DirectoryService, /*tp_clear*/
+  0, /*tp_richcompare*/
+  0, /*tp_weaklistoffset*/
+  0, /*tp_iter*/
+  0, /*tp_iternext*/
+  __pyx_methods_16DirectoryService_DirectoryService, /*tp_methods*/
+  0, /*tp_members*/
+  0, /*tp_getset*/
+  0, /*tp_base*/
+  0, /*tp_dict*/
+  0, /*tp_descr_get*/
+  0, /*tp_descr_set*/
+  0, /*tp_dictoffset*/
+  0, /*tp_init*/
+  0, /*tp_alloc*/
+  __pyx_tp_new_16DirectoryService_DirectoryService, /*tp_new*/
+  0, /*tp_free*/
+  0, /*tp_is_gc*/
+  0, /*tp_bases*/
+  0, /*tp_mro*/
+  0, /*tp_cache*/
+  0, /*tp_subclasses*/
+  0, /*tp_weaklist*/
+};
+
+static struct PyMethodDef __pyx_methods[] = {
+  {"raiseOnError", (PyCFunction)__pyx_f_16DirectoryService_raiseOnError, METH_VARARGS|METH_KEYWORDS, 0},
+  {0, 0, 0, 0}
+};
+
+static void __pyx_init_filenames(void); /*proto*/
+
+PyMODINIT_FUNC initDirectoryService(void); /*proto*/
+PyMODINIT_FUNC initDirectoryService(void) {
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+  PyObject *__pyx_4 = 0;
+  __pyx_init_filenames();
+  __pyx_m = Py_InitModule4("DirectoryService", __pyx_methods, 0, 0, PYTHON_API_VERSION);
+  if (!__pyx_m) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; goto __pyx_L1;};
+  __pyx_b = PyImport_AddModule("__builtin__");
+  if (!__pyx_b) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; goto __pyx_L1;};
+  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; goto __pyx_L1;};
+  if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; goto __pyx_L1;};
+  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; goto __pyx_L1;};
+  if (PyType_Ready(&__pyx_type_16DirectoryService_DirectoryNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;}
+  if (PyObject_SetAttrString(__pyx_m, "DirectoryNode", (PyObject *)&__pyx_type_16DirectoryService_DirectoryNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;}
+  __pyx_ptype_16DirectoryService_DirectoryNode = &__pyx_type_16DirectoryService_DirectoryNode;
+  if (PyType_Ready(&__pyx_type_16DirectoryService_DirectoryRecordList) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 8; goto __pyx_L1;}
+  if (PyObject_SetAttrString(__pyx_m, "DirectoryRecordList", (PyObject *)&__pyx_type_16DirectoryService_DirectoryRecordList) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 8; goto __pyx_L1;}
+  __pyx_ptype_16DirectoryService_DirectoryRecordList = &__pyx_type_16DirectoryService_DirectoryRecordList;
+  if (PyType_Ready(&__pyx_type_16DirectoryService_DirectoryRecord) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; goto __pyx_L1;}
+  if (PyObject_SetAttrString(__pyx_m, "DirectoryRecord", (PyObject *)&__pyx_type_16DirectoryService_DirectoryRecord) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; goto __pyx_L1;}
+  __pyx_ptype_16DirectoryService_DirectoryRecord = &__pyx_type_16DirectoryService_DirectoryRecord;
+  if (PyType_Ready(&__pyx_type_16DirectoryService_DirectoryService) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; goto __pyx_L1;}
+  if (PyObject_SetAttrString(__pyx_m, "DirectoryService", (PyObject *)&__pyx_type_16DirectoryService_DirectoryService) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; goto __pyx_L1;}
+  __pyx_ptype_16DirectoryService_DirectoryService = &__pyx_type_16DirectoryService_DirectoryService;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":1 */
+  __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
+  Py_INCREF(__pyx_n_Constants);
+  PyList_SET_ITEM(__pyx_1, 0, __pyx_n_Constants);
+  __pyx_2 = __Pyx_Import(__pyx_n_DirectoryServices, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_Constants); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_Constants, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryNode.pyx":98 */
+  Py_INCREF(Py_None);
+  __pyx_k3 = Py_None;
+  Py_INCREF(Py_None);
+  __pyx_k4 = Py_None;
+  Py_INCREF(Py_None);
+  __pyx_k5 = Py_None;
+  Py_INCREF(Py_None);
+  __pyx_k6 = Py_None;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":1 */
+  __pyx_2 = PyDict_New(); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; goto __pyx_L1;}
+  __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; goto __pyx_L1;}
+  __pyx_3 = __Pyx_CreateClass(__pyx_1, __pyx_2, __pyx_n_DirectoryRecordListIter, "DirectoryService"); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":2 */
+  __pyx_1 = PyCFunction_New(&__pyx_mdef_16DirectoryService_23DirectoryRecordListIter___init__, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; goto __pyx_L1;}
+  __pyx_4 = PyMethod_New(__pyx_1, 0, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  if (PyObject_SetAttr(__pyx_3, __pyx_n___init__, __pyx_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; goto __pyx_L1;}
+  Py_DECREF(__pyx_4); __pyx_4 = 0;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryRecord.pyx":5 */
+  __pyx_1 = PyCFunction_New(&__pyx_mdef_16DirectoryService_23DirectoryRecordListIter_next, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; goto __pyx_L1;}
+  __pyx_4 = PyMethod_New(__pyx_1, 0, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  if (PyObject_SetAttr(__pyx_3, __pyx_n_next, __pyx_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; goto __pyx_L1;}
+  Py_DECREF(__pyx_4); __pyx_4 = 0;
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_DirectoryRecordListIter, __pyx_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; goto __pyx_L1;}
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":5 */
+  __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; goto __pyx_L1;}
+  __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_Exception); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; goto __pyx_L1;}
+  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; goto __pyx_L1;}
+  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
+  __pyx_4 = 0;
+  __pyx_3 = __Pyx_CreateClass(__pyx_2, __pyx_1, __pyx_n_DirectoryServicesError, "DirectoryService"); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; goto __pyx_L1;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":6 */
+  __pyx_4 = PyCFunction_New(&__pyx_mdef_16DirectoryService_22DirectoryServicesError___init__, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6; goto __pyx_L1;}
+  __pyx_2 = PyMethod_New(__pyx_4, 0, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6; goto __pyx_L1;}
+  Py_DECREF(__pyx_4); __pyx_4 = 0;
+  if (PyObject_SetAttr(__pyx_3, __pyx_n___init__, __pyx_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6; goto __pyx_L1;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":9 */
+  __pyx_4 = PyCFunction_New(&__pyx_mdef_16DirectoryService_22DirectoryServicesError___str__, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; goto __pyx_L1;}
+  __pyx_2 = PyMethod_New(__pyx_4, 0, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; goto __pyx_L1;}
+  Py_DECREF(__pyx_4); __pyx_4 = 0;
+  if (PyObject_SetAttr(__pyx_3, __pyx_n___str__, __pyx_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; goto __pyx_L1;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":12 */
+  __pyx_4 = PyCFunction_New(&__pyx_mdef_16DirectoryService_22DirectoryServicesError___repr__, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 12; goto __pyx_L1;}
+  __pyx_2 = PyMethod_New(__pyx_4, 0, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 12; goto __pyx_L1;}
+  Py_DECREF(__pyx_4); __pyx_4 = 0;
+  if (PyObject_SetAttr(__pyx_3, __pyx_n___repr__, __pyx_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 12; goto __pyx_L1;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_DirectoryServicesError, __pyx_3) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; goto __pyx_L1;}
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+
+  /* "/Users/dreid/projects/PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx":83 */
+  return;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  Py_XDECREF(__pyx_4);
+  __Pyx_AddTraceback("DirectoryService");
+}
+
+static char *__pyx_filenames[] = {
+  "DirectoryNode.pyx",
+  "DirectoryRecord.pyx",
+  "DirectoryService.pyx",
+};
+
+/* Runtime support code */
+
+static void __pyx_init_filenames(void) {
+  __pyx_f = __pyx_filenames;
+}
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
+    PyObject *__import__ = 0;
+    PyObject *empty_list = 0;
+    PyObject *module = 0;
+    PyObject *global_dict = 0;
+    PyObject *empty_dict = 0;
+    PyObject *list;
+    __import__ = PyObject_GetAttrString(__pyx_b, "__import__");
+    if (!__import__)
+        goto bad;
+    if (from_list)
+        list = from_list;
+    else {
+        empty_list = PyList_New(0);
+        if (!empty_list)
+            goto bad;
+        list = empty_list;
+    }
+    global_dict = PyModule_GetDict(__pyx_m);
+    if (!global_dict)
+        goto bad;
+    empty_dict = PyDict_New();
+    if (!empty_dict)
+        goto bad;
+    module = PyObject_CallFunction(__import__, "OOOO",
+        name, global_dict, empty_dict, list);
+bad:
+    Py_XDECREF(empty_list);
+    Py_XDECREF(__import__);
+    Py_XDECREF(empty_dict);
+    return module;
+}
+
+static PyObject *__Pyx_CreateClass(
+    PyObject *bases, PyObject *dict, PyObject *name, char *modname)
+{
+    PyObject *py_modname;
+    PyObject *result = 0;
+    
+    py_modname = PyString_FromString(modname);
+    if (!py_modname)
+        goto bad;
+    if (PyDict_SetItemString(dict, "__module__", py_modname) < 0)
+        goto bad;
+    result = PyClass_New(bases, dict, name);
+bad:
+    Py_XDECREF(py_modname);
+    return result;
+}
+
+static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
+    PyObject *result;
+    result = PyObject_GetAttr(dict, name);
+    if (!result)
+        PyErr_SetObject(PyExc_NameError, name);
+    return result;
+}
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
+    Py_XINCREF(type);
+    Py_XINCREF(value);
+    Py_XINCREF(tb);
+    /* First, check the traceback argument, replacing None with NULL. */
+    if (tb == Py_None) {
+        Py_DECREF(tb);
+        tb = 0;
+    }
+    else if (tb != NULL && !PyTraceBack_Check(tb)) {
+        PyErr_SetString(PyExc_TypeError,
+            "raise: arg 3 must be a traceback or None");
+        goto raise_error;
+    }
+    /* Next, replace a missing value with None */
+    if (value == NULL) {
+        value = Py_None;
+        Py_INCREF(value);
+    }
+    /* Next, repeatedly, replace a tuple exception with its first item */
+    while (PyTuple_Check(type) && PyTuple_Size(type) > 0) {
+        PyObject *tmp = type;
+        type = PyTuple_GET_ITEM(type, 0);
+        Py_INCREF(type);
+        Py_DECREF(tmp);
+    }
+    if (PyString_Check(type))
+        ;
+    else if (PyClass_Check(type))
+        ; /*PyErr_NormalizeException(&type, &value, &tb);*/
+    else if (PyInstance_Check(type)) {
+        /* Raising an instance.  The value should be a dummy. */
+        if (value != Py_None) {
+            PyErr_SetString(PyExc_TypeError,
+              "instance exception may not have a separate value");
+            goto raise_error;
+        }
+        else {
+            /* Normalize to raise <class>, <instance> */
+            Py_DECREF(value);
+            value = type;
+            type = (PyObject*) ((PyInstanceObject*)type)->in_class;
+            Py_INCREF(type);
+        }
+    }
+    else {
+        /* Not something you can raise.  You get an exception
+           anyway, just not what you specified :-) */
+        PyErr_Format(PyExc_TypeError,
+                 "exceptions must be strings, classes, or "
+                 "instances, not %s", type->ob_type->tp_name);
+        goto raise_error;
+    }
+    PyErr_Restore(type, value, tb);
+    return;
+raise_error:
+    Py_XDECREF(value);
+    Py_XDECREF(type);
+    Py_XDECREF(tb);
+    return;
+}
+
+static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {
+    while (t->p) {
+        *t->p = PyString_InternFromString(t->s);
+        if (!*t->p)
+            return -1;
+        ++t;
+    }
+    return 0;
+}
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+    while (t->p) {
+        *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
+        if (!*t->p)
+            return -1;
+        ++t;
+    }
+    return 0;
+}
+
+#include "compile.h"
+#include "frameobject.h"
+#include "traceback.h"
+
+static void __Pyx_AddTraceback(char *funcname) {
+    PyObject *py_srcfile = 0;
+    PyObject *py_funcname = 0;
+    PyObject *py_globals = 0;
+    PyObject *empty_tuple = 0;
+    PyObject *empty_string = 0;
+    PyCodeObject *py_code = 0;
+    PyFrameObject *py_frame = 0;
+    
+    py_srcfile = PyString_FromString(__pyx_filename);
+    if (!py_srcfile) goto bad;
+    py_funcname = PyString_FromString(funcname);
+    if (!py_funcname) goto bad;
+    py_globals = PyModule_GetDict(__pyx_m);
+    if (!py_globals) goto bad;
+    empty_tuple = PyTuple_New(0);
+    if (!empty_tuple) goto bad;
+    empty_string = PyString_FromString("");
+    if (!empty_string) goto bad;
+    py_code = PyCode_New(
+        0,            /*int argcount,*/
+        0,            /*int nlocals,*/
+        0,            /*int stacksize,*/
+        0,            /*int flags,*/
+        empty_string, /*PyObject *code,*/
+        empty_tuple,  /*PyObject *consts,*/
+        empty_tuple,  /*PyObject *names,*/
+        empty_tuple,  /*PyObject *varnames,*/
+        empty_tuple,  /*PyObject *freevars,*/
+        empty_tuple,  /*PyObject *cellvars,*/
+        py_srcfile,   /*PyObject *filename,*/
+        py_funcname,  /*PyObject *name,*/
+        __pyx_lineno,   /*int firstlineno,*/
+        empty_string  /*PyObject *lnotab*/
+    );
+    if (!py_code) goto bad;
+    py_frame = PyFrame_New(
+        PyThreadState_Get(), /*PyThreadState *tstate,*/
+        py_code,             /*PyCodeObject *code,*/
+        py_globals,          /*PyObject *globals,*/
+        0                    /*PyObject *locals*/
+    );
+    if (!py_frame) goto bad;
+    py_frame->f_lineno = __pyx_lineno;
+    PyTraceBack_Here(py_frame);
+bad:
+    Py_XDECREF(py_srcfile);
+    Py_XDECREF(py_funcname);
+    Py_XDECREF(empty_tuple);
+    Py_XDECREF(empty_string);
+    Py_XDECREF(py_code);
+    Py_XDECREF(py_frame);
+}

Added: PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx
===================================================================
--- PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx	                        (rev 0)
+++ PyOpenDirectory/branches/generalized-api-56/DirectoryServices/DirectoryService.pyx	2006-09-20 23:57:18 UTC (rev 165)
@@ -0,0 +1,110 @@
+##
+# Copyright (c) 2006 Apple Computer, Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+##
+
+include "dsHeader.pyx"
+include "DirectoryNode.pyx"
+include "DirectoryRecord.pyx"
+
+class DirectoryServicesError(Exception):
+    def __init__(self, errno):
+        self.errno = errno
+
+    def __str__(self):
+        return "<DirectoryServicesError: %d>" % (self.errno,)
+
+    def __repr__(self):
+        return self.__str__()
+
+
+cdef raiseIfNull(void *ptr):
+    if ptr == NULL:
+        raise ValueError("Null pointer")
+
+
+def raiseOnError(dirStatus):
+    if dirStatus != eDSNoErr:
+        raise DirectoryServicesError(dirStatus)
+
+        
+cdef class DirectoryService:
+    cdef tDirReference gDirRef
+
+    def __new__(self):
+        raiseOnError(dsOpenDirService(&self.gDirRef))
+
+    def __dealloc__(self):
+        raiseOnError(dsCloseDirService(self.gDirRef))
+
+    def getNodeCount(self):
+        cdef unsigned long nodeCount
+        nodeCount = 0
+
+        raiseOnError(dsGetDirNodeCount(self.gDirRef, &nodeCount))
+
+        return nodeCount
+
+    def getNodeList(self):
+        cdef tDataBufferPtr dataBuffer
+        cdef unsigned long bufferCount
+        cdef tContextData context
+        cdef tDataListPtr nodeName
+        cdef unsigned long index
+
+        done = False
+
+        dataBuffer = dsDataBufferAllocate(self.gDirRef, 32 * 1024)
+
+        nodes = []
+        try:
+            if dataBuffer != NULL:
+                while done == False:
+                    raiseOnError(
+                        dsGetDirNodeList(self.gDirRef, dataBuffer, 
+                                         &bufferCount, &context))
+
+                    for index from 1 <= index < bufferCount:
+                        raiseOnError(
+                            dsGetDirNodeName(self.gDirRef,
+                                             dataBuffer,
+                                             index,
+                                             &nodeName))
+
+                        nodes.append(nodeFromName(self.gDirRef, nodeName))
+                        
+                    done = (context == NULL)
+        finally:
+            if context != NULL:
+                raiseOnError(
+                    dsReleaseContinueData(self.gDirRef, context))
+
+            raiseOnError(dsDataBufferDeAllocate(self.gDirRef, dataBuffer))
+
+            dataBuffer = NULL
+
+        return nodes
+
+    def getNode(object self, char * nodePath):
+        cdef tDataListPtr nodeName
+
+        nodeName = dsDataListAllocate(self.gDirRef)
+        raiseOnError(dsBuildListFromPathAlloc(self.gDirRef,
+                                              nodeName,
+                                              <char *>nodePath,
+                                              <char *>"/"))
+
+        return nodeFromName(self.gDirRef, nodeName)
+

Added: PyOpenDirectory/branches/generalized-api-56/DirectoryServices/__init__.py
===================================================================
--- PyOpenDirectory/branches/generalized-api-56/DirectoryServices/__init__.py	                        (rev 0)
+++ PyOpenDirectory/branches/generalized-api-56/DirectoryServices/__init__.py	2006-09-20 23:57:18 UTC (rev 165)
@@ -0,0 +1,2 @@
+from DirectoryService import *
+from Constants import *

Added: PyOpenDirectory/branches/generalized-api-56/DirectoryServices/dsHeader.pyx
===================================================================
--- PyOpenDirectory/branches/generalized-api-56/DirectoryServices/dsHeader.pyx	                        (rev 0)
+++ PyOpenDirectory/branches/generalized-api-56/DirectoryServices/dsHeader.pyx	2006-09-20 23:57:18 UTC (rev 165)
@@ -0,0 +1,142 @@
+##
+# Copyright (c) 2006 Apple Computer, Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+##
+
+cdef extern from "sys/types.h": # 
+    int kill(int i, int i)      #
+                                #  For debugging only
+cdef extern from "stdio.h":     #
+    int printf(char *foo)       #
+
+cdef extern from "DirectoryService/DirectoryService.h":    
+    ctypedef enum tDirStatus:
+        eDSNoErr = 0
+        eDSNodeNotFound = -14008
+        eDSRecordNotFound = -14136
+        eDSBadDataNodeLength = -14255
+        
+    ctypedef enum tDirPatternMatch:
+        eDSExact = 0x2001
+
+    ctypedef unsigned long tDirReference
+    ctypedef unsigned long tDirNodeReference
+    ctypedef unsigned long tRecordReference
+    ctypedef unsigned long tAttributeListRef
+    ctypedef unsigned long dsBool
+    
+    ctypedef void * tClientData
+    ctypedef void * tBuffer
+    ctypedef void * tContextData
+    ctypedef void * tDataBufferPtr
+    ctypedef void * tDataListPtr    
+    ctypedef void * tDataNodePtr
+    ctypedef void * tRecordEntryPtr
+    ctypedef void * tRecordEntry
+
+    ctypedef struct tDataList:
+        unsigned long fDataNodeCount
+        tDataNodePtr fDataListHead
+
+    tDirStatus dsOpenDirService(tDirReference *outDirReference)
+
+    tDirStatus dsCloseDirService(tDirReference inDirReference)
+
+    tDirStatus dsGetDirNodeCount(tDirReference inDirReference,
+                                 unsigned long *outNodeCount)
+
+    tDirStatus dsGetDirNodeName(tDirReference inDirReference,
+                                tDataBufferPtr inOutDataBufferPtr,
+                                unsigned long inDirNodeIndex,
+                                tDataListPtr *inOutDataList)
+
+    tDirStatus dsGetDirNodeList(tDirReference inDirReference,
+                                tDataBufferPtr inOutDataBufferPtr,
+                                unsigned long *outDirNodeCount,
+                                tContextData *inOutCountinueData)
+
+    tDataBufferPtr dsDataBufferAllocate(tDirReference inDirReference,
+                                        unsigned long inBufferSize)
+
+    char *dsGetPathFromList(tDirReference inDirReference,
+                                 tDataListPtr *inDataList,
+                                 char *inDelimiter)
+
+    tDirStatus dsDataBufferDeAllocate(tDirReference inDirReference,
+                                      tDataBufferPtr inDataBufferPtr)
+
+    tDirStatus dsReleaseContinueData(tDirReference inDirReference,
+                                     tContextData inContinueData)
+
+    tDataListPtr dsDataListAllocate(tDirReference inDirReference)
+
+    tDirStatus dsDataListDeallocate(tDirReference inDirReference,
+                                    tDataListPtr inDataList)
+
+    tDirStatus dsBuildListFromPathAlloc(tDirReference inDirReference,
+                                        tDataListPtr inDataList,
+                                        char *inPathCString,
+                                        char *inPathSeparatorCString)
+
+    tDirStatus dsOpenDirNode(tDirReference inDirReference,
+                             tDataListPtr inDataList,
+                             tDirNodeReference *outDirNodeReference)
+
+    tDirStatus dsCloseDirNode(tDirNodeReference inDirNodeReference)
+
+    tDirStatus dsOpenRecord(tDirNodeReference inDirNodeReference,
+                            tDataNodePtr inRecordType,
+                            tDataNodePtr inRecordName,
+                            tRecordReference *outRecordReference)
+
+    tDirStatus dsCloseRecord(tRecordReference inRecordReference)
+
+    tDataNodePtr dsDataNodeAllocateString(tDirReference inDirReference,
+                                        char *inCString)
+
+    tDirStatus dsDataNodeDeAllocate(tDirReference inDirReference,
+                                    tDataNodePtr inDataNodePtr)
+    
+    tDirStatus dsAppendStringToListAlloc(tDirReference inDirReference,
+                                         tDataListPtr inDataList,
+                                         char *inCString)
+
+    tDirStatus dsGetRecordList(tDirNodeReference inDirNodeReference,
+                               tDataBufferPtr inOutDataBuffer,
+                               tDataListPtr inRecordNameList,
+                               tDirPatternMatch inPatternMatchType,
+                               tDataListPtr inRecordTypeList,
+                               tDataListPtr inAttributeTypeList,
+                               dsBool inAttributeInfoOnly,
+                               unsigned long *inOutRecordEntryCount,
+                               tContextData *inOutContinueData)
+
+    tDirStatus dsGetRecordEntry(tDirNodeReference inDirNodeReference,
+                                tDataBufferPtr inOutDataBuffer,
+                                unsigned long inRecordEntryIndex,
+                                tAttributeListRef *outAttributeListRef,
+                                tRecordEntryPtr *outRecordEntryPtr)
+
+    tDirStatus dsCloseAttributeList(tAttributeListRef inAttributeListRef)
+    
+    tDirStatus dsDeallocRecordEntry(tDirReference inDirRef, 
+                                    tRecordEntryPtr inRecEntry)
+    
+    tDirStatus dsDataListGetNodeAlloc(tDirReference inDirReference,
+                                      tDataList *inDataListPtr,
+                                      unsigned long inNodeIndex,
+                                      tDataNodePtr *outDataNode)
+                                      
+    unsigned long dsDataListGetNodeCount(tDataListPtr inDataListPtr)

Added: PyOpenDirectory/branches/generalized-api-56/pyxtest.py
===================================================================
--- PyOpenDirectory/branches/generalized-api-56/pyxtest.py	                        (rev 0)
+++ PyOpenDirectory/branches/generalized-api-56/pyxtest.py	2006-09-20 23:57:18 UTC (rev 165)
@@ -0,0 +1,42 @@
+#!/usr/bin/env python
+import sys
+sys.path.insert(0, 'build/lib.macosx-10.4-fat-2.4/')
+
+from DirectoryServices import DirectoryService
+from DirectoryServices import kDSRecordsAll
+
+def listNodes(ds):
+    i = 1
+    for node in ds.getNodeList():
+        print "%d: %r" % (i, node)
+        i += 1
+
+def openNode(ds, path):
+    print "Getting node: %s" % (path,)
+    node = ds.getNode(path)
+    print "Got node: %s" % (node,)
+    print "Opening node."
+    node.open()
+    print "Listing records."
+    listRecords(node)
+    print "Closing node."
+    node.close()
+
+def listRecords(node):
+    recList = node.listRecords()
+
+    for x in recList:
+        print x
+
+
+if __name__ == '__main__':
+    ds = DirectoryService()
+    listNodes(ds)
+
+    openNode(ds, '/LDAPv3/webboserver.apple.com')
+
+#     openNode(ds, '/LDAPv3/od.apple.com')
+    
+#     openNode(ds, '/Search')
+    
+#     #openNode(ds, '/BSD/local')

Modified: PyOpenDirectory/branches/generalized-api-56/setup.py
===================================================================
--- PyOpenDirectory/branches/generalized-api-56/setup.py	2006-09-20 19:22:54 UTC (rev 164)
+++ PyOpenDirectory/branches/generalized-api-56/setup.py	2006-09-20 23:57:18 UTC (rev 165)
@@ -18,7 +18,7 @@
 
 from distutils.core import setup, Extension
 import sys
-
+                  
 if sys.platform in ["darwin", "macosx"]: 
 
     """
@@ -26,32 +26,43 @@
     DirectoryService.framework.
     """
 
-    module1 = Extension(
-        'opendirectory',
-        extra_link_args = ['-framework', 'DirectoryService', "-framework", "CoreFoundation"],
-        sources = ['src/PythonWrapper.cpp', 'src/CDirectoryService.cpp', 'src/CFStringUtil.cpp'],
-    )
-    
+    try:
+        from Pyrex.Distutils import build_ext
+        DSModule = Extension("DirectoryServices/DirectoryService",
+                             ["DirectoryServices/DirectoryService.pyx"],
+                             extra_link_args = ['-framework', 
+                                                'DirectoryService'])
+
+        cmdClass = {'build_ext': build_ext}
+        
+    except ImportError:
+        DSModule = Extension("DirectoryServices/DirectoryService",
+                             extra_link_args = ['-framework', 
+                                                'DirectoryService'],
+                             sources = ["DirectoryServices/DirectoryService.c"])
+
+        cmdClass = {}
+
     setup (
-        name = 'opendirectory',
-        version = '1.0',
-        description = 'This is a high-level interface to Open Directory for operations specific to a CalDAV server.',
-        ext_modules = [module1],
-        package_dir={'': 'pysrc'},
-        py_modules = ['dsattributes']
+        name = 'DirectoryServices',
+        version = '2.0',
+        description = 'This is a high-level interface to Directory Services',
+        ext_modules = [DSModule],
+        packages = ["DirectoryServices"],
+        cmdclass = cmdClass
     )
 
-else:
-    """
-    On other OS's we simply include a stub file of prototypes.
-    Eventually we should build the proper module and link
-    with appropriate local ldap etc libraries.
-    """
+# else:
+#     """
+#     On other OS's we simply include a stub file of prototypes.
+#     Eventually we should build the proper module and link
+#     with appropriate local ldap etc libraries.
+#     """
 
-    setup (
-        name = 'opendirectory',
-        version = '1.0',
-        description = 'This is a high-level interface to the Kerberos.framework',
-        package_dir={'': 'pysrc'},
-        packages=['']
-    )
+#     setup (
+#         name = 'opendirectory',
+#         version = '1.0',
+#         description = 'This is a high-level interface to the Kerberos.framework',
+#         package_dir={'': 'pysrc'},
+#         packages=['']
+#     )

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20060920/d0e450d2/attachment.html


More information about the calendarserver-changes mailing list