Back to index

lightning-sunbird  0.9+nobinonly
Functions
libc.c File Reference
#include "base.h"
#include <string.h>

Go to the source code of this file.

Functions

NSS_IMPLEMENT voidnsslibc_memcpy (void *dest, const void *source, PRUint32 n)
NSS_IMPLEMENT voidnsslibc_memset (void *dest, PRUint8 byte, PRUint32 n)
NSS_IMPLEMENT PRBool nsslibc_memequal (const void *a, const void *b, PRUint32 len, PRStatus *statusOpt)
NSS_IMPLEMENT PRInt32 nsslibc_memcmp (const void *a, const void *b, PRUint32 len, PRStatus *statusOpt)

Function Documentation

NSS_IMPLEMENT PRInt32 nsslibc_memcmp ( const void a,
const void b,
PRUint32  len,
PRStatus statusOpt 
)

Definition at line 171 of file libc.c.

{
  int v;

#ifdef NSSDEBUG
  if( (((void *)NULL == a) || ((void *)NULL == b)) ) {
    nss_SetError(NSS_ERROR_INVALID_POINTER);
    if( (PRStatus *)NULL != statusOpt ) {
      *statusOpt = PR_FAILURE;
    }
    return -2;
  }
#endif /* NSSDEBUG */

  if( (PRStatus *)NULL != statusOpt ) {
    *statusOpt = PR_SUCCESS;
  }

  v = memcmp(a, b, len);
  return (PRInt32)v;
}

Here is the call graph for this function:

NSS_IMPLEMENT void* nsslibc_memcpy ( void dest,
const void source,
PRUint32  n 
)

Definition at line 78 of file libc.c.

{
#ifdef NSSDEBUG
  if( ((void *)NULL == dest) || ((const void *)NULL == source) ) {
    nss_SetError(NSS_ERROR_INVALID_POINTER);
    return (void *)NULL;
  }
#endif /* NSSDEBUG */

  return memcpy(dest, source, (size_t)n);
}

Here is the call graph for this function:

Here is the caller graph for this function:

NSS_IMPLEMENT PRBool nsslibc_memequal ( const void a,
const void b,
PRUint32  len,
PRStatus statusOpt 
)

Definition at line 137 of file libc.c.

{
#ifdef NSSDEBUG
  if( (((void *)NULL == a) || ((void *)NULL == b)) ) {
    nss_SetError(NSS_ERROR_INVALID_POINTER);
    if( (PRStatus *)NULL != statusOpt ) {
      *statusOpt = PR_FAILURE;
    }
    return PR_FALSE;
  }
#endif /* NSSDEBUG */

  if( (PRStatus *)NULL != statusOpt ) {
    *statusOpt = PR_SUCCESS;
  }

  if( 0 == memcmp(a, b, len) ) {
    return PR_TRUE;
  } else {
    return PR_FALSE;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

NSS_IMPLEMENT void* nsslibc_memset ( void dest,
PRUint8  byte,
PRUint32  n 
)

Definition at line 107 of file libc.c.

{
#ifdef NSSDEBUG
  if( ((void *)NULL == dest) ) {
    nss_SetError(NSS_ERROR_INVALID_POINTER);
    return (void *)NULL;
  }
#endif /* NSSDEBUG */

  return memset(dest, (int)byte, (size_t)n);
}

Here is the call graph for this function:

Here is the caller graph for this function: