[haiku-development] Re: RFC: find_directory() API extension

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 03 Nov 2013 19:07:48 +0100

On 11/03/2013 06:24 PM, Adrien Destugues wrote:
On 2013-11-01 at 03:00:45 [+0100], Ingo Weinhold <ingo_weinhold@xxxxxx>
wrote:
codePointer refers to an address in the caller's code, thus identifying
the executable, library, or add-on for which the call is performed. If
NULL is passed, the executable is implied. Based off its installation
location baseDirectory is applied and subPath appended.

The Locale kit uses liblocalestub.a for similar purposes, avoiding
exposition of this implementation detail in the API. I'd do something
similar to keep the API simpler and clearer, possibly with a way to get
either the "main" (application) dirs or the ones for the caller add-on or
lib, but not more.

It wouldn't exactly simplify the API. One would either still need a parameter to discriminate between the cases or a second function.

Furthermore, doing that would require any API on top of find_path() (including the proposed BPathFinder) to live in a static library. Not very elegant IMO.

Allowing to specify any symbol directly opens
cross-add-ons possibilities that may get out of control.

What possible dangers do you expect? FWIW BResources::SetToImage() uses the same interface and so far I'm not aware of anything that has gotten out of control because of it.

CU, Ingo


Other related posts: