• 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: Dylib and parent application symbol access
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dylib and parent application symbol access


  • Subject: Re: Dylib and parent application symbol access
  • From: mark <email@hidden>
  • Date: Wed, 11 Jan 2012 08:34:14 +1300

On 01/10/2012 03:08 AM, Robert Bielik wrote:
mark skrev 2012-01-10 10:03:
Exactly, how come you need to have it depend on the application ? The
normal thing to do when designing plugin systems is to have a defined
API which the APP knows about and the plugin implements, i.e. there
should be no dependency towards the APP.

The parent APP has exported functions in the form of RegisterFunction, RegisterFilter, ... . I found it easier for the lib to register what functionality it has this way as oppsed to the APP querying what functions it has.
Then you would do something like:
1. When initializing your plugin (or others), pass with it an instance
of an API that has the RegisterFunction etc. methods.
2. In the initialize method of the plugin, the plugin "calls back" to
that API which is implemented in the APP.

This way you still have no explicit dependency towards the APP.

Other alternatives:

1) Link your plugin with -undefined dynamic_lookup (see ld man page).
2) Have a weak implementation of RegisterFunction, RegisterFilter etc. in the plugin. This implementation doesn't need to do anything, a strong symbol in the application will be used in preference to it.


Peter

Ok. Thanks for all the input. _______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Dylib and parent application symbol access (From: mark <email@hidden>)
 >Re: Dylib and parent application symbol access (From: Wade Tregaskis <email@hidden>)
 >Re: Dylib and parent application symbol access (From: mark <email@hidden>)
 >Re: Dylib and parent application symbol access (From: Wade Tregaskis <email@hidden>)
 >Re: Dylib and parent application symbol access (From: Robert Bielik <email@hidden>)
 >Re: Dylib and parent application symbol access (From: mark <email@hidden>)
 >Re: Dylib and parent application symbol access (From: Robert Bielik <email@hidden>)
 >Re: Dylib and parent application symbol access (From: Peter O'Gorman <email@hidden>)

  • Prev by Date: Re: iOS bundle resources synchronization issues with successive debug sessions in Xcode 4
  • Next by Date: Possible to set the armv7 chip into using unaligned memory accesses?
  • Previous by thread: Re: Dylib and parent application symbol access
  • Next by thread: iOS bundle resources synchronization issues with successive debug sessions in Xcode 4
  • Index(es):
    • Date
    • Thread