Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Functions | Variables
prlayer.c File Reference
#include "primpl.h"
#include "prerror.h"
#include "prmem.h"
#include "prlock.h"
#include "prlog.h"
#include "prio.h"
#include <string.h>

Go to the source code of this file.

Classes

struct  _PRIdentity_cache

Defines

#define ID_CACHE_INCREMENT   16

Typedefs

typedef struct _PRIdentity_cache _PRIdentity_cache

Functions

static PRStatus _PR_DestroyIOLayer (PRFileDesc *stack)
void PR_CALLBACK pl_FDDestructor (PRFileDesc *fd)
static PRStatus PR_CALLBACK pl_TopClose (PRFileDesc *fd)
static PRInt32 PR_CALLBACK pl_DefRead (PRFileDesc *fd, void *buf, PRInt32 amount)
static PRInt32 PR_CALLBACK pl_DefWrite (PRFileDesc *fd, const void *buf, PRInt32 amount)
static PRInt32 PR_CALLBACK pl_DefAvailable (PRFileDesc *fd)
static PRInt64 PR_CALLBACK pl_DefAvailable64 (PRFileDesc *fd)
static PRStatus PR_CALLBACK pl_DefFsync (PRFileDesc *fd)
static PRInt32 PR_CALLBACK pl_DefSeek (PRFileDesc *fd, PRInt32 offset, PRSeekWhence how)
static PRInt64 PR_CALLBACK pl_DefSeek64 (PRFileDesc *fd, PRInt64 offset, PRSeekWhence how)
static PRStatus PR_CALLBACK pl_DefFileInfo (PRFileDesc *fd, PRFileInfo *info)
static PRStatus PR_CALLBACK pl_DefFileInfo64 (PRFileDesc *fd, PRFileInfo64 *info)
static PRInt32 PR_CALLBACK pl_DefWritev (PRFileDesc *fd, const PRIOVec *iov, PRInt32 size, PRIntervalTime timeout)
static PRStatus PR_CALLBACK pl_DefConnect (PRFileDesc *fd, const PRNetAddr *addr, PRIntervalTime timeout)
static PRStatus PR_CALLBACK pl_DefConnectcontinue (PRFileDesc *fd, PRInt16 out_flags)
static PRFileDesc *PR_CALLBACK pl_TopAccept (PRFileDesc *fd, PRNetAddr *addr, PRIntervalTime timeout)
static PRStatus PR_CALLBACK pl_DefBind (PRFileDesc *fd, const PRNetAddr *addr)
static PRStatus PR_CALLBACK pl_DefListen (PRFileDesc *fd, PRIntn backlog)
static PRStatus PR_CALLBACK pl_DefShutdown (PRFileDesc *fd, PRIntn how)
static PRInt32 PR_CALLBACK pl_DefRecv (PRFileDesc *fd, void *buf, PRInt32 amount, PRIntn flags, PRIntervalTime timeout)
static PRInt32 PR_CALLBACK pl_DefSend (PRFileDesc *fd, const void *buf, PRInt32 amount, PRIntn flags, PRIntervalTime timeout)
static PRInt32 PR_CALLBACK pl_DefRecvfrom (PRFileDesc *fd, void *buf, PRInt32 amount, PRIntn flags, PRNetAddr *addr, PRIntervalTime timeout)
static PRInt32 PR_CALLBACK pl_DefSendto (PRFileDesc *fd, const void *buf, PRInt32 amount, PRIntn flags, const PRNetAddr *addr, PRIntervalTime timeout)
static PRInt16 PR_CALLBACK pl_DefPoll (PRFileDesc *fd, PRInt16 in_flags, PRInt16 *out_flags)
static PRInt32 PR_CALLBACK pl_DefAcceptread (PRFileDesc *sd, PRFileDesc **nd, PRNetAddr **raddr, void *buf, PRInt32 amount, PRIntervalTime t)
static PRInt32 PR_CALLBACK pl_DefTransmitfile (PRFileDesc *sd, PRFileDesc *fd, const void *headers, PRInt32 hlen, PRTransmitFileFlags flags, PRIntervalTime t)
static PRStatus PR_CALLBACK pl_DefGetsockname (PRFileDesc *fd, PRNetAddr *addr)
static PRStatus PR_CALLBACK pl_DefGetpeername (PRFileDesc *fd, PRNetAddr *addr)
static PRStatus PR_CALLBACK pl_DefGetsocketoption (PRFileDesc *fd, PRSocketOptionData *data)
static PRStatus PR_CALLBACK pl_DefSetsocketoption (PRFileDesc *fd, const PRSocketOptionData *data)
static PRInt32 PR_CALLBACK pl_DefSendfile (PRFileDesc *sd, PRSendFileData *sfd, PRTransmitFileFlags flags, PRIntervalTime timeout)
 PR_IMPLEMENT (const PRIOMethods *)
 PR_IMPLEMENT (PRFileDesc *)
 PR_IMPLEMENT (PRStatus)
 PR_IMPLEMENT (PRDescIdentity)
 PR_IMPLEMENT (const char *)
