<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">My problem did not involve Objective-C, just C API's, CoreFoundation and Security were involved. I took only what I needed.<div><br></div><div>Your Carbon interface is welcome - I would like to learn more about topic, as I never know when I will need it. I like to be prepared! :)</div><div><br></div><div>Thanks in advance,</div><div>dd</div><div><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>--</div><div>Divided by a common language</div><div><br></div><div>Dragiša Durić</div><div><a href="mailto:dragisha@m3w.org">dragisha@m3w.org</a></div><div><br></div></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline">
</div>
<br><div><div>On Mar 17, 2013, at 4:05 PM, Darko wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>But what about creating objects and calling methods, or whatever they're called in Objective-C?</div><div><br></div><div>Also be aware if you want to use any structures from the older interfaces and Carbon they have byte alignment and must be declared specially. I have an interface file for most Carbon  stuff, but it's a bit large at 3.2MB (~500KB compressed). I can mail it if you need it.</div><div><br></div><br><div><div>On Mar 17, 2013, at 7:12 AM, Dragiša Durić wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">After a hint from Anthony, and a share of mining, mostly due to being first-time OSX Doc Miner :), here comes result. Example code:<div><br></div><div>== CoureFoundation.i3 ==</div><div><div>INTERFACE CoreFoundation;</div><div><br></div><div>IMPORT Ctypes;</div><div><br></div><div>TYPE</div><div>  TypeRef = ADDRESS;</div><div>  DataRef = ADDRESS;</div><div>  AllocatorRef = ADDRESS;</div><div>  Index = Ctypes.long_int;</div><div><br></div><div><* EXTERNAL CFRelease *></div><div>PROCEDURE Release(cf: TypeRef);</div><div>  </div><div><* EXTERNAL CFDataCreate *></div><div>PROCEDURE DataCreate(allocator: AllocatorRef; bytes: Ctypes.void_star; length: Index): DataRef;</div><div><br></div><div>(* Not exactly CF, but I can split later, if need be to grow this</div><div>*)</div><div><br></div><div>END CoreFoundation.</div></div><div>== m3makefile ==</div><div>…</div><div><div>proc use_framework(FW) is</div><div>  configure_c_compiler()</div><div>  SYSTEM_CC = SYSTEM_CC & " -framework " & FW</div><div>end</div><div><br></div><div>if equal(TARGET, "AMD64_DARWIN")</div><div>  use_framework("CoreFoundation")</div><div>  use_framework("Security")</div></div><div>...</div><div>===</div><div><br></div><div>I named things like this so I can "IMPORT CoreFoundation AS CF" later and use names like CF.Release().</div><div><br></div><div>Hope it saves few hours to somebody else :).<br><div apple-content-edited="true">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>--</div><div>Divided by a common language</div><div><br></div><div>Dragiša Durić</div><div><a href="mailto:dragisha@m3w.org">dragisha@m3w.org</a></div><div><br></div></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<br><div><div>On Mar 17, 2013, at 3:37 AM, Antony Hosking wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=utf-8"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Should be simple addresses.<div><br>
<br><div><div>On Mar 16, 2013, at 6:34 PM, Dragiša Durić <<a href="mailto:dragisha@m3w.org">dragisha@m3w.org</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">To resolve an issue with a project, I need to wrap few functions from Security framework on OSX Lion. I have no experience on this level with OSX programming.<div><br></div><div>I did a lot of such work on Linux and Windows, and all I needed there is to match signatures of functions, structure of types, and refer m3makefile to right libraries. Also, I did similar work for various non-framework libraries on OSX, and it is Unix all the way.</div><div><br></div><div>Anyone with CF/framework related experience? Do I need some special voodoo for handling various CF opaque objects or they are simple addresses?</div><div><br></div><div>TIA,</div><div>dd</div><div><br><div apple-content-edited="true">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>--</div><div>Divided by a common language</div><div><br></div><div>Dragiša Durić</div><div><a href="mailto:dragisha@m3w.org">dragisha@m3w.org</a></div><div><br></div></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<br></div></div></blockquote></div><br></div></div></blockquote></div><br></div></div></blockquote></div><br></div></blockquote></div><br></div></body></html>