• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Methods calling C functions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Methods calling C functions


  • Subject: Re: Methods calling C functions
  • From: Ondra Cada <email@hidden>
  • Date: Mon, 20 Jun 2005 20:17:58 +0200

Lee,

On Jun 20, 2005, at 5:44 AM, Lee Morgan wrote:

I know C can be mixed with Obj-C easily.
However I have a few connivence functions that I keep in a .c file that I would like to expose to my entire project (like NSLog is).


I was told that I have to expose the functions using Obj-C mangling however I can't seem to find any information on how to do this.
Does anyone know of a easy way to do this, or can point me to some docs that explain how?

Don't trust the one who told you so :)

There is no ObjC name-mangling at all (luckily!). Just do it, and it would work all right. A function in .m is completely equivalent a function in .c. Just ensure the functions are exported (in both .c and .m it means "are not declared static") and that the module with the definitions gets linked in (sufficient dynamically), and it Just Works.
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc



_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Methods calling C functions (From: Lee Morgan <email@hidden>)

  • Prev by Date: Re: Outline and Table back to front
  • Next by Date: Re: Outline and Table back to front
  • Previous by thread: Re: Methods calling C functions
  • Next by thread: Problem with very large scrolled NSViews
  • Index(es):
    • Date
    • Thread