void _PR_InitLayerCache (void)
void _PR_CleanupLayerCache (void)

Variables

static PRIOMethods pl_methods
static _PRIdentity_cache identity_cache

Class Documentation

struct _PRIdentity_cache

Definition at line 614 of file prlayer.c.

Collaboration diagram for _PRIdentity_cache:
Class Members
PRDescIdentity ident
PRIntn length
PRLock * ml
char ** name

Define Documentation

Definition at line 613 of file prlayer.c.


Typedef Documentation


Function Documentation

Definition at line 749 of file prlayer.c.

{
    if (identity_cache.ml)
    {
        PR_DestroyLock(identity_cache.ml);
        identity_cache.ml = NULL;
    }

    if (identity_cache.name)
    {
        PRDescIdentity ident;

        for (ident = 0; ident <= identity_cache.ident; ident++)
            PR_DELETE(identity_cache.name[ident]);

        PR_DELETE(identity_cache.name);
    }
}  /* _PR_CleanupLayerCache */

Here is the call graph for this function:

Here is the caller graph for this function:

static PRStatus _PR_DestroyIOLayer ( PRFileDesc stack) [static]

Definition at line 525 of file prlayer.c.

{
    if (NULL == stack)
        return PR_FAILURE;
    else {
        PR_DELETE(stack);
       return PR_SUCCESS;
    }
}  /* _PR_DestroyIOLayer */

Here is the caller graph for this function:

Definition at line 742 of file prlayer.c.

{
    memset(&identity_cache, 0, sizeof(identity_cache));
    identity_cache.ml = PR_NewLock();
    PR_ASSERT(NULL != identity_cache.ml);
}  /* _PR_InitLayerCache */

Here is the call graph for this function:

Here is the caller graph for this function:

static PRInt32 PR_CALLBACK pl_DefAcceptread ( PRFileDesc sd,
PRFileDesc **  nd,
PRNetAddr **  raddr,
void buf,
PRInt32  amount,
PRIntervalTime  t 
) [static]

Definition at line 324 of file prlayer.c.

{
    PRInt32 nbytes;
    PRStatus rv;
    PRFileDesc *newstack;
    PRFileDesc *layer = sd;
       PRBool newstyle_stack = PR_FALSE;

    PR_ASSERT(sd != NULL);
    PR_ASSERT(sd->lower != NULL);

       /* test for new style stack */
       while (NULL != layer->higher)
              layer = layer->higher;
       newstyle_stack = (PR_IO_LAYER_HEAD == layer->identity) ? PR_TRUE : PR_FALSE;
    newstack = PR_NEW(PRFileDesc);
    if (NULL == newstack)
    {
        PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
        return -1;
    }
    *newstack = *sd;  /* make a copy of the accepting layer */

    nbytes = sd->lower->methods->acceptread(
        sd->lower, nd, raddr, buf, amount, t);
    if (-1 == nbytes)
    {
        PR_DELETE(newstack);
        return nbytes;
    }
    if (newstyle_stack) {
              newstack->lower = *nd;
              (*nd)->higher = newstack;
              *nd = newstack;
              return nbytes;
       } else {
              /* this PR_PushIOLayer call cannot fail */
              rv = PR_PushIOLayer(*nd, PR_TOP_IO_LAYER, newstack);
              PR_ASSERT(PR_SUCCESS == rv);
              return nbytes;
       }
}
static PRInt32 PR_CALLBACK pl_DefAvailable ( PRFileDesc fd) [static]

