/usr/include 中的所有标头是否都被视为 MAS 上的公共 API?

发布于 2024-11-16 10:33:32 字数 182 浏览 5 评论 0原文

当涉及到 Mac App Store 提交时,/usr/include 中的所有标头是否都保证被视为公共 API 的一部分?

例如,考虑文件 /usr/include/copyfile.h

该文件中的注释是这样说的:“此实现不完整,接口可能会在将来的版本中更改。”这是否会使标头变得非公开?如何确定标头是否被视为公开?

Are all headers in /usr/include guaranteed to be considered part of the Public APIs when it comes to Mac App Store submissions?

Consider for example the file /usr/include/copyfile.h

The comments in this file say this: "This implementation is incomplete and the interface may change in a future release." Does this render the header non-public? How do I determine if a header is considered public?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

爱殇璃 2024-11-23 10:33:32

如果有记录的话,它就是公开的。您的系统上有很多引用私有 API 的 .h 文件。这不是您知道它是否在商店安全的方法。它是存储安全的,它记录在框架文档中。

It's public if it's documented. You've got LOTS of .h files on your system that refer to private APIs. That's not how you know whether it's store-safe. It's store-safe it it's documented in the framework documentation.

﹏半生如梦愿梦如真 2024-11-23 10:33:32

阅读此内容的底部部分文档页面。

摘抄:

Mac OS X 在 /usr/lib 目录及其子目录中包含许多动态库。动态共享库由其 .dylib 扩展名标识。库的头文件位于 /usr/include 中。

这里似乎暗示 OS X 中包含的 .dylib 库非常适合在您的应用程序中使用,但您需要注意它们并不保证具有特定版本的例如 Lion 上的库,因此您应该包含最通用的版本。

正如@Dan 所说,另一个让你知道库可以使用的事情是它是否有联机帮助页。 copyfile 有一个男人页面,所以使用起来很好(因为他们向您展示了如何使用它!)。为了让事情变得更加模糊,请查看 getattrlist 手册页,然后搜索“copyfile”。您可以读取的卷功能标志之一表示支持第二个 copyfile() API。因此,在本例中,有 2 个 copyfile() API,并且您只能使用带有联机帮助页的一个 API,因为另一个在此被标记为私有且未记录。

任何未包含在 Framework 文件夹中且与 .dylib 或联机帮助页不匹配的标头,我通常会避免使用。

Read the bottom section of this documentation page.

Excerpt:

Mac OS X includes many dynamic libraries in the /usr/lib directory and its subdirectories. Dynamic shared libraries are identified by their .dylib extension. Header files for the libraries are located in /usr/include.

It seems like the implication here is that the .dylib libraries included with OS X are fair game for use in your application, but you need to be aware that they don't guarantee to have a particular version of the lib on e.g. Lion, so you should include the most generic version you can.

As @Dan said, the other thing which would tip you off to a library being OK to use would be if it has a manpage. copyfile has a man page, so it's fine to use (since they're showing you how to use it!). To make things even fuzzier, check out the getattrlist man page, and search for 'copyfile'. One of the flags you can read for volume capabilities indicates support for a second copyfile() API. So in this case there are 2 copyfile() APIs and you're only allowed to use the one with a manpage, as the other one is marked here as being private and undocumented.

Any headers not contained in a Framework folder and not matched with a .dylib or a manpage, I would generally avoid using.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文