PR_GetUniqueIdentity 编辑
Asks the runtime to allocate a unique identity for a layer identified by the layer's name.
Syntax
#include <prio.h> /wiki/en-US/docs/Mozilla/Projects/NSPR/Reference/PRDescIdentity PR_GetUniqueIdentity(const char *layer_name);
Parameter
The function has the following parameter:
layer_name
- The string associated with the creation of a layer's identity.
Returns
The function returns one of the following values:
- If successful, the
/wiki/en-US/docs/Mozilla/Projects/NSPR/Reference/PRDescIdentity
for the layer associated with the string specified in the layer namedlayer_name
. - If the function cannot allocate enough dynamic memory, it fails and returns the value
PR_INVALID_IO_LAYER
with the error codePR_OUT_OF_MEMORY_ERROR
.
Description
A string may be associated with a layer when the layer is created. PR_GetUniqueIdentity
allocates a unique layer identity and associates it with the string. The string can be subsequently passed to /wiki/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_CreateIOLayerStub
to create a new file descriptor of that layer.
Call PR_GetUniqueIdentity
only once for any particular layer name. If you're creating a custom I/O layer, cache the result, and then use that cached result every time you call /wiki/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_CreateIOLayerStub
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论