Definition at line 121 of file prlayer.c.

{
    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);

    return (fd->lower->methods->available)(fd->lower);
}
static PRInt64 PR_CALLBACK pl_DefAvailable64 ( PRFileDesc fd) [static]

Definition at line 129 of file prlayer.c.

{
    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);

    return (fd->lower->methods->available64)(fd->lower);
}
static PRStatus PR_CALLBACK pl_DefBind ( PRFileDesc fd,
const PRNetAddr addr 
) [static]

Definition at line 248 of file prlayer.c.

{
    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);

    return (fd->lower->methods->bind)(fd->lower, addr);
}
static PRStatus PR_CALLBACK pl_DefConnect ( PRFileDesc fd,
const PRNetAddr addr,
PRIntervalTime  timeout 
) [static]

Definition at line 188 of file prlayer.c.

{
    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);

    return (fd->lower->methods->connect)(fd->lower, addr, timeout);
}
static PRStatus PR_CALLBACK pl_DefConnectcontinue ( PRFileDesc fd,
PRInt16  out_flags 
) [static]

Definition at line 197 of file prlayer.c.

{
    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);

    return (fd->lower->methods->connectcontinue)(fd->lower, out_flags);
}
static PRStatus PR_CALLBACK pl_DefFileInfo ( PRFileDesc fd,
PRFileInfo info 
) [static]

Definition at line 163 of file prlayer.c.

{
    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);

    return (fd->lower->methods->fileInfo)(fd->lower, info);
}
static PRStatus PR_CALLBACK pl_DefFileInfo64 ( PRFileDesc fd,
PRFileInfo64 info 
) [static]

Definition at line 171 of file prlayer.c.

{
    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);

    return (fd->lower->methods->fileInfo64)(fd->lower, info);
}
static PRStatus PR_CALLBACK pl_DefFsync ( PRFileDesc fd) [static]

Definition at line 137 of file prlayer.c.

{
    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);

    return (fd->lower->methods->fsync)(fd->lower);
}
static PRStatus PR_CALLBACK pl_DefGetpeername ( PRFileDesc fd,
PRNetAddr addr 
) [static]

Definition at line 388 of file prlayer.c.

{
    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);

    return (fd->lower->methods->getpeername)(fd->lower, addr);
}

Definition at line 396 of file prlayer.c.

{
    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);

    return (fd->lower->methods->getsocketoption)(fd->lower, data);
}
static PRStatus PR_CALLBACK pl_DefGetsockname ( PRFileDesc fd,
PRNetAddr addr 
) [static]

Definition at line 380 of file prlayer.c.

{
    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);

    return (fd->lower->methods->getsockname)(fd->lower, addr);
}
static PRStatus PR_CALLBACK pl_DefListen ( PRFileDesc fd,
PRIntn  backlog 
) [static]

Definition at line 256 of file prlayer.c.

{
    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);

    return (fd->lower->methods->listen)(fd->lower, backlog);
}
static PRInt16 PR_CALLBACK pl_DefPoll ( PRFileDesc fd,
PRInt16  in_flags,
PRInt16 out_flags 
) [static]

Definition at line 315 of file prlayer.c.

{
    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);

    return (fd->lower->methods->poll)(fd->lower, in_flags, out_flags);
}
static PRInt32 PR_CALLBACK pl_DefRead ( PRFileDesc fd,
void buf,
PRInt32  amount 
) [static]

Definition at line 104 of file prlayer.c.

