rem: const char  **temp     = NULL;
add: const char  **temp     = (const char **) 0;
context: static char   *lt_estrdup	LT_PARAMS((const char *str));static lt_ptr lt_emalloc	LT_PARAMS((size_t size));static lt_ptr lt_erealloc	LT_PARAMS((lt_ptr addr, size_t size));static lt_ptr rpl_realloc	LT_PARAMS((lt_ptr ptr, size_t size));/* These are the pointers that can be changed by the caller:  */LT_GLOBAL_DATA lt_ptr (*lt_dlmalloc)	LT_PARAMS((size_t size)) 			= (lt_ptr (*) LT_PARAMS((size_t))) malloc;LT_GLOBAL_DATA lt_ptr (*lt_dlrealloc)	LT_PARAMS((lt_ptr ptr, size_t size)) 			= (lt_ptr (*) LT_PARAMS((lt_ptr, size_t))) rpl_realloc;LT_GLOBAL_DATA void   (*lt_dlfree)	LT_PARAMS((lt_ptr ptr)) 			= (void (*) LT_PARAMS((lt_ptr))) free;/* The following macros reduce the amount of typing needed to cast   assigned memory.  */#if WITH_DMALLOC#define LT_DLMALLOC(tp, n)	((tp *) xmalloc ((n) * sizeof(tp)))#define LT_DLREALLOC(tp, p, n)	((tp *) xrealloc ((p), (n) * sizeof(tp)))#define LT_DLFREE(p)						\	LT_STMT_START { if (p) (p) = (xfree (p), (lt_ptr) 0); } LT_STMT_END#define LT_EMALLOC(tp, n)	((tp *) xmalloc ((n) * sizeof(tp)))#define LT_EREALLOC(tp, p, n)	((tp *) xrealloc ((p), (n) * sizeof(tp)))#else#define LT_DLMALLOC(tp, n)	((tp *) lt_dlmalloc ((n) * sizeof(tp)))#define LT_DLREALLOC(tp, p, n)	((tp *) rpl_realloc ((p), (n) * sizeof(tp)))#define LT_DLFREE(p)						\	LT_STMT_START { if (p) (p) = (lt_dlfree (p), (lt_ptr) 0); } LT_STMT_END#define LT_EMALLOC(tp, n)	((tp *) lt_emalloc ((n) * sizeof(tp)))#define LT_EREALLOC(tp, p, n)	((tp *) lt_erealloc ((p), (n) * sizeof(tp)))#endif#define LT_DLMEM_REASSIGN(p, q)			LT_STMT_START {	\	if ((p) != (q)) { if (p) lt_dlfree (p); (p) = (q); (q) = 0; }	\						} LT_STMT_END/* --- REPLACEMENT FUNCTIONS --- */#undef strdup#define strdup rpl_strdupstatic char *strdup LT_PARAMS((const char *str));static char *strdup(str)     const char *str;{  char *tmp = NULL;  if (str)    {      tmp = LT_DLMALLOC (char, 1+ strlen (str));      if (tmp)	{	  strcpy(tmp, str);	}    }  return tmp;}#if ! HAVE_STRCMP#undef strcmp#define strcmp rpl_strcmpstatic int strcmp LT_PARAMS((const char *str1, const char *str2));static intstrcmp (str1, str2)     const char *str1;     const char *str2;{  if (str1 == str2)    return 0;  if (str1 == NULL)    return -1;  if (str2 == NULL)    return 1;  for (;*str1 && *str2; ++str1, ++str2)    {      if (*str1 != *str2)	break;    }  return (int)(*str1 - *str2);}#endif#if ! HAVE_STRCHR#  if HAVE_INDEX#    define strchr index#  else#    define strchr rpl_strchrstatic const char *strchr LT_PARAMS((const char *str, int ch));static const char*strchr(str, ch)     const char *str;     int ch;{  const char *p;  for (p = str; *p != (char)ch && *p != LT_EOS_CHAR; ++p)    /*NOWORK*/;  return (*p == (char)ch) ? p : 0;}#  endif#endif /* !HAVE_STRCHR */#if ! HAVE_STRRCHR#  if HAVE_RINDEX#    define strrchr rindex#  else#    define strrchr rpl_strrchrstatic const char *strrchr LT_PARAMS((const char *str, int ch));static const char*strrchr(str, ch)     const char *str;     int ch;{  const char *p, *q = NULL;  for (p = str; *p != LT_EOS_CHAR; ++p)    {      if (*p == (char) ch)	{	  q = p;	}    }  return q;}# endif#endif/* NOTE:  Neither bcopy nor the memcpy implementation below can          reliably handle copying in overlapping areas of memory.  Use          memmove (for which there is a fallback implmentation below)	  if you need that behaviour.  */#if ! HAVE_MEMCPY#  if HAVE_BCOPY#    define memcpy(dest, src, size)	bcopy (src, dest, size)#  else#    define memcpy rpl_memcpystatic lt_ptr memcpy LT_PARAMS((lt_ptr dest, const lt_ptr src, size_t size));static lt_ptrmemcpy (dest, src, size)     lt_ptr dest;     const lt_ptr src;     size_t size;{  size_t i = 0;  for (i = 0; i < size; ++i)    {      dest[i] = src[i];    }  return dest;}#  endif /* !HAVE_BCOPY */#endif   /* !HAVE_MEMCPY */#if ! HAVE_MEMMOVE#  define memmove rpl_memmovestatic lt_ptr memmove LT_PARAMS((lt_ptr dest, const lt_ptr src, size_t size));static lt_ptrmemmove (dest, src, size)     lt_ptr dest;     const lt_ptr src;     size_t size;{  size_t i;  if (dest < src)    for (i = 0; i < size; ++i)      {	dest[i] = src[i];      }  else if (dest > src)    for (i = size -1; i >= 0; --i)      {	dest[i] = src[i];      }  return dest;}#endif /* !HAVE_MEMMOVE *//* According to Alexandre Oliva <oliva@lsd.ic.unicamp.br>,    ``realloc is not entirely portable''   In any case we want to use the allocator supplied by the user without   burdening them with an lt_dlrealloc function pointer to maintain.   Instead implement our own version (with known boundary conditions)   using lt_dlmalloc and lt_dlfree. */#undef realloc#define realloc rpl_reallocstatic lt_ptrrealloc (ptr, size)     lt_ptr ptr;     size_t size;{  if (size == 0)    {      /* For zero or less bytes, free the original memory */      if (ptr != NULL)	{	  lt_dlfree (ptr);	}      return (lt_ptr) 0;    }  else if (ptr == NULL)    {      /* Allow reallocation of a NULL pointer.  */      return lt_dlmalloc (size);    }  else    {      /* Allocate a new block, copy and free the old block.  */      lt_ptr mem = lt_dlmalloc (size);      if (mem)	{	  memcpy (mem, ptr, size);	  lt_dlfree (ptr);	}      /* Note that the contents of PTR are not damaged if there is	 insufficient memory to realloc.  */      return mem;    }}#if ! HAVE_ARGZ_APPEND#  define argz_append rpl_argz_appendstatic error_t argz_append LT_PARAMS((char **pargz, size_t *pargz_len,					const char *buf, size_t buf_len));static error_targz_append (pargz, pargz_len, buf, buf_len)     char **pargz;     size_t *pargz_len;     const char *buf;     size_t buf_len;{  size_t argz_len;  char  *argz;  assert (pargz);  assert (pargz_len);  assert ((*pargz && *pargz_len) || (!*pargz && !*pargz_len));  /* If nothing needs to be appended, no more work is required.  */  if (buf_len == 0)    return 0;  /* Ensure there is enough room to append BUF_LEN.  */  argz_len = *pargz_len + buf_len;  argz = LT_DLREALLOC (char, *pargz, argz_len);  if (!argz)    return ENOMEM;  /* Copy characters from BUF after terminating '\0' in ARGZ.  */  memcpy (argz + *pargz_len, buf, buf_len);  /* Assign new values.  */  *pargz = argz;  *pargz_len = argz_len;  return 0;}#endif /* !HAVE_ARGZ_APPEND */#if ! HAVE_ARGZ_CREATE_SEP#  define argz_create_sep rpl_argz_create_sepstatic error_t argz_create_sep LT_PARAMS((const char *str, int delim,					    char **pargz, size_t *pargz_len));static error_targz_create_sep (str, delim, pargz, pargz_len)     const char *str;     int delim;     char **pargz;     size_t *pargz_len;{  size_t argz_len;  char *argz = NULL;  assert (str);  assert (pargz);  assert (pargz_len);  /* Make a copy of STR, but replacing each occurence of     DELIM with '\0'.  */  argz_len = 1+ LT_STRLEN (str);  if (argz_len)    {      const char *p;      char *q;      argz = LT_DLMALLOC (char, argz_len);      if (!argz)	return ENOMEM;      for (p = str, q = argz; *p != LT_EOS_CHAR; ++p)	{	  if (*p == delim)	    {	      /* Ignore leading delimiters, and fold consecutive		 delimiters in STR into a single '\0' in ARGZ.  */	      if ((q > argz) && (q[-1] != LT_EOS_CHAR))		*q++ = LT_EOS_CHAR;	      else		--argz_len;	    }	  else	    *q++ = *p;	}      /* Copy terminating LT_EOS_CHAR.  */      *q = *p;    }  /* If ARGZ_LEN has shrunk to nothing, release ARGZ's memory.  */  if (!argz_len)    LT_DLFREE (argz);  /* Assign new values.  */  *pargz = argz;  *pargz_len = argz_len;  return 0;}#endif /* !HAVE_ARGZ_CREATE_SEP */#if ! HAVE_ARGZ_INSERT#  define argz_insert rpl_argz_insertstatic error_t argz_insert LT_PARAMS((char **pargz, size_t *pargz_len,					char *before, const char *entry));static error_targz_insert (pargz, pargz_len, before, entry)     char **pargz;     size_t *pargz_len;     char *before;     const char *entry;{  assert (pargz);  assert (pargz_len);  assert (entry && *entry);  /* No BEFORE address indicates ENTRY should be inserted after the     current last element.  */  if (!before)    return argz_append (pargz, pargz_len, entry, 1+ LT_STRLEN (entry));  /* This probably indicates a programmer error, but to preserve     semantics, scan back to the start of an entry if BEFORE points     into the middle of it.  */  while ((before >= *pargz) && (before[-1] != LT_EOS_CHAR))    --before;  {    size_t entry_len	= 1+ LT_STRLEN (entry);    size_t argz_len	= *pargz_len + entry_len;    size_t offset	= before - *pargz;    char   *argz	= LT_DLREALLOC (char, *pargz, argz_len);    if (!argz)      return ENOMEM;    /* Make BEFORE point to the equivalent offset in ARGZ that it       used to have in *PARGZ incase realloc() moved the block.  */    before = argz + offset;    /* Move the ARGZ entries starting at BEFORE up into the new       space at the end -- making room to copy ENTRY into the       resulting gap.  */    memmove (before + entry_len, before, *pargz_len - offset);    memcpy  (before, entry, entry_len);    /* Assign new values.  */    *pargz = argz;    *pargz_len = argz_len;  }  return 0;}#endif /* !HAVE_ARGZ_INSERT */#if ! HAVE_ARGZ_NEXT#  define argz_next rpl_argz_nextstatic char *argz_next LT_PARAMS((char *argz, size_t argz_len,				    const char *entry));static char *argz_next (argz, argz_len, entry)     char *argz;     size_t argz_len;     const char *entry;{  assert ((argz && argz_len) || (!argz && !argz_len));  if (entry)    {      /* Either ARGZ/ARGZ_LEN is empty, or ENTRY points into an address	 within the ARGZ vector.  */      assert ((!argz && !argz_len)	      || ((argz <= entry) && (entry < (argz + argz_len))));      /* Move to the char immediately after the terminating	 '\0' of ENTRY.  */      entry = 1+ strchr (entry, LT_EOS_CHAR);      /* Return either the new ENTRY, or else NULL if ARGZ is	 exhausted.  */      return (entry >= argz + argz_len) ? 0 : (char *) entry;    }  else    {      /* This should probably be flagged as a programmer error,	 since starting an argz_next loop with the iterator set	 to ARGZ is safer.  To preserve semantics, handle the NULL	 case by returning the start of ARGZ (if any).  */      if (argz_len > 0)	return argz;      else	return 0;    }}#endif /* !HAVE_ARGZ_NEXT */#if ! HAVE_ARGZ_STRINGIFY#  define argz_stringify rpl_argz_stringifystatic void argz_stringify LT_PARAMS((char *argz, size_t argz_len,				       int sep));static voidargz_stringify (argz, argz_len, sep)     char *argz;     size_t argz_len;     int sep;{  assert ((argz && argz_len) || (!argz && !argz_len));  if (sep)    {      --argz_len;		/* don't stringify the terminating EOS */      while (--argz_len > 0)	{	  if (argz[argz_len] == LT_EOS_CHAR)	    argz[argz_len] = sep;	}    }}#endif /* !HAVE_ARGZ_STRINGIFY *//* --- TYPE DEFINITIONS -- *//* This type is used for the array of caller data sets in each handler. */typedef struct {  lt_dlcaller_id	key;  lt_ptr		data;} lt_caller_data;/* --- OPAQUE STRUCTURES DECLARED IN LTDL.H --- *//* Extract the diagnostic strings from the error table macro in the same   order as the enumerated indices in ltdl.h. */static const char *lt_dlerror_strings[] =  {#define LT_ERROR(name, diagnostic)	(diagnostic),    lt_dlerror_table#undef LT_ERROR    0  };/* This structure is used for the list of registered loaders. */struct lt_dlloader {  struct lt_dlloader   *next;  const char	       *loader_name;	/* identifying name for each loader */  const char	       *sym_prefix;	/* prefix for symbols */  lt_module_open       *module_open;  lt_module_close      *module_close;  lt_find_sym	       *find_sym;  lt_dlloader_exit     *dlloader_exit;  lt_user_data		dlloader_data;};struct lt_dlhandle_struct {  struct lt_dlhandle_struct   *next;  lt_dlloader	       *loader;		/* dlopening interface */  lt_dlinfo		info;  int			depcount;	/* number of dependencies */  lt_dlhandle	       *deplibs;	/* dependencies */  lt_module		module;		/* system module handle */  lt_ptr		system;		/* system specific data */  lt_caller_data       *caller_data;	/* per caller associated data */  int			flags;		/* various boolean stats */};/* Various boolean flags can be stored in the flags field of an   lt_dlhandle_struct... */#define LT_DLGET_FLAG(handle, flag) (((handle)->flags & (flag)) == (flag))#define LT_DLSET_FLAG(handle, flag) ((handle)->flags |= (flag))#define LT_DLRESIDENT_FLAG	    (0x01 << 0)/* ...add more flags here... */#define LT_DLIS_RESIDENT(handle)    LT_DLGET_FLAG(handle, LT_DLRESIDENT_FLAG)#define LT_DLSTRERROR(name)	lt_dlerror_strings[LT_CONC(LT_ERROR_,name)]static	const char	objdir[]		= LTDL_OBJDIR;static	const char	archive_ext[]		= LTDL_ARCHIVE_EXT;#ifdef	LTDL_SHLIB_EXTstatic	const char	shlib_ext[]		= LTDL_SHLIB_EXT;#endif#ifdef	LTDL_SYSSEARCHPATHstatic	const char	sys_search_path[]	= LTDL_SYSSEARCHPATH;#endif/* --- MUTEX LOCKING --- *//* Macros to make it easier to run the lock functions only if they have   been registered.  The reason for the complicated lock macro is to   ensure that the stored error message from the last error is not   accidentally erased if the current function doesn't generate an   error of its own.  */#define LT_DLMUTEX_LOCK()			LT_STMT_START {	\	if (lt_dlmutex_lock_func) (*lt_dlmutex_lock_func)();	\						} LT_STMT_END#define LT_DLMUTEX_UNLOCK()			LT_STMT_START { \	if (lt_dlmutex_unlock_func) (*lt_dlmutex_unlock_func)();\						} LT_STMT_END#define LT_DLMUTEX_SETERROR(errormsg)		LT_STMT_START {	\	if (lt_dlmutex_seterror_func)				\		(*lt_dlmutex_seterror_func) (errormsg);		\	else 	lt_dllast_error = (errormsg);	} LT_STMT_END#define LT_DLMUTEX_GETERROR(errormsg)		LT_STMT_START {	\	if (lt_dlmutex_seterror_func)				\		(errormsg) = (*lt_dlmutex_geterror_func) ();	\	else	(errormsg) = lt_dllast_error;	} LT_STMT_END/* The mutex functions stored here are global, and are necessarily the   same for all threads that wish to share access to libltdl.  */static	lt_dlmutex_lock	    *lt_dlmutex_lock_func     = NULL;static	lt_dlmutex_unlock   *lt_dlmutex_unlock_func   = NULL;static	lt_dlmutex_seterror *lt_dlmutex_seterror_func = NULL;static	lt_dlmutex_geterror *lt_dlmutex_geterror_func = NULL;static	const char	    *lt_dllast_error	      = NULL;/* Either set or reset the mutex functions.  Either all the arguments must   be valid functions, or else all can be NULL to turn off locking entirely.   The registered functions should be manipulating a static global lock   from the lock() and unlock() callbacks, which needs to be reentrant.  */intlt_dlmutex_register (lock, unlock, seterror, geterror)     lt_dlmutex_lock *lock;     lt_dlmutex_unlock *unlock;     lt_dlmutex_seterror *seterror;     lt_dlmutex_geterror *geterror;{  lt_dlmutex_unlock *old_unlock = unlock;  int		     errors	= 0;  /* Lock using the old lock() callback, if any.  */  LT_DLMUTEX_LOCK ();  if ((lock && unlock && seterror && geterror)      || !(lock || unlock || seterror || geterror))    {      lt_dlmutex_lock_func     = lock;      lt_dlmutex_unlock_func   = unlock;      lt_dlmutex_geterror_func = geterror;    }  else    {      LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_MUTEX_ARGS));      ++errors;    }  /* Use the old unlock() callback we saved earlier, if any.  Otherwise     record any errors using internal storage.  */  if (old_unlock)    (*old_unlock) ();  /* Return the number of errors encountered during the execution of     this function.  */  return errors;}/* --- ERROR HANDLING --- */static	const char    **user_error_strings	= NULL;static	int		errorcount		= LT_ERROR_MAX;intlt_dladderror (diagnostic)     const char *diagnostic;{  int		errindex = 0;  int		result	 = -1;  const char  **temp     = NULL;  assert (diagnostic);  LT_DLMUTEX_LOCK ();  errindex = errorcount - LT_ERROR_MAX;  temp = LT_EREALLOC (const char *, user_error_strings, 1 + errindex);  if (temp)    {      user_error_strings		= temp;      user_error_strings[errindex]	= diagnostic;      result				= errorcount++;    }  LT_DLMUTEX_UNLOCK ();  return result;}intlt_dlseterror (errindex)     int errindex;{  int		errors	 = 0;  LT_DLMUTEX_LOCK ();  if (errindex >= errorcount || errindex < 0)    {      /* Ack!  Error setting the error message! */      LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_ERRORCODE));      ++errors;    }  else if (errindex < LT_ERROR_MAX)    {      /* No error setting the error message! */      LT_DLMUTEX_SETERROR (lt_dlerror_strings[errindex]);    }  else    {      /* No error setting the error message! */      LT_DLMUTEX_SETERROR (user_error_strings[errindex - LT_ERROR_MAX]);    }  LT_DLMUTEX_UNLOCK ();  return errors;}static lt_ptrlt_emalloc (size)     size_t size;{  lt_ptr mem = lt_dlmalloc (size);  if (size && !mem)    LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY));  return mem;}static lt_ptrlt_erealloc (addr, size)     lt_ptr addr;     size_t size;{  lt_ptr mem = realloc (addr, size);  if (size && !mem)    LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY));  return mem;}static char *lt_estrdup (str)     const char *str;{  char *copy = strdup (str);  if (LT_STRLEN (str) && !copy)    LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY));  return copy;}