{
    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);

    return (fd->lower->methods->read)(fd->lower, buf, amount);
}
static PRInt32 PR_CALLBACK pl_DefRecv ( PRFileDesc fd,
void buf,
PRInt32  amount,
PRIntn  flags,
PRIntervalTime  timeout 
) [static]

Definition at line 272 of file prlayer.c.

{
    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);

    return (fd->lower->methods->recv)(
        fd->lower, buf, amount, flags, timeout);
}
static PRInt32 PR_CALLBACK pl_DefRecvfrom ( PRFileDesc fd,
void buf,
PRInt32  amount,
PRIntn  flags,
PRNetAddr addr,
PRIntervalTime  timeout 
) [static]

Definition at line 293 of file prlayer.c.

{
    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);

    return (fd->lower->methods->recvfrom)(
        fd->lower, buf, amount, flags, addr, timeout);
}
static PRInt32 PR_CALLBACK pl_DefSeek ( PRFileDesc fd,
PRInt32  offset,
PRSeekWhence  how 
) [static]

Definition at line 145 of file prlayer.c.

{
    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);

    return (fd->lower->methods->seek)(fd->lower, offset, how);
}
static PRInt64 PR_CALLBACK pl_DefSeek64 ( PRFileDesc fd,
PRInt64  offset,
PRSeekWhence  how 
) [static]

Definition at line 154 of file prlayer.c.

{
    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);

    return (fd->lower->methods->seek64)(fd->lower, offset, how);
}
static PRInt32 PR_CALLBACK pl_DefSend ( PRFileDesc fd,
const void buf,
PRInt32  amount,
PRIntn  flags,
PRIntervalTime  timeout 
) [static]

Definition at line 283 of file prlayer.c.

{
    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);

    return (fd->lower->methods->send)(fd->lower, buf, amount, flags, timeout);
}
static PRInt32 PR_CALLBACK pl_DefSendfile ( PRFileDesc sd,
PRSendFileData sfd,
PRTransmitFileFlags  flags,
PRIntervalTime  timeout 
) [static]

Definition at line 414 of file prlayer.c.

{
    PR_ASSERT(sd != NULL);
    PR_ASSERT(sd->lower != NULL);

    return sd->lower->methods->sendfile(
        sd->lower, sfd, flags, timeout);
}
static PRInt32 PR_CALLBACK pl_DefSendto ( PRFileDesc fd,
const void buf,
PRInt32  amount,
PRIntn  flags,
const PRNetAddr addr,
PRIntervalTime  timeout 
) [static]

Definition at line 304 of file prlayer.c.

{
    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);

    return (fd->lower->methods->sendto)(
        fd->lower, buf, amount, flags, addr, timeout);
}

Definition at line 405 of file prlayer.c.

{
    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);

    return (fd->lower->methods->setsocketoption)(fd->lower, data);
}
static PRStatus PR_CALLBACK pl_DefShutdown ( PRFileDesc fd,
PRIntn  how 
) [static]

Definition at line 264 of file prlayer.c.

{
    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);

    return (fd->lower->methods->shutdown)(fd->lower, how);
}
static PRInt32 PR_CALLBACK pl_DefTransmitfile ( PRFileDesc sd,
PRFileDesc fd,
const void headers,
PRInt32  hlen,
PRTransmitFileFlags  flags,
PRIntervalTime  t 
) [static]

Definition at line 369 of file prlayer.c.

{
    PR_ASSERT(sd != NULL);
    PR_ASSERT(sd->lower != NULL);

    return sd->lower->methods->transmitfile(
        sd->lower, fd, headers, hlen, flags, t);
}
static PRInt32 PR_CALLBACK pl_DefWrite ( PRFileDesc fd,
const void buf,
PRInt32  amount 
) [static]

Definition at line 112 of file prlayer.c.

{
    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);

    return (fd->lower->methods->write)(fd->lower, buf, amount);
}
static PRInt32 PR_CALLBACK pl_DefWritev ( PRFileDesc fd,
const PRIOVec iov,
PRInt32  size,
PRIntervalTime  timeout 
) [static]

Definition at line 179 of file prlayer.c.

{
    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);

    return (fd->lower->methods->writev)(fd->lower, iov, size, timeout);
}

Definition at line 53 of file prlayer.c.

{
    PR_ASSERT(fd != NULL);
    if (NULL != fd->lower) fd->lower->higher = fd->higher;
    if (NULL != fd->higher) fd->higher->lower = fd->lower;
    PR_DELETE(fd);
}

Here is the caller graph for this function:

static PRFileDesc* PR_CALLBACK pl_TopAccept ( PRFileDesc fd,
PRNetAddr addr,
PRIntervalTime  timeout 
) [static]

Definition at line 206 of file prlayer.c.

{
    PRStatus rv;
    PRFileDesc *newfd, *layer = fd;
    PRFileDesc *newstack;
       PRBool newstyle_stack = PR_FALSE;

    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);

       /* test for new style stack */
       while (NULL != layer->higher)
              layer = layer->higher;
       newstyle_stack = (PR_IO_LAYER_HEAD == layer->identity) ? PR_TRUE : PR_FALSE;
    newstack = PR_NEW(PRFileDesc);
    if (NULL == newstack)
    {
        PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
        return NULL;
    }
    *newstack = *fd;  /* make a copy of the accepting layer */

    newfd = (fd->lower->methods->accept)(fd->lower, addr, timeout);
    if (NULL == newfd)
    {
        PR_DELETE(newstack);
        return NULL;
    }

    if (newstyle_stack) {
              newstack->lower = newfd;
              newfd->higher = newstack;
              return newstack;
       } else {
              /* this PR_PushIOLayer call cannot fail */
              rv = PR_PushIOLayer(newfd, PR_TOP_IO_LAYER, newstack);
              PR_ASSERT(PR_SUCCESS == rv);
       return newfd;  /* that's it */
       }
}
static PRStatus PR_CALLBACK pl_TopClose ( PRFileDesc fd) [static]

Definition at line 64 of file prlayer.c.

{
    PRFileDesc *top, *lower;
       PRStatus rv;

    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);
    PR_ASSERT(fd->secret == NULL);
    PR_ASSERT(fd->methods->file_type == PR_DESC_LAYERED);

       if (PR_IO_LAYER_HEAD == fd->identity) {
              /*
               * new style stack; close all the layers, before deleting the
               * stack head
               */
              rv = fd->lower->methods->close(fd->lower);
              _PR_DestroyIOLayer(fd);
              return rv;
       } else if ((fd->higher) && (PR_IO_LAYER_HEAD == fd->higher->identity)) {
              /*
               * lower layers of new style stack
               */
              lower = fd->lower;
              /*
               * pop and cleanup current layer
               */
       top = PR_PopIOLayer(fd->higher, PR_TOP_IO_LAYER);
              top->dtor(top);
              /*
               * then call lower layer
               */
              return (lower->methods->close(lower));
       } else {
              /* old style stack */
       top = PR_PopIOLayer(fd, PR_TOP_IO_LAYER);
              top->dtor(top);
              return (fd->methods->close)(fd);
       }
}

Here is the call graph for this function:

Definition at line 465 of file prlayer.c.

{
    return &pl_methods;
}  /* PR_GetDefaultIOMethods */

Definition at line 470 of file prlayer.c.

{
    PRFileDesc *fd = NULL;
    PR_ASSERT((PR_NSPR_IO_LAYER != ident) && (PR_TOP_IO_LAYER != ident));
    if ((PR_NSPR_IO_LAYER == ident) || (PR_TOP_IO_LAYER == ident))
        PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
    else
    {
        fd = PR_NEWZAP(PRFileDesc);
        if (NULL == fd)
            PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
        else
        {
            fd->methods = methods;
            fd->dtor = pl_FDDestructor;
            fd->identity = ident;
        }
    }
    return fd;
}  /* PR_CreateIOLayerStub */

Here is the call graph for this function:

Definition at line 535 of file prlayer.c.

{
    PRFileDesc *insert = PR_GetIdentitiesLayer(stack, id);

    PR_ASSERT(fd != NULL);
    PR_ASSERT(stack != NULL);
    PR_ASSERT(insert != NULL);
    PR_ASSERT(PR_IO_LAYER_HEAD != id);
    if ((NULL == stack) || (NULL == fd) || (NULL == insert))
    {
        PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
        return PR_FAILURE;
    }

    if (stack == insert)
    {
              /* going on top of the stack */
              /* old-style stack */       
              PRFileDesc copy = *stack;
              *stack = *fd;
              *fd = copy;
              fd->higher = stack;
              stack->lower = fd;
              stack->higher = NULL;
       } else {
        /*
               * going somewhere in the middle of the stack for both old and new
               * style stacks, or going on top of stack for new style stack
               */
        fd->lower = insert;
        fd->higher = insert->higher;

        insert->higher->lower = fd;
        insert->higher = fd;
    }

    return PR_SUCCESS;
}

Here is the call graph for this function:

Definition at line 624 of file prlayer.c.

{
    PRDescIdentity identity, length;
    char **names = NULL, *name = NULL, **old = NULL;

    if (!_pr_initialized) _PR_ImplicitInitialization();

    PR_ASSERT((PRDescIdentity)0x7fff > identity_cache.ident);

    if (NULL != layer_name)
    {
        name = (char*)PR_Malloc(strlen(layer_name) + 1);
        if (NULL == name)
        {
            PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
            return PR_INVALID_IO_LAYER;
        }
        strcpy(name, layer_name);
    }

    /* this initial code runs unsafe */
retry:
    PR_ASSERT(NULL == names);
    length = identity_cache.length;
    if (length < (identity_cache.ident + 1))
    {
        length += ID_CACHE_INCREMENT;
        names = (char**)PR_CALLOC(length * sizeof(char*));
        if (NULL == names)
        {
            if (NULL != name) PR_DELETE(name);
            PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
            return PR_INVALID_IO_LAYER;
        }
    }

    /* now we get serious about thread safety */
    PR_Lock(identity_cache.ml);
    PR_ASSERT(identity_cache.ident <= identity_cache.length);
    identity = identity_cache.ident + 1;
    if (identity > identity_cache.length)  /* there's no room */
    {
        /* we have to do something - hopefully it's already done */
        if ((NULL != names) && (length >= identity))
        {
            /* what we did is still okay */
            memcpy(
                names, identity_cache.name,
                identity_cache.length * sizeof(char*));
            old = identity_cache.name;
            identity_cache.name = names;
            identity_cache.length = length;
            names = NULL;
        }
        else
        {
            PR_ASSERT(identity_cache.ident <= identity_cache.length);
            PR_Unlock(identity_cache.ml);
            if (NULL != names) PR_DELETE(names);
            goto retry;
        }
    }
    if (NULL != name) /* there's a name to be stored */
    {
        identity_cache.name[identity] = name;
    }
    identity_cache.ident = identity;
    PR_ASSERT(identity_cache.ident <= identity_cache.length);
    PR_Unlock(identity_cache.ml);

    if (NULL != old) PR_DELETE(old);
    if (NULL != names) PR_DELETE(names);

    return identity;
}  /* PR_GetUniqueIdentity */

Here is the call graph for this function:

PR_IMPLEMENT ( const char *  )

Definition at line 700 of file prlayer.c.

{
    if (!_pr_initialized) _PR_ImplicitInitialization();

    if (PR_TOP_IO_LAYER == ident) return NULL;

    PR_ASSERT(ident <= identity_cache.ident);
    return (ident > identity_cache.ident) ? NULL : identity_cache.name[ident];
}  /* PR_GetNameForIdentity */

Here is the call graph for this function:


Variable Documentation

Definition at line 622 of file prlayer.c.

Definition at line 426 of file prlayer